Reputation: 28
I've been running WSL2 on Windows 10 for several months now and just recently lost these abilities. I can still open a WSL2 terminal and interact with my Ubuntu installation there.
Accessing WSL2 files from explorer
I could previously go to \\wsl$\Ubuntu
and see all my WSL2 files. I can still see the Ubuntu folder at \\wsl$
, but when I try to open it I get a loading bar and nothing happens (even after waiting for a long time):
Opening Windows program from WSL2
Previously I could open Windows programs like explorer and VSCode from a WSL2 terminal with explorer.exe
and code
respectively. Now when I try this the terminal just hangs and nothing opens.
Note that I can still navigate to /mnt/
and see all my Windows files from the WSL2 terminal.
I'm running Windows 10 Version 1909 (OS Build 18363.1379) and Ubuntu 20.04.1.
Upvotes: 1
Views: 9936
Reputation: 1700
I had the same issue (although on Windows 11). It was very annoying. I noticed that after a restart it was ok, but after a few minutes and almost always after running VSCode, it was breaking again. Here's what worked for me:
wsl --export <Distro> <FileName>
)wsl --unregister <Distro>
)wsl --import <Distro> <InstallLocation> <FileName>
)After going through the above steps the issue was resolved and now my WSL2 works like a charm.
Upvotes: 1
Reputation: 20640
I'm not sure I have an answer for you, but some general troubleshooting steps to try:
Exit your instances and try a wsl --shutdown
.
If that works, try turning off Windows Fast Startup. Also avoid hibernation. These are known to interfere with some WSL network functionality.
Try adding the following section to your /etc/wsl.conf
:
[interop]
enabled = true
This should be the default, but it wouldn't be the first time we've seen WSL not following the defaults for some reason.
Make sure your Windows temp directory is not compressed
Make sure your distribution folder under %userprofile%/Local/AppData/Packages
is not compressed, especially the LocalState
subdirectory where the ext4.vhdx
lives.
If enabled, try turning off Windows Ransomware Protection
Upvotes: 5