Skip to content

WSL2: can't access linux file system from windows #4260

Closed

Description

Please fill out the below information:

/c/WINDOWS/explorer.exe: Invalid argument
  • Strace of the failing command, if applicable: No other errors logged. If I'm given instructions I'm happy to run diagnostic commands and report back.

Activity

  1. martaver commented on Jul 2, 2019

    @martaver
    Author

    Note: running explorer.exe . from a mounted windows drive, e.g. /mnt/c works fine.

    This is a blocker, preventing me from opening a project located on the linux file system in VSCode.

  2. onomatopellan commented on Jul 2, 2019

    @onomatopellan

    Things I'd try:
    -Try using the real bash terminal or the new Windows terminal, not the one inside Vscode.
    -Look at /etc/wsl.conf content. (that /c/WINDOWS/ is fishy)
    -See dmesg output to see if it tells what's happening.

  3. martaver commented on Jul 2, 2019

    @martaver
    Author

    I am mounting /mnt/... drive directly under / in my wsl.conf...

    I ruled that out, though, because explorer.exe . works fine from within the mounted drive at /c/...

    Would you mind giving me some more information on how I can debug this using dmesg?

    VSCode remoting to WSL works quite nicely, btw.

  4. craigloewen-msft commented on Jul 2, 2019

    @craigloewen-msft
    Member

    Another troubleshooting idea: If you go into File Explorer and type in: \\wsl$\<yourDistroName\ into the address bar (replacing with the name of your distro which you can see from wsl -l), does that work or does that result in an error?

  5. martaver commented on Jul 3, 2019

    @martaver
    Author

    Ah, so from File Explorer, browsing to \\wsl$\Ubuntu-18.04\ gives me error:

    \\wsl$\Ubuntu-18.04 is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.
    
    Attempt to access invalid address.
    

    Can't quite tell if this is a permissions issue, or 'invalid address'... any ideas?

  6. craigloewen-msft commented on Jul 3, 2019

    @craigloewen-msft
    Member

    This seems to be an error with the Plan 9 server. Sven Groot (@SvenGroot) is the resident expert for this area!

  7. erikhakansson commented on Jul 4, 2019

    @erikhakansson

    I suddenly have this issue too after upgrading to 18932. It worked previously but with issues (#4262)

  8. erikhakansson commented on Jul 4, 2019

    @erikhakansson

    sudo apt update && sudo apt upgrade followed by wsl --shutdown and then starting wsl again resolved the issue for me.

    But I don't know if it's permanently or not.

  9. martaver commented on Jul 4, 2019

    @martaver
    Author

    Erik Håkansson (@erikhakansson)'s steps didn't change the problem for me.

  10. onomatopellan commented on Jul 4, 2019

    @onomatopellan

    Sebastian Nemeth (@martaver) I think your issue it's very similar to #4027
    Keep reading and try the registry workaraound that Sven suggested in that thread.

  11. stuffaboutpete commented on Jul 5, 2019

    @stuffaboutpete

    I'm struggling with the same and the linked issue wasn't my problem - the registry values were already correct. apt upgrade also made no difference although running wsl --shutdown is helpful because it saves logging out or rebooting.

  12. peidaqi commented on Jul 25, 2019

    @peidaqi

    Same here.

    \wsl$ is very unstable and drops from time to time. This seems to have something to do with number of writes - I often have the problem after working with a project from VSCode (and save the files several times).

    It can be decieving that sometimes \wsl$\ can still be accessed, but this is from cache. If you try to actually open the files using notepad/vscode you will still have a filesystem error.

    Restarting WSL with wsl --shutdown seems to fix it temporarily.

  13. enterit commented on Aug 14, 2019

    @enterit

    Ah, so from File Explorer, browsing to \\wsl$\Ubuntu-18.04\ gives me error:

    \\wsl$\Ubuntu-18.04 is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.
    
    Attempt to access invalid address.
    

    Can't quite tell if this is a permissions issue, or 'invalid address'... any ideas?

    I am seeing exactly the same issue on my Windows 10 1903 18941.1001.
    Updating Ubuntu or restarting WSL did not help.
    Sebastian Nemeth (@martaver), have you by any chance figured out how to fix this?

  14. shm-tar commented on Sep 12, 2019

    @shm-tar

    Exact same issue on Windows 10 1903, but when running explorer.exe inside WSL, it opens Windows explorer on This PC page.

  15. David-Defoort commented on Sep 14, 2019

    @David-Defoort

    I've updated to 1903 18362.356 as of yesterday and I'm having this issue as well

    • Explorer shows Ubuntu under \\wsl$ but when I double click I get:
      image
    • inside a cmd, dir \\wsl$\Ubuntu does not works ("The system cannot find the path specified.")
    • (in bash) explorer.exe . inside a /mnt point works fine. Explorer.exe comes up to the expected path location
    • (in bash) explorer.exe . outside a /mnt point does nothing, it does not even bring explorer at all
    • (in bash) code does not work outside /mnt points, which is what bothers me the most. It used to work and I became dependent of it...

    I tried to:

    • apt-get update/upgrade no effect
    • uninstall/reinstall Ubuntu and Ubuntu-18.04, no effect
    • disable WSL, reboot, re-enable, no effect
    • verified the registry as #4027 said, no effect
    • as suggested in this issue:
      image

    I have another PC where that works as expected on 1903, explorer.exe . etc...

  16. 49 remaining items

  17. gottfired commented on Oct 28, 2020

    @gottfired

    I know it's not much of a help. But my HD crashed a few weeks ago which forced me to reinstall Windows. Now everything is working fine.

  18. saltazaur commented on Nov 18, 2020

    @saltazaur

    I had tried solutions listed in this topic, but in my case it occured that I didn't have wsl.config in my Ubuntu, now after adding the file with default settings, I can access Ubuntu from Windows and all problems are solved (code . ...)
    Info on wsl.conf: https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-per-distro-launch-settings-with-wslconf

  19. nikoscvas commented on Dec 14, 2020

    @nikoscvas

    Agnieszka Jach (@saltazaur) 's solution worked for me. I had the wsl.conf file but root = /windir/ wasn't there. After I added it, and restarted for good measure, the problem went away.

  20. whaaaley commented on Dec 15, 2020

    @whaaaley

    It worked for me as well. I added this to my Debian install and I haven't had any issues since. Nice catch. Someone should probably make a new thread to report the missing conf files and reference this issue.

  21. CollapsedMetal commented on Jan 21, 2021

    @CollapsedMetal
  22. Ryuhouji commented on Mar 19, 2021

    @Ryuhouji

    fracasula, come at it from the other angle.
    All of your windows files are accessible from within the linux distro under /mnt/, so just store the files there. That way, both windows and linux has access to them.

    I did not know that was possible, thanks 👍

    If you're using wsl2 this will cause a MASSIVE performance penalty. Always edit from inside your distro. If you use your distro with Windows paths, this is going to be very slow. This is NOT a solution, it's not even a good workaround.

  23. Ryuhouji commented on Mar 19, 2021

    @Ryuhouji

    I have the same problem. After feature upgrade to 20h2, linux filesystem is inaccessible to windows. VS Code remote works perfectly fine inside the distro. I need to be able to browse my project files for editing things other than code.
    I've tried:
    Rebooting PC
    Rebooting wsl (shutdown/starting it)
    Trying to set a new title with -t
    explorer.exe . inside a linux path does nothing. The terminal acts as if it is still doing something, nothing happens.
    Trying \\wsl\. . . causes explorer to hang and do nothing.

  24. eusoubrasileiro commented on Apr 28, 2021

    @eusoubrasileiro

    what worked for me

    subst s: \\wsl$\Ubuntu-20.04\home\
    ; run in a admin cmd or powershell
    ; this makes \\wsl$ work again from explorer
    

    Based on above here Jordan Poles (@jpoles1)

  25. speller commented on Jan 18, 2022

    @speller

    I just hit this issue. I can access Docker Desktop WSL folders but can't access my Ubuntu installation folders:

    image

    image

    All file exploring tools I tried from Windows hang infinitely connecting to the folder (Explorer, PowerShell, Total Commander). The distro is accessible from the terminal and works well.

    Shutting down WSL doesn't help.

    System reboot helped.

  26. NyaMisty commented on Feb 5, 2022

    @NyaMisty

    Same as Alexander Pravdin (@speller) , I'm on the fast ring of insider, with WSL kernel version 5.10.81.1

  27. feland207 commented on Mar 25, 2022

    @feland207

    For me the solution was to run: subst S: \\wsl$\Ubuntu-20.04\ from cmd.exe

    I got an icon like this in Network locations:
    image

    Properties:
    image

    Despite the Disconnected Network Drive, when I File Explorer this Drive, I can see the Linux file system from Windows. Happy days:)

    PD: I have WSL2 (Ubuntu-20.04) and Windows 10

    Thanks, Elan Hasson (@ElanHasson) !

  28. beerth commented on Jun 9, 2022

    @beerth

    its very important to do it from cmd.exe and NOT using Powershell for mapping the network drive!!!

  29. Tewuzij commented on Nov 17, 2022

    @Tewuzij

    Francesco Casula (@fracasula) Does simply mapping \wsl$\Ubuntu-18.04 not work for you? You should be able to do that and then access the folder as Z:\root\Code.

    Is there any reason you have to map the specific folder to a drive?

    I think there is, for example to access network files in a specific location without traversing back and forth between directories. See WSL2 network drive authentication issue

  30. Kimi450 commented on Dec 1, 2022

    @Kimi450

    I was struggling with this issue for a while but today I stopped using the "default" install of Ubuntu that comes with WSL and installed a separate version (Ubuntu 20.04) and I havent encountered this issue on 20.04. Maybe thats the workaround? Install something separately from the store and that wont give you issues?

    EDIT: Nevermind... its back...

  31. mbomb007 commented on Jan 22, 2024

    @mbomb007

    This issue should be reopened...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions