Start the plan9 server on WSL2 even when automount and mountFsTab are…#41057
Open
Lsseeker wants to merge 2 commits into
Open
Start the plan9 server on WSL2 even when automount and mountFsTab are…#41057Lsseeker wants to merge 2 commits into
Lsseeker wants to merge 2 commits into
Conversation
… disabled The (AutoMount || MountFsTab) guard exists because on WSL1 the plan9 socket file lives on a DrvFs mount. WSL2 serves over an hvsocket and never uses the socket path, so the guard unintentionally disabled \\wsl.localhost access for distros with both options turned off. Fixes microsoft#41056
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a WSL2 regression where disabling both automount.enabled and automount.mountFsTab prevents init from starting the Plan9 server, making \\wsl.localhost\<distro> / \\wsl$\<distro> inaccessible. It updates the Plan9-server startup guard so WSL2 (utility VM) no longer depends on DrvFs mount-related settings that only matter for WSL1.
Changes:
- Update the Plan9 server start condition to allow WSL2 (
UtilIsUtilityVm()) even whenAutoMountandMountFsTabare both false. - Update the surrounding comment to clarify the WSL1-only DrvFs socket-path dependency.
Updated comments for clarity regarding Plan 9 server requirements on WSL1 and WSL2.
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.
Fixes #41056
On WSL2, when
/etc/wsl.confhas bothautomount.enabled = falseandautomount.mountFsTab = false, init never starts the plan9 file server, so\\wsl.localhost\<distro>/\\wsl$\<distro>are inaccessible.The guard in
ConfigInitializeInstance()requires(Config.AutoMount || Config.MountFsTab)because the server "requires a DrvFsmount for the socket file". That rationale only applies to WSL1: on WSL2,
StartPlan9Server()binds an hvsocket (UtilBindVsockAnyPort) and never usesthe socket path — the initialize message carries an empty
Plan9SocketOffset(see the trace excerpt in #41056).
This change exempts WSL2 (
UtilIsUtilityVm()) from the mount requirement:default configuration (where automount is enabled and the server starts).
server can use the dedicated setting (
Config.Plan9Enabled) instead.Testing: verified by code inspection and the ETW trace attached to #41056
(
LxInitMessageInitializeResponsecarriesPlan9Port = LX_INIT_UTILITY_VM_INVALID_PORTwhileFeatureFlags = 0). Idon't currently have a local build environment, so this has not been build- or
runtime-tested on my side — happy to add a regression test if you can point me
at the right harness.