You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WSL2: can't access linux file system from windows #4260
What's wrong / what should be happening instead:
Instead of opening explorer.exe at the corresponding folder in the linux file system, I get the error:
/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.
Reacted by ENX, marcadella, Philipp G., gottfired, Ardjan Dommisse, Nils Brinkmann, Rafinol, beta, Benyamin Limanto, Nate Zimmer and 4 more
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.
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?
Reacted by Ale Blanco, Daniel Reis, Changsheng Wu, Alex Wauters, Frederico Dal Grande, Marek Gardias, Daniel Macias, jturi, Akhilesh Thorat, Kevin Monteza and 11 more
Reacted by jturi and gluk
Reacted by jturi, Kevin Monteza, Edison Ricardo Altamirano Avila and gluk
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?
Reacted by Michael Christenson II, Sergey Bondarenko, DepuMeng, James Waples, Matrix0xCC, ENX, Dustin Dowell, Tony Jobson, Jason Kim, Julian Acosta and 30 more
Reacted by Michael Christenson II, Tony Jobson, Abdul Aziz Al Basyir and Minh Nguyên
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.
Reacted by Jan Six, Coridyn, dynahcatq, Christopher Peisert, Jonas Erickson, Marcos Fonseca, Isaac Gaskin, Intae, Getachew Mulat Zerihun, Marcel Schmalzl and 22 more
Reacted by Willian Falbo, Yurio Windiatmoko, Andreas Stenlund, david-littlefield, Abhishek S, Jacob and Chen Cui
Reacted by Luke Fisk-Lennon, Abdul Aziz Al Basyir, delta9, ukimalla, Andrew Li, Daniel and Jacob
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.
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.
\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.
Reacted by Husrev, Benyamin Limanto, luisiacc and mbomb007
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?
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.
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.
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.
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.
I just hit this issue. I can access Docker Desktop WSL folders but can't access my Ubuntu installation folders:
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.
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
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?
Activity
martaver commentedon Jul 2, 2019
Note: running
explorer.exe .from a mounted windows drive, e.g./mnt/cworks fine.This is a blocker, preventing me from opening a project located on the linux file system in VSCode.
onomatopellan commentedon Jul 2, 2019
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
dmesgoutput to see if it tells what's happening.martaver commentedon Jul 2, 2019
I am mounting
/mnt/...drive directly under/in mywsl.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.
craigloewen-msft commentedon Jul 2, 2019
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 fromwsl -l), does that work or does that result in an error?martaver commentedon Jul 3, 2019
Ah, so from File Explorer, browsing to
\\wsl$\Ubuntu-18.04\gives me error:Can't quite tell if this is a permissions issue, or 'invalid address'... any ideas?
craigloewen-msft commentedon Jul 3, 2019
This seems to be an error with the Plan 9 server. Sven Groot (@SvenGroot) is the resident expert for this area!
erikhakansson commentedon Jul 4, 2019
I suddenly have this issue too after upgrading to 18932. It worked previously but with issues (#4262)
erikhakansson commentedon Jul 4, 2019
sudo apt update && sudo apt upgradefollowed bywsl --shutdownand then starting wsl again resolved the issue for me.But I don't know if it's permanently or not.
martaver commentedon Jul 4, 2019
Erik Håkansson (@erikhakansson)'s steps didn't change the problem for me.
onomatopellan commentedon Jul 4, 2019
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.
stuffaboutpete commentedon Jul 5, 2019
I'm struggling with the same and the linked issue wasn't my problem - the registry values were already correct.
apt upgradealso made no difference although runningwsl --shutdownis helpful because it saves logging out or rebooting.peidaqi commentedon Jul 25, 2019
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.
enterit commentedon Aug 14, 2019
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?
shm-tar commentedon Sep 12, 2019
Exact same issue on Windows 10 1903, but when running
explorer.exeinside WSL, it opens Windows explorer on This PC page.David-Defoort commentedon Sep 14, 2019
I've updated to 1903 18362.356 as of yesterday and I'm having this issue as well
\\wsl$but when I double click I get:dir \\wsl$\Ubuntudoes not works ("The system cannot find the path specified.")explorer.exe .inside a /mnt point works fine. Explorer.exe comes up to the expected path locationexplorer.exe .outside a /mnt point does nothing, it does not even bring explorer at allcodedoes 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:
I have another PC where that works as expected on 1903,
explorer.exe .etc...49 remaining items
gottfired commentedon Oct 28, 2020
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.
saltazaur commentedon Nov 18, 2020
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
nikoscvas commentedon Dec 14, 2020
Agnieszka Jach (@saltazaur) 's solution worked for me. I had the
wsl.conffile butroot = /windir/wasn't there. After I added it, and restarted for good measure, the problem went away.whaaaley commentedon Dec 15, 2020
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.
CollapsedMetal commentedon Jan 21, 2021
Agnieszka Jach (@saltazaur) solution worked for me as well!
/etc/wsl.confwas not there!Iv'e copied the one mentioned on https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-per-distro-launch-settings-with-wslconf.
Rebooted and done!
Ryuhouji commentedon Mar 19, 2021
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.
Ryuhouji commentedon Mar 19, 2021
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.eusoubrasileiro commentedon Apr 28, 2021
what worked for me
Based on above here Jordan Poles (@jpoles1)
speller commentedon Jan 18, 2022
I just hit this issue. I can access Docker Desktop WSL folders but can't access my Ubuntu installation folders:
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.
NyaMisty commentedon Feb 5, 2022
Same as Alexander Pravdin (@speller) , I'm on the fast ring of insider, with WSL kernel version 5.10.81.1
feland207 commentedon Mar 25, 2022
For me the solution was to run:
subst S: \\wsl$\Ubuntu-20.04\from cmd.exeI got an icon like this in Network locations:

Properties:

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) !
beerth commentedon Jun 9, 2022
its very important to do it from cmd.exe and NOT using Powershell for mapping the network drive!!!
Tewuzij commentedon Nov 17, 2022
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
Kimi450 commentedon Dec 1, 2022
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...
mbomb007 commentedon Jan 22, 2024
This issue should be reopened...