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 VM suspends after too much time in Modern Standby #5673

Closed
adrianghc opened this issue Jul 29, 2020 · 8 comments
Closed

WSL 2 VM suspends after too much time in Modern Standby #5673

adrianghc opened this issue Jul 29, 2020 · 8 comments

Comments

@adrianghc
Copy link

Environment

Windows build number: 19042.421
Your Distribution version: Ubuntu 18.04
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Steps to reproduce

  • Start WSL 2 on a device with Modern Standby, e.g. a Surface.
  • Put the device into Modern Standby for several hours, e.g. overnight.
  • Wake up the device after several hours, e.g. in the morning.

Expected behavior

The WSL 2 VM should be running when waking up.

Actual behavior

The WSL 2 VM has shut down. No doubt this is because it is supposed to shut down after a certain time of inactivity. While this may be sensible behavior in general, I'd argue that in this specific case it isn't. After all, all developers need to sleep, and waking up and needing to reload the VS Code session isn't always all that convenient. 😅 I've written about Modern Standby specifically because I don't know if this behavior occurs with normal standby as well, but I imagine it's probably specific to Modern Standby because Windows is still active there, but not during normal standby afaik.

@onomatopellan
Copy link

Try loading a simple server like python3 -m http.server before entering Modern Standby. Does it shutdown the WSL2 VM yet?

@adrianghc
Copy link
Author

I could try it tonight, but I don't think it will make a difference, since the server for the Remote WSL extension has always been running anyway.

@onomatopellan
Copy link

I see. If you have Windows 10 Pro try running a hyper-v VM. If it also shutdowns that then it's same problem and it's something the hyper-v team needs to look at.

@ad-on-is
Copy link

Just to add my 2cts here.

Since my Dell XPS has problems with Modern Standby, I got used to hybernating overnight instead. After waking from hybernation the next day, WSL2 and all servers running inside Docker are back and working normally.

@therealkenc
Copy link
Collaborator

Try loading a simple server

From the description sounds like there was a "complicated" server running, namely the VS Code Remote NodeJS service on the WSL side. Possibly. There isn't actually a repro here.

@adrianghc
Copy link
Author

Try loading a simple server

From the description sounds like there was a "complicated" server running, namely the VS Code Remote NodeJS service on the WSL side. Possibly. There isn't actually a repro here.

Well, tonight I just left a window open with the simple Python server, and when I checked again this morning the WSL VM was still running.

I will make another test this night that is specific to the Remote NodeJS service.

@adrianghc
Copy link
Author

Alright, so it seems that while VS Code loses the connection overnight, the WSL 2 VM is indeed still running. Which I suppose would actually make this a VS Code problem, or one with Remote WSL. I'll open an issue there and close this one for now.

@therealkenc
Copy link
Collaborator

therealkenc commented Jul 31, 2020

WSL 2 VM is indeed still running.

Thanks for the follow up. That's what I sort of suspected from the beginning, but let it play out because the initial report was VM proper going down. Lost connection is variation #4992. I'm not fully convinced that one is entirely actionable. It might be, at least partially. But I suspect (as you surmise) it would take state reestablishment from VS Code. Which is no different than say the web pages you might have up on the screen in Windows when your machine goes into standby (modern or otherwise).

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

4 participants