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

Cannnot reconnect to WSL after Windows resumes #3158

Closed
chrisdias opened this issue Jun 9, 2020 · 10 comments
Closed

Cannnot reconnect to WSL after Windows resumes #3158

chrisdias opened this issue Jun 9, 2020 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug reconnecting Attempting to reconnect and it isn't clear why wsl Issue in vscode-remote WSL
Milestone

Comments

@chrisdias
Copy link
Member

Version: 1.46.0-insider (user setup)
Commit: 9f89da69154ac6c99dfa7c82986e2df95b7bbe0b
Date: 2020-06-08T22:10:54.220Z
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041

I think this is new behavior? If I have an instance of VS Code open on a Ubuntu instance and the computer goes to sleep, when i log back in again I get a reconnect prompt:

image

To repro

  • ubuntu image on wsl
  • open a folder on linux
  • let the computer go to sleep
  • wake, log back into comuter
  • result: Reconnect Dialog
@github-actions github-actions bot added the wsl Issue in vscode-remote WSL label Jun 9, 2020
@andres-pcg
Copy link

This happens a lot to me.

@aeschli
Copy link
Contributor

aeschli commented Sep 15, 2020

@chrisdias Can you run powercfg /a and let me know what sleep states are available on your machine?

@chrisdias
Copy link
Member Author

This no longer happens for me all the time, only occasionally, but I can't identify exactly when.

d:\src>powercfg /a
The following sleep states are available on this system:
    Standby (S0 Low Power Idle) Network Connected
    Hibernate
    Fast Startup

The following sleep states are not available on this system:
    Standby (S1)
        The system firmware does not support this standby state.
        This standby state is disabled when S0 low power idle is supported.

    Standby (S2)
        The system firmware does not support this standby state.
        This standby state is disabled when S0 low power idle is supported.

    Standby (S3)
        The system firmware does not support this standby state.
        This standby state is disabled when S0 low power idle is supported.

    Hybrid Sleep
        Standby (S3) is not available.
        The hypervisor does not support this standby state.

@aeschli aeschli added the reconnecting Attempting to reconnect and it isn't clear why label Nov 10, 2020
@tristanbrown
Copy link

tristanbrown commented Jan 21, 2021

This has been happening to me too, starting sometime in 2020. When Windows resumes, I get the "Cannot reconnect. Please reload window" message. I used to be able to just click the "reload window" button, and everything would be fine after that. But starting about a month ago, after the window reloads, a message pops up giving a 5 second countdown before it tries to reconnect again. If I let it try to reconnect in that way, it always fails and gives the "Cannot reconnect. Please reload window" message again. The only way to break the cycle is to manually click the "reload window" button before the 5 second countdown expires. At that point it connects properly.

This has become incredibly annoying.

@ablankenship10
Copy link

I have this issue a lot after a windows reinstall that wasn't happening my first time using it. Before I had tweaked WSL with a few modifications to how the network was connected to host and a different systemd script I think which may have helped, but those were hacks at the time and now there I think was more official WSL support for those things that I didn't use random git users scripts to make those work.

Anyway, I don't only get this popup when it wont reconnect. Sometimes it just shows me a notification in the bottom right that it couldn't open my file in the remote. Using the bottom left button on the toolbar that says (WSL: Ubuntu) fails to reconnect as well. It seems as though this attempt to reconnect is failing to do the same flow as the initial connect for some reason.

@rekire
Copy link

rekire commented Apr 13, 2021

I have the same problem, however I think this started when I changed my IP range of my home network. This might trigger this issue.

@aurisnoctis
Copy link

aurisnoctis commented Aug 23, 2023

This is indeed very annoying. Pressing the "Reload Window" button usually works, but

  • the terminal gets reloaded too and is then empty (past commands are in .bash_history, but I like to see what I did just before in that terminal)
  • while the modal/banner is up, I can't interact with the window - neither minimize it nor drag it to another desktop so it's blocking my other work. I can only bring up another window in front of it, but I can't see/use my desktop for instance. When I hit Reload Window, the past terminal commands are gone ... 😞

I am on my employer's laptop with Microsoft Windows 10 Enterprise LTSC.

Edit: I am not using WSL, but connect to a Linux desktop via ssh.
Edit 2: It would help if the ssh connection could be reestablished by reconnecting the window again without reloading it. At the moment this doesn't work using the ssh interactions in the bottom left corner and trying to connect in the same window. Only reload helps with the contents of the terminal gone.

@aeschli
Copy link
Contributor

aeschli commented Aug 23, 2023

Thanks @aurisnoctis. SSH and WSL are quite different regarding the way reconnection works.
This issue is about WSL. A while back we came up with a new connection method that fixed the reconnection issues that we suffered for a long time.

Therefore I'm closing this issue as fixed.

@aeschli aeschli closed this as completed Aug 23, 2023
@aurisnoctis
Copy link

OK, is the "Reconnect. Please reload the window"-Issue also fixed for users connecting to a Linux machine via ssh? All issues about that seem to be closed but it's not solved (for me at least). Thank you for pointing me somewhere re my description above - either documentation or related issues are welcome. 🙏

@aeschli
Copy link
Contributor

aeschli commented Aug 24, 2023

@aurisnoctis If there's no open issue about reconnect in SSH, please file a new issue that describes your setup and your steps.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug reconnecting Attempting to reconnect and it isn't clear why wsl Issue in vscode-remote WSL
Projects
None yet
Development

No branches or pull requests

7 participants