Skip to content
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

[WSL 2] Cannot access \\wsl$ after waking computer from sleep #4311

Closed
Coridyn opened this issue Jul 17, 2019 · 11 comments
Closed

[WSL 2] Cannot access \\wsl$ after waking computer from sleep #4311

Coridyn opened this issue Jul 17, 2019 · 11 comments
Assignees

Comments

@Coridyn
Copy link

Coridyn commented Jul 17, 2019

  • Your Windows build number: Microsoft Windows [Version 10.0.18936.1000]
    (This was also happening for me on build 18917)

  • What you're doing and what's happening:

I put computer to sleep overnight.
After waking my computer I cannot access my Linux files via \\wsl$\Ubuntu.
Explorer fails with the message: \\wsl$\Ubuntu is not accessible.

This happens often (but not every time) after waking computer from a long overnight sleep.

I ran dmesg and I got these errors in the log:

[  175.397844] init: (1) ERROR: LogException:30: FS: (null) Invalid argument @..\..\inc\p9protohelpers.h:122 (Name)

[  175.402700] init: (1) ERROR: LogException:30: FS: (null) Invalid argument @..\..\inc\p9protohelpers.h:122 (Name)

[  175.409129] init: (1) ERROR: LogException:30: FS: (null) Invalid argument @..\..\inc\p9protohelpers.h:122 (Name)

[  175.417134] init: (1) ERROR: LogException:30: FS: (null) Invalid argument @..\..\inc\p9protohelpers.h:122 (Name)

[  175.422563] init: (1) ERROR: LogException:30: FS: (null) Invalid argument @..\..\inc\p9protohelpers.h:122 (Name)

[26961.870773] init: (1) ERROR: LogException:30: FS: (null) Invalid argument @..\\p9handler.cpp:853 (EmplaceFid)

[26961.896837] init: (1) ERROR: LogException:30: FS: (null) Invalid argument @..\\p9handler.cpp:853 (EmplaceFid)

[26961.899632] init: (1) ERROR: LogException:30: FS: (null) Invalid argument @..\\p9handler.cpp:853 (EmplaceFid)

Is there any additional information I can provide to help?


(NOTE: This issue is superficially similar to #4027 and #4260 except accessing \\wsl$\... usually works. It just fails after some amount of time, usually after waking the computer from sleep.)


(hopefully temporary) Workaround for people experiencing this issue:

It's possible to temporarily restore file integration without having to restart your whole machine by restarting the WSL distribution (I'm only running one distribution so I don't know if you have to shutdown and restart all distributions to restart the 9P server).

(just make sure to close all applications that are accessing Linux files (e.g. vscode) before restarting the WSL distribution)

# close all apps accessing linux files (e.g. vscode)

# shutdown WSL distribution
$ wsl --shutdown Ubuntu

# confirm WSL distribution has shut down
$ wsl -l -v

# start the WSL distributuion again
$ wsl -d Ubuntu
@joemaller
Copy link

joemaller commented Sep 23, 2019

Maybe the same issue: I have a Windows Explorer window open showing files from my WSL Ubuntu file system. Computer goes to sleep. Wake the computer, I get this error modal from Windows Explorer (one for every window which was viewing WSL files):

\wsl$\Ubuntu is not accessible. You might not have permission...
Attempt to access invalid address.

wsl-sleep-error

I dismiss the dialog, and everything works correctly after a moment.

@benhillis
Copy link
Member

@SvenGroot has a fix for this in review.

@Bengrunt
Copy link

Hey there, experiencing the same issue.
Any idea when the fix will be out?

Thanks!

@abuteler
Copy link

abuteler commented Jan 7, 2020

Same here. Although it wasn't something that started happening from the get go.
I could suspend my laptop and resume working without problem two months ago.
I started having this issue mid December.
VSCode will tell me it's unable to connect to the WSL server, as if it didn't wake up.
Yet I am able to access the ubuntu filesystem via a quickaccess I created in Windows Explorer.

@Stanzilla
Copy link

Yeah same, that is happening for resume from standby and normal restarts when you use the "restore explorer windows" option

@whaaaley
Copy link

whaaaley commented Mar 21, 2020

I have "Restore previous folder windows at login", disabled and this still happens. It's really frustrating. It seems to work fine if I start WSL immediately after I turn on my PC.

@Stanzilla
Copy link

Yeah if you are fast enough to call wsl.exe directly which causes the VM to boot then restoring network drives and explorer folders etc does not fail. @benhillis @therealkenc can we please remove the fixed flag here? Or will this not get fixed for 2004?

@therealkenc
Copy link
Collaborator

^--- File under a new issue if there is a well formed repro for remaining or related issues. The OP stated:

ERROR: LogException:30: FS: (null) Invalid argument @..\..\inc\p9protohelpers.h:122 (Name)

Given the timing of the fixinbound tag (September) it is safe to assume (unless/until someone says otherwise) that whatever fix was applied with respect to the above error, it will ship in 2004.

@Stanzilla
Copy link

There you go #5021

@nidia95
Copy link

nidia95 commented Jan 28, 2023

I had this problem, although my wsl hanges and I hasn't been able to shutdown it with wsl --shutdown. after two days I found out I can fix it by killing the wslservice.exe in an admin powershell: taskkill /f /im wslservice.exe.

as I found here: #8529

@fredhaegele
Copy link

Why is this closed?

In this year of 2023, this is still an everyday problem only fixed by shutting down wsl and restarting it, or rebooting the computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests