microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.41k stars 822 forks source link

I cannot access wsl files from Windows #5539

Closed Beanbit closed 4 years ago

Beanbit commented 4 years ago

I know this is a duplicate issue. I've tried many of the suggested fixes in https://github.com/microsoft/WSL/issues/4260 with no success.

Environment

Windows build number: *Win32NT  10.0.19041.0 Microsoft Windows NT 10.0.19041.0*
Your Distribution version: Release: Ubuntu *Release:  20.04*
Whether the issue is on WSL 2 and/or WSL 1:  WSL2 *Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020*

Steps to reproduce

I've tried 3 ways to access wsl2 Ubuntu files in windows.

Add Network Location with \wsl$\Ubuntu-20.04 as the address.

\wsl$\Ubuntu-20.04 in file explorer address bar

explorer.exe . in wsl.

Expected behavior

I'm expecting to be able to access wsl from windows. With Add Network Location I was expecting it to mount a network location to the \wsl$\Ubuntu-20.04 directory Navigating to \wsl$\Ubuntu-20.04 should open that directory in file explorer.

With explorer.exe . in wsl I'm expecting a file explorer window to open to the current directory.

Add network location should mount a new folder in windows to that directory.

Actual behavior

Using the file explorer address bar says there is a network error. File explorer address bar

Using Add Network Location gives the following error Add Network Location

explorer.exe . just opens up explorer to my documents folder. explorer.exe .

Please note this is while WSL is running PS C:\WINDOWS\system32> wsl --list --verbose NAME STATE VERSION

licanhua commented 4 years ago

I would suggest you try this:

  1. save your work, and wsl --shutdown in a console with admin
  2. re-launch Ubuntu
  3. powershell.exe start . in Linux instead of explorer.exe
  4. or Win+R, then run \\wsl$
Beanbit commented 4 years ago

I've tried these and did not have any success. Option 4 gave the the same error as the second screen shot above and option 3 gave me the following error:

start : This command cannot be run due to the error: The network path was not found. At line:1 char:1 start .

 CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
 FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
licanhua commented 4 years ago

I guess 9p has some problem. Can you try dmesg |grep 9p in linux? Here is my output:

[    0.363323] 9p: Installing v9fs 9p2000 file system support
[    0.363336] FS-Cache: Netfs '9p' registered for caching
[    0.398989] 9pnet: Installing 9P2000 support
licanhua commented 4 years ago

possible the same with #5307

Beanbit commented 4 years ago

@licanhua https://github.com/microsoft/WSL/issues/5307 was indeed the problem. I wasn't very deep into my own setup so ended up uninstalling WSL completely and reinstalling. Problem fixed. Thanks for your help.

therealkenc commented 4 years ago

/dupe #5307

ghost commented 4 years ago

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!