WSL: Cannot Access WSL2 File System from Explorer at Startup [Build 20215]
Environment
Windows build number: 10.0.20215.1000
Your Distribution version: 20.04
Whether the issue is on WSL 2 and/or WSL 1: WSL2
Steps to reproduce
Every new startup of Windows 10 Build 20215 has this issue.
Expected behavior
WSL2 file system should be automatically connected to Windows10 via 9p at startup.
Actual behavior
- On a new startup of Windows 10 Build 20215: In the Explorer, the Penquin icon is there with Ubuntu folder inside. But clicking on the folder shows folder not accessible.
- In Windows Terminal, my Ubuntu terminal would start with
~directory when under Windows Build 20201. But now it starts with /mnt/c/User/XXX in Windows Build 20215. I CANcdinto Ubuntu file system without problem though. - Run
wsl --shutdownand restart WSL2 in Powershell as admin solve the problem. Now Explorer can access the Ubuntu file system and Windows Terminal (Ubuntu Terminal actually) starts correctly with~correctly. - Restart Windows will reproduce this issue again.
P.S.: My Ubuntu is on an independent internal disk other than Drive C:. It has worked fine since Build 20150 until now. I did skip the builds after 20201 and before 20215.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 24 (1 by maintainers)
After reboot, opening a linux terminal from windows terminal gives cannot access \\wsl$\xxx error (home folders set to \\wsl$\home\xxxx or \\wls$\root)
running wsl – any parameter at all, just any other wsl action other than trying to start a wsl terminal, in PS and now \\wsl$\ becomes available and linux terminals open fine. once linux terminals are opened /mnt/c etc are available, so seems the linux side P9 is all good.
was fine before windows 11 upgrade. I notice in windows 11 the P9RdrService_xxxx is set to Manual (trigger), start the service and \\wsl$\ appears, linux terminals open fine.
Time for a quick reg hack,
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\P9Rdr Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\P9RdrService Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\xP9RdrService_xxxx
change Start value from 3 (manual/trigger) to 2 (auto/trigger)
just changing the user specific (P9RdrService_xxxx) Start value saw the value reverting on reboot. Did not test if you need to change all 3, probably just one of the others would have set the other two on reboot? Hey… can’t spend all day on this.
now \\wsl$\ file system is available immediately after boot and linux terminals open from windows terminal without having to manually run a wsl command to trigger the P9Service .
only tried a couple of reboots, so far so good, so I will have to report back if it does revert at some point.
Regardless, seems the P9Service is not triggered by trying to start a linux terminal from windows terminal. Repeatedly trying to start a linux terminal from windows terminal does not cause it to trigger. Was fine in windows 10 so going to blame windows 11, not windows terminal 😃
Regards BaDboD