Start the plan9 server on WSL2 even when automount and mountFsTab are… (#41057)
* Start the plan9 server on WSL2 even when automount and mountFsTab are 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 #41056 * Refactor comments for Plan 9 server setup Updated comments for clarity regarding Plan 9 server requirements on WSL1 and WSL2.
Shuo Li committed
Jul 15, 2026 at 23:18 UTC
989bb3ed18a3a87d332bd9a97a397d4ee08bacac
1 file changed
+5
-5
src/linux/init/config.cpp
+5
-5
@@ -845,16 +845,16 @@ try
845
}
846
847
//
848
- // Run the Plan 9 server. This requires a DrvFs mount for the socket file,
849
- // so either fstab or automount must be enabled to have a chance for the
850
- // mount to be available.
848
+ // Run the Plan 9 server. On WSL1 this requires a DrvFs mount for the socket
849
+ // file, so either fstab or automount must be enabled to have a chance for
850
+ // the mount to be available. WSL2 serves over an hvsocket and has no such
851
+ // dependency.
852
//
853
// N.B. Failure to start the server is non-fatal.
854
//
854
-
855
unsigned int Plan9Port = LX_INIT_UTILITY_VM_INVALID_PORT;
856
if ((WI_IsFlagClear(Config.FeatureFlags.value(), LxInitFeatureDisable9pServer)) && (Config.Plan9Enabled) &&
857
- (Config.AutoMount || Config.MountFsTab))
857
+ (UtilIsUtilityVm() || Config.AutoMount || Config.MountFsTab))
858
{
859
std::tie(Plan9Port, Config.Plan9ControlChannel) = StartPlan9Server(Plan9SocketPath, Config);
860
}