-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot access \\wsl$\Ubuntu in Explorer, cannot launch Windows commands from WSL #5718
Comments
Please submit networking logs via feedback hub. |
Sent - let me know if you need anything else. |
This might be similar or the same issue as I and a couple other people are having in #5307. I will submit networking logs when I am next at my desktop. |
Tried running Windows Insiders 10 Dev channel + updated WSL2 to latest, then uninstalling / reinstalling WSL, no luck. |
Tried installing on my work computer - works perfectly without issues - what are my options? I guess I have the nuclear reinstall Windows from scratch but I'd love to avoid that. |
Found a workaround! Weirdly, I can map \wsl$\Ubuntu as a network drive and access / copy files both ways! Also weirdly, I cannot map anything else than the base level folder - trying to map \wsl$\Ubuntu\home or anything else than \wsl$\Ubuntu fails. Works for me for now, but still would like to see this issue properly resolved, as the second part of the problem is still present - cannot launch .exe from WSL if they are Windows side (a problem with VS Code for example). Where would the problem be? Is there some register of the address where \wsl$\Ubuntu points to that is corrupted leading to the 'access invalid address' and 'invalid argument' errors? Trying to do 'dir \wsl$\Ubuntu' from Powershell leads to "cd : Cannot find path '\wsl$\Ubuntu' because it does not exist." - yet I can access my mapped network drive (Z:) just fine. Happy to help troubleshoot this, many people are experiencing the same. |
I am having the same issue accessing \wsl$\Ubuntu-20.04 from Explorer. However, this solution didn't work for me. When I attempted to create the network drive, I got "Windows cannot access \wsl$\Ubuntu-20.04", with error code 0x80070043 The network name cannot be found. When I run the Diagnose tool, I am told 'You do not have permission to access "\wsl$\Ubuntu-20.04"' I can get to \wsl$\Ubuntu-20.04 via an unprivileged PowerShell, but not via Explorer. I have looked at the permissions in the UserApp folder under Canonical, and my account has full privileges on all files there. Any ideas? |
I hit the same issue and discovered what caused it: Environment
Steps to reproduce
Expected behaviorWSL SSH should have been started and the WSL VHD should still be accessible. Actual behaviorWSL SSH has started but access to the WSL VHD is denied. I suspect this is because WSL is first booted from an admin account / system account during startup, so the permissions end up incorrect. After removing the Task from Task Scheduler and rebooting, the WSL VHD became accessible again. Additional notes
|
HI Ed, Environment Steps to Reproduce Step 1: Open an Ubuntu shell (to start WSL2). Step 2: Using the following approaches, attempt to access the Linux file system:
Expected behavior: Actual behavior: |
Hi, In my original post, I started with a working system - so the repro listed was showing how to go from a working system to a broken one (and back again). If your setup is already failing to access the WSL VHD (Virtual Hard Drive) then my repro steps above won't be much use. (I posted my info on this issue rather than creating a new, duplicate issue for what is probably the same underlying problem - but that's just a guess. Who knows! I'm sure someone with deeper knowledge of how Windows works could inform me.) In all approaches it should be double-backslash, not single backslash, at the beginning of the path:
Hope this helps, |
Hi Ed, Thanks for the clarification and the corrections. I've edited my post to correct them. The Markdown styling caused my In Approach #2, (from PowerShell), Yes, I can run commands against the files I find there. For example, I can run git init and then add and commit files. Thanks, |
Hello I experience this on any clean install Windows 10 20H2 and WSL2 using Fedora Remix. Is there really no way to fix it other than mount it? Thanks. Network Logs attached https://aka.ms/AAb2gdv
strace log explorer.exe The screenshoot of other network location works other than wsl But Mounting as Drive working, tried in-place upgrade, turn on off wsl, in fresh install PC with 20H2 image lead same problem dmesg output
sudo mount output
|
@therealkenc based on the data, does this is occasionally happen or never happen on new machine installation? I'm tried to reinstall and use new profile/user, still face this problem across computer. |
Impossible to say whether the issue "never" happens on a new machine installation; but if it does, based on the two likes on the OP, the error (" |
So it's still not reproducable and hard to track down right? |
Correct. There are two likes on the OP. Imagine the status of this issue if no one could run
There are two possibilities. There is something unique about those 20 machines. There is something unique about the ISO. You can get unadulterated Windows ISOs here to test the hypothesis. |
I solved this issue by navigating to \\wsl$ in explorer, right clicking my Ubuntu folder, and clicking Map Network Drive. Hit finish. Explorer should open a new window with wsl mapped to your new network drive. In my case it was Z: drive. You still cannot access the files from \wsl$[your_distro] but you will have a drive under "This PC" in explorer that gives you access. |
the same issue happened today.
System information as of Sat May 8 14:19:31 CST 2021 System load: 0.06 Processes: 8 1 update can be installed immediately. The list of available updates is more than a week old. terminal can login. |
Any solution for above. I am installing WSL for DDEV Docker i cant see my project files any one guide me from where i can see my files |
you can run wsl --shutdown to fix issue |
I have this issue since the preview build introducing "wsl.local". The workaround is, as previously mentioned |
Hello di did try the new ISO file from the link on new computer, produce same result. Are you sure this isn't from Microsoft ISO Problem? Because this happen on many machine that I tried, with fresh iso downloaded from MS |
Hi everyone, I'm facing the same problem but I can manage to overcome it. I think it is a problem of permission (in my case at least). Indeed, If I change the default user of my distro to root, then it works. To do so, open the windows registry manager and go here:
You can check you are editing the correct distro by looking at the "DistributionName" key. Update the key "DefaultUid" to 0 in Decimal (please keep somewhere the value before putting 0). Then restart your distro using PowerShell:
You will be logged as root. Then try to access to \wsl$\DISTRO_NAME via explorer.exe. It is not a long term solution but I think it could help to find the right one if this solve the problem for you. To restore the original default user, just put the id which was in the key "DefaultUid". You can also define the one you want by executing this command in the distro:
This will return an integer you should place in "DefaultUid" key (in decimal mod). I precise the problem comes from a distro I have imported from another PC. On the original PC, no such problem. |
Resolve this problem:
Why will this method help solve the problem?WSL from the command line comes with the latest version. And the necessary settings will be made automatically. It already has all the necessary and known fixes. But WSL from the Microsoft Store has a lower version and is unstable for many. For example:
Don't use WSL from the Microsoft Store! Install with a command in PowerShell. |
This happened to me recently on Windows 10. Only thing I did was export my WSL distribution... |
@odbol Are you saying that merely exporting WSL caused a '\wsl$\LINUX' access error? If so, it is ironic that in my case, with Win11, merely exporting WSL corrected the problem! I was about to follow the rest of the (helpful) steps that @Q0 posted on Apr 8 when, after the export, it was back to 'normal'. It would be useful to know what changed (or caused it in the first place?!) |
(earlier today) "merely exporting WSL corrected the problem" FYI: I spoke too soon... one Windows restart and the problem is back! |
Hey @dgbruce, you really need to reinstall WSL. To do this, you need to uninstall WSL and install via PowerShell with the It would be great if you post your results. I think I have enough experience to help you with the problem. I'll be glad to help. |
Same Issue
The same issue happened after I did some work on I solved the problem after I did the following steps:
p.s. It also works properly after reboot. |
Tried this, sadly no luck. Does it mean only nucking the whole OS then it will works? Ugh, so sad... |
Is this issue solved? I can still see this problem on my PC today, my os build ver is: 22000.856 (WIN11 21H2) |
Hey, seems I accidentally found out a workaround to solve this issue. By shuting down the WSL and restart it via command line "wsl --shutdown; wsl" in windows Powershell, I can now access the WSL2 folders in win11 file explorer. |
Sometimes, it works, sometimes it is not sadly. I think the key is always do clean install each time Windows do upgrade from one version to another… (their in-place upgrade suck, cause this to kept happening…, I really lost hope on it)
Best Regards,
Benyamin Limanto 《李嘉铭》
sent from Outlook on my Thinkpad X220
From: Jerry ***@***.***
Sent: 22 Agustus 2022 20:58
To: microsoft/WSL
Cc: Benyamin Limanto; Comment
Subject: Re: [microsoft/WSL] Cannot access \\wsl$\Ubuntu in Explorer, cannot launch Windows commands from WSL (#5718)
Hey, seems I accidentally found out a workaround to solve this issue. By shuting down the WSL and restart it via command line "wsl --shutdown; wsl" in windows Powershell, I can now access the WSL2 folders in win11 file explorer.
—
Reply to this email directly, view it on GitHub <#5718 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAVP2NA4YOEVLIBADGW56VLV2OBNFANCNFSM4PUZSKBQ> .
You are receiving this because you commented. <https://github.com/notifications/beacon/AAVP2NG7P46BICLEPV2GYBLV2OBNFA5CNFSM4PUZSKB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJDOFVEY.gif> Message ID: ***@***.***>
|
I was receiving similar issue. restarting wsl or rebooting did not work, so I ran MS Defender Offline scan. It seems to work correctly as of now. Will report back in few days to see if it happens again. |
It did :/ Details:I was using wsl remote in vs code to do my work. Either some sort of crash happened randomly during work or due to wsl being open in file explorer for a while. However first thing I noticed is File Explorer restarted unexpectedly. Then after that I cannot access \\wsl$ from file explorer. It loads infinitely until explorer hangs and restarts. This also happens when I go to Quick Access (as my wsl home directory is pinned there) and when I right click on the said pinned folder in left side view. I can still access wsl and all its files through the wsl terminal and vs code. (I copied over my work to a native folder using terminal to submit it) I tried running Other researchI remember finding somewhere (edit: #6216) that So far this seems to be some hard drive type issue... and also related to file explorer only. Is it just an inevitable crash from an ntfs reader reading ext4 files on ntfs patition? Edit: interestingly enough, the behavior reported in the tagged issue is same as I'm having. The Offline Scan temporarily fixes wsl, but then the crash happens again some time later. |
update: looked through superuser and a bit of #4027, I couldn't find wsl in Optional Features so I disabled and re-enabled wsl from control panel (requires 2 reboots). The file explorer issue seems to be fixed for now (all data and settings are apparently intact), still need to confirm if its temporary or permanent. if its a temporary fix, Offline Scan is still more feasible as it requires less user interaction and 1 reboot. before disabling and enabling wsl, rebooting only allowed me to visit and use wsl directory in explorer for like a minute before crashing again. |
update: The crash happened again. Edit: this sounds like some form of a memory issue, will monitor wsl memory usage to see if I find anything. |
This worked for me, thanks |
In my case running |
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... |
For me, sometimes when I access and copy/paste files between windows/linux it will somehow lock up my system at some point later on. Any time app trys to read drives/filesystem it freezes. For example my machine can be running for months without issues, then I do something with the mapped network drive for wsl2 at some point applications will start freezing on me. When it is in this state of frozen, if I end task explorer, it wont come back.
|
I had this today - solved it by following the registry editing steps from this page: https://superuser.com/questions/1682390/wsl-ubuntu-is-not-accessible-anymore-from-file-explorer And then tried turning off and turning on WSL from PowerShell - turns out I had (or an update had) turned off the Virtual Machine Platform. Turned that back on, rebooted - working now. |
For me when this happens, opening wsl console or vscode remote seems to solve it |
For me, when its locked up opening new wsl terminals fails. |
So i ran into same issue. I have a feeling people here complain about multiple different causes that lead to the same outcome. I since have solved the problem so im just telling my story in hopes it gives a hint to someone/anyone how to find and fix one or more root causes of this. I am new to WSL, so very first thing i did after installing windows was installing WSL from windows store. After that i was doing all kinds of random things, following directions on the internet, enabling windows features related to WSL directly, since apparently i got WSL1 running at first. And a range of seemingly benign actions led to system corruption where even though i could finally create WSL2 containers - only WSL1 containers were accessible through So i did only sensible thing that was left - reinstall windows (thankfully install i did this on was only 24h old anyway). After reinstalling wsl i no longer did all kinds of random things, instead i installed wsl by running tl;dr; The fix:
The conclusion: installing wsl-related things in a random order can mess up wsl beyond repair. |
Hey! I had the same issue but I fixed using the WSL console and executing the command: sudo chown -R my_username /root After this I was able to navigate the folder using the file explorer and use the VS code. |
It worked for me, thanks ❤️ |
Did anybody find a permanent solution for this issue? I am struggling with this issue as well. (Using Windows 11 and the "plain" Ubuntu version from the Microsoft Store.) |
Been using my WSL Ubuntu setup for almost 2 years now and this just started to happen to me out of nowhere.. a permanent fix would be nice. |
For me the problem was I manually set WSL_DISTRO_NAME in ~/.bashrc. Remove that fix the |
Only this works for me |
Environment
Steps to reproduce
Another problem which I think is linked - any command ("explorer.exe ." for example, or "code .") return "/mnt/c/Windows/explorer.exe: Invalid argument"
These work from windows paths (/mnt/c/Windows for example)
Expected behavior
Access the WSL directories through explorer, or be able to launch windows commands from WSL paths
Actual behavior
Errors as described above. Tried to search for similar open issues - a lot have similar symptoms (#4027) for example, but none of the fixes posted work.
Looked at the registry keys mentioned in these issues, all fine.
Tried to reinstall WSL completely (toggling the feature off, reboot, then on, reboot)
Tried to install another distro, same result
Tried to repair Ubuntu
Tried to repair Windows using
"sfc /scannow
dism /Online /Cleanup-Image /CheckHealth && dism /Online /Cleanup-Image /RestoreHealth
sfc /scannow
netcfg -d"
The text was updated successfully, but these errors were encountered: