-
Notifications
You must be signed in to change notification settings - Fork 855
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
WSL2 to can't browse in /mnt/c
#4122
Comments
/mnt/c
/mnt/c
Are there any interesting errors in dmesg? Can you provide the output of the mount command? |
I had the same issue and in my case it was because I added:
in (then you'll have to restart WSL with |
@hadim - The metadata option should still work with WSL2, I will take a look though. |
Is it still relevant? If it is then mounting C drive only works for me when removing this option. |
@hadim - Do you have any output in dmesg? I am unable to repro this locally:
|
My bad, I just re-enable the metadata option, restarted WSL and I can mount the C drive...
No idea what was happening before but the C drive wasn't mounted... |
If you are able to narrow down what the issue was, please reopen. Thanks! |
I think my error is different. C is indeed mounted, its just not browsable. |
@benhillis I don't have an option to re-open this but like I wrote I don't think mine and @hadim 's errors are the same. |
I encountered the same issue. My problem was with my service initializing scripts. I delayed the initializing scripts in task scheduler by 30 seconds and the problem was resolved. |
I just had this problem happen for the second time since converting an instance from WSL 1 to WSL 2 a little over a week ago. In both cases, the problem happened after attempting to access the Running @edwindijas What service initializing scripts are you using? I do indeed have a Windows batch script that is run on logon by the Task scheduler, this batch script calls |
I have been further able to narrow this problem down. Every day this week, when I first start my computer up, this problem has happened, but restarting would fix the problem. Today I did some more testing. This seems to happen every time Windows is booted after having been previously Shut Down (i.e. the computer was turned off). However, if Windows was merely Restarted (computer stays on), then this problem will not happen. I'm not sure why this would matter, but I have been able to reproduce this on my pc reliably today. Additionally, I tried disabling the scheduled batch script I mentioned in my previous comment, and it had no effect; |
@JoshuaCWebDeveloper That sounds a lot like Fast Startup. I always disable it because it's incompatible with dual booting. |
@onomatopellan Disabling the Fast Startup solves the issue for me |
I have similar options in .conf to run docker per these instructions, something in those settings cause the same behavior reported here, which appears to be expected behavior |
I encountered this issue as well, and for me, it was because I followed this guide to scheduling a cron job. I guess the start up task on the windows side to launch the cron process at windows start up time somehow short-circuits the mounting operation. |
what helped me was to shutdown wsl then run it again powershell -> wsl --shutdown then i got it back |
I have the same issue when i enter
into /etc/wsl.conf. Restarting the wsl hasn't helped me.
I only need the correct file permissions - is there any other way to do this than metadata? (I don't get the right permissions when i leave the /etc/wsl.conf file empty) |
I had the same issue, i could not access any of the drives though they were shown ls /mnt, |
solved by only having
in my /etc/wsl.conf. Then running
in my wsl instance. Solved everything right away! |
In my case this was due to not having the correct permissions set on my linux user. Solved by running |
My issue was a misunderstanding of the automount behavior.
What threw me is that I had added the automount settings in wsl with the root = / option. For some time both /mnt/c and /c were empty. But after a |
Since wsl.exe --shutdown seems to be the only true way to get around this issue when it does occur, I have the following command to run the shutdown command then open the windows terminal powershell.exe -windowstyle hidden -noLogo -NoProfile -command "wsl.exe --shutdown; explorer.exe shell:appsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App" You can get the explorer.exe command for any app, such as ubuntu, by using a tutorial like https://www.tenforums.com/software-apps/57000-method-open-any-windows-10-apps-command-line.html So if you wanted to open ubuntu, just replace the explorer.exe command with the correct command to open Ubuntu. Then you can create a new shortcut and paste the full powershell command in and then set the shortcuts icon to whatever app icon you need. For instance, I set the windows terminal icon for the shortcut and pinned it to the taskbar, you can see when I run it a seperate icon shows on the taskbar for the running windows terminal window vs the shortcut which does not show a running status. |
I met this problem too, on windows 10 home 2004, version 19041.572 |
As a new WSL user, I'm not too versed on the documentation, so I don't know if this is expected or not. I concur that every time I shutdown/restart the Windows PC, /mnt/c (in the WSL terminal) is no longer connected. Issuing a
|
If you compiled a custom kernel be sure that VIRTIO is set:
|
This fixed it for me. Thank you! |
Had the same issue, restarting wsl solves it but the final solution for me was to increase the delay of my windows task that automatically starts wsl at windows startup. |
I believe this also occurs when you have run |
This issue is quite old, could somebody who is experiencing this please provide /logs?
|
Hello! Could you please provide more logs to help us better diagnose your issue? To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging Thank you! |
I presume you specifically mean using collect-wsl-logs.ps1, right? |
Correct, instructions above. |
This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it. Thank you! |
1 similar comment
This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it. Thank you! |
Please fill out the below information:
Your Windows build number:
10.0.18917.1000
What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)
in wsl:
ls /mnt/c
What's wrong / what should be happening instead:
the folder is empty. Should have listed my
Users
folder etcThe text was updated successfully, but these errors were encountered: