Commit 8e56f7e
committed
ioutilx, hostagent: support reverse-sshfs on plain Windows
ioutilx.WindowsSubsystemPath: keep cygpath as the preferred backend
(it respects any custom fstab the user has configured for MSYS2 / Git
for Windows), but add a native fallback for the common drive-letter
case (C:\Users\jan -> /c/Users/jan). Without the fallback, plain
Windows installs that have neither Git for Windows nor MSYS2 hit a
fatal error during fillDefault when computing the default mountPoint
for a host mount. After this change, the default mountPoint is
computed correctly without external tooling.
hostagent.setupMount: switch the host-path translation from
ioutilx.WindowsSubsystemPath to sshutil.PathForSSH. The path is
consumed by the sftp-server that sshocker spawns, and the format that
binary expects depends on toolchain: Cygwin sftp-server (Git for
Windows / MSYS2) wants Cygwin paths, native Windows sftp-server wants
native forward-slash paths. PathForSSH already encodes that decision.
Verified end-to-end on Windows 11 with QEMU 10.2.0 and only native
Windows OpenSSH on PATH (no Git for Windows, no MSYS2): reverse-sshfs
mounts a host directory into the guest, both sides see the same files,
read and write both work, and the host-side sftp-server is the
ssh-built-in C:\Windows\System32\OpenSSH\sftp-server.exe (auto-detected
by sshocker via exec.LookPath).
Signed-off-by: Jan Dubois <jan.dubois@suse.com>1 parent df59f8f commit 8e56f7e
2 files changed
Lines changed: 25 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | | - | |
58 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| |||
0 commit comments