简体   繁体   中英

Can no longer access WSL2 files from Windows explorer or launch Windows programs from WSL2

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): 无法打开 Ubuntu 文件夹

Also in Powershell: 在此处输入图像描述

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM