Skip to content

feat: one-flag --hvsocket for the mount - #25

Merged
zcsizmadia merged 1 commit into
mainfrom
feat-hvsocket-ux
Aug 28, 2026
Merged

zcsizmadia merged 1 commit into
mainfrom
feat-hvsocket-ux

Conversation

@zcsizmadia

Copy link
Copy Markdown
Collaborator

wsldrive mount X: --distro <d> --wsl-root <p> --hvsocket auto-launches the agent over vsock and connects over AF_HYPERV. VM-GUID auto-discovery (hcsdiag) + --vm-guid override. Verified: mounts in ~3s.

Makes the Hyper-V socket transport a single command instead of manual GUID/port
wiring:

  wsldrive mount X: --distro Ubuntu --wsl-root ~/proj --hvsocket [--vm-guid G]

- WslAgentSpec gains a `listen` endpoint; the auto-launched agent listens on
  vsock://any:<port> (default 5700, a registered vsock port) and the Windows
  client connects to hv://{vm-guid}:<port>.
- discover_wsl_vm_guid() finds the WSL2 VM GUID via `hcsdiag list` (needs
  Hyper-V admin); --vm-guid overrides it for non-admin use.
- The auto-launch waits briefly before connecting, since an AF_HYPERV connect
  blocks on a long OS timeout when the service is not yet listening (unlike
  TCP's fast refusal).

Verified: `wsldrive mount X: --distro Ubuntu --wsl-root ~/wsldrive-bench
--hvsocket --vm-guid <g>` mounts X: over hvsocket in ~3 s; dir + reads work.
build_wsl_command vsock case unit-tested. 98/98 Windows, zero warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@zcsizmadia
zcsizmadia merged commit 12ddbb5 into main Aug 28, 2026
3 checks passed
@zcsizmadia
zcsizmadia deleted the feat-hvsocket-ux branch August 28, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant