WSL: File explorer crashes when opening WSL folders in Windows 11
Version
Windows 11 [10.0.22000.348]
WSL Version
- WSL 2
- WSL 1
Kernel Version
5.10.74.3
Distro Version
Ubuntu 20.04
Other Software
wsl --version
WSL version: 0.50.2.0
Kernel version: 5.10.74.3
WSLg version: 1.0.29
Windows version: 10.0.22000.348
Repro Steps
Just opening the “Ubuntu” folder in File Explorer.
Expected Behavior
Should open the folder.
Actual Behavior
1 out of 3 times File Explorer just become unresponsible and crashes, using the WSL terminal in the meantime works without any issue.
Diagnostic Logs
No response
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 23
- Comments: 64 (9 by maintainers)
I’m experiencing this on Windows 11 for a week or two now as well, with the WSL Preview version. Seemingly randomly but mostly after a few hours of working, the WSL drive becomes completely incessible from Windows (only the WSL terminal still works). AFAIK only a reboot can resolve it, really annoying.
I don’t know if this may help identify the cause and if others are experiencing the same: when the problem occurs, not only the WSL filesystem becomes inaccessible from File Explorer, but also:
Thanks everybody for your help so far, I’m actively working on getting a local repro.
Thanks a lot to everyone who posted logs and helped with this investigation.
We have identified the root cause of this issue in #7883 (see this comment for the detailed explanation).
Closing this as duplicate.
Having the same issue. My theory is that this might be caused by filesystem activity inside WSL while using the same files from windows. e.g. having filesystem watches for continuous rebuilds of code inside WSL while files are open in the IDE on windows, or doing git commands from commandline while IDE is open.
I don’t know about the other people in here this affects but for me it is going to be a bit hard to capture with the recording in the feedback hub. It isn’t like I’m actively browsing the WSL file system in explorer and it starts to hang, I can access it fine then I can go back 30/60/90 minutes later and it has hung.
It seems to only happen if you have installed WSL through Microsoft Store - https://www.microsoft.com/store/productId/9P9TQF7MRM4R. Since I uninstalled WSL as the app and installed WSL throuh
wsl --installit hasn’t happened yet.Until it’s fixed, it’s useless. I spent lot of time with reinstalling the Windows. In my case, IDE was also freezing as it couldn’t access files, very annoying.
Same problem. Works 1 in 3 times. If crashes can only be fixed by reboot. Also since the last crash I cannot from Ubuntu start visual code by time code ., now just hangs
The workaround is to remove the WSL version installed from the store as explained here: https://github.com/microsoft/WSL/issues/7754#issuecomment-990057935
@overflowz - The issue was closed by a bot and not the author, so since it can only be reopened by collaborators and team members as far as I know in this case I’d probably refer to one of them (@OneBlue).
Anyways, @alex180500, at the least can you post a WER report of your latest explorer.exe crash? It should include the exception code and faulting modules.
It should be something like this in /etc/wsl.conf file:
automount and fileServer are two different sections.
Same problem here, this bug was driving me crazy. In addition to WSL files being inaccessible, file explorer stops autorefreshing the directories (so I would need to manually trigger the refresh after every file copy/move/rename etc.). Luckily the temporary fix above has worked for me as well, thank you!
This doesn’t work as a workaround for me, currently I have WSL Windows feature turned off
On the insiders version I’m on it seems to install the Windows Store App automatically.
When I lose the functionality all that works is turning that feature off, or on again and it works for a while before happening again.
Quality bug report that right there ☝️ 😂
As mentioned above simply uninstalling the WSL Preview app from the Store and letting it fallback to the WSL version supplied with Windows 11 has resolved this issue for me.
I requested to document it some days ago here https://github.com/MicrosoftDocs/WSL/pull/1365#issuecomment-985221814
I haven’t lost anything, I just had to toggle WSL feature https://pureinfotech.com/uninstall-wsl2-windows-10/. But it’s not smooth change, if I wouldn’t have everything backed up, I wouldn’t risk it either.
Another thing to point out is that whenever you first start the wsl, file explorer (or vscode or 9p for that matter) works all the time (at least for me), these crashes only happens after a while.
This has happened to me as well. What worked for me was to do a
wsl --shutdown, repair the “Windows Subsystem for Linux Preview” app, and then reboot.The hang continues to happen, but I was able to launch
codeand other Windows tools from WSL again.@benhillis: Opening a non-trivial project in Visual Studio from the WSL filesystem and then running the debugger is a trigger for me ~75% of the time. The build typically runs normally and then the debugger attach and symbol loading have a massive slow-down. After, just about any activity via the
//wsl$share will start to hang. Often, just working in Visual Studio against source on the WSL filesystem and saving files frequently will randomly cause the hang as well.The last time it happened, I noticed the following, though I’m not sure if it has any significance:
Environment:
I wonder if this is related to an issue I’m seeing as well #7773