Repository navigation
feat(doctor): check the named distro, staged agent, hvsocket registration and the port - #105
Merged
Merged
Conversation
…on and the port `wsldrive doctor` checked WinFsp, wsl.exe and the *default* distro. That left it unable to answer the questions people actually arrive with, including the one the Direction B docs send them to doctor for. doctor [--distro X] [--hvsocket] [--port N] [--pause] - --distro X runs a command in that distro. `mount --distro X` would otherwise fail later, for its own reasons, on a name that was simply wrong. - The agent staged at ~/.local/bin/wsldrived is checked in the named distro (or the default). Reported as a warning, not a failure: --agent can point elsewhere. - --hvsocket counts the GuestCommunicationServices GUIDs for the port range and says how to fix a shortfall. This is the check the Direction B setup notes point at, and doctor had no answer for it. It found a real one here: the ten registrations this machine was set up with are gone, 0/10. - --port N binds the loopback port to see whether it is free, so a stale agent holding it is named now rather than surfacing as a confusing mount failure. - --pause holds the console open. The Inno postinstall task runs doctor in a window that closed before the report could be read; it now passes --pause. Unknown options are refused with exit 2 rather than ignored. Verified on this machine: a clean run passes and exits 0; --distro Ubuntu --hvsocket --port 5700 reports the distro and staged agent ok, the port free, and the missing GUIDs as a failure with exit 1 - independently confirmed against the registry, so it is a true negative and not a bad key path; a nonexistent distro fails the distro check and warns on the agent; --bogus exits 2. The wizard still compiles. Windows-only code, so Linux is untouched: 126/126 there and conformance 31/0, Windows 124/124. Closes #77
The doctor helpers are guarded by _WIN32, but their dependency was included under the narrower WSLDRIVE_HAVE_WINFSP. That builds on a machine with the WinFsp SDK installed - mine - and fails on the plain Windows CI job, which does not install it: error C2039: 'to_wide': is not a member of 'wsld' Caught by CI, which is the only place that configuration is built.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #77.
wsldrive doctorchecked WinFsp,wsl.exeand the default distro. That left it unable to answer the questions people actually arrive with — including the one the Direction B setup notes explicitly send them to doctor for.--distro Xruns a command in that distromount --distro Xotherwise fails later, for its own reasons, on a name that was simply wrong~/.local/bin/wsldrived--agentcan point elsewhere--hvsocketcounts the GuestCommunicationServices GUIDs--port Nbinds the loopback port--pauseholds the console open--pauseUnknown options are refused with exit 2 rather than ignored.
It found a real problem on the first run. The ten hvsocket registrations this machine was set up with are gone — 0/10 — which I confirmed independently against the registry before trusting the check, so it is a true negative and not a wrong key path.
Verification
The wizard still compiles. Windows-only code, so Linux is untouched: 126/126 and conformance 31/0 there; Windows 124/124.