You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WSL 2 connection lost after too much time in Modern Standby #3454
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.
In the morning, VS Code says it's lost its connection with WSL and needs to reload the window. However, calling wsl -l -v shows that the WSL 2 VM is indeed still running.
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.
Reacted by Aditya Advani, Mina Gabriel, Arnauld Van Muysewinkel, tristanbrown, Kaiwen He, Josh Ghoulberg 👻, Derick Rodriguez, soredake, Scarboroid, Igor Franzoni Okuyama and 5 more
Seems like the WSL remote extension is using TCP/IP for the connectivity to the WSL 2 container. When the system enters modern standby, Hyper-V will pause running VMs and Hyper-V-VmSwitch will "disconnect" itself from host. On a system with plenty of virtual switches, Hyper-V will sometimes takes a full minute to restore connectivity of all of those virtual switches, further exaggerating this problem.
Replacing TCP/IP sockets with the Hyper-V sockets (AF_VSOCK on the Linux side and AF_HYPERV on the Windows side) instead of the regular TCP/IP should solve this problem.
Lately I have found that this issue does not always occur, or at least it seems to happens less frequently. Perhaps something seemingly unrelated somehow mitigated this to a degree. I'll try to see if I find a pattern, and will try to get a better idea of how often it still occurs.
Issue happened (much) less often if I can get Hyper-V virtual switches to wake up faster, in case of short modern standby sessions. (e.g. the typical duration of lunch break, commuting, etc.). Several ways that I can do to speed this up are:
Reducing the number of Windows Firewall rules.
The Windows Firewall rules on Windows 10 can easily reach thousands of entries, because they're automatically created every time an app tries to bind and listen to a TCP/UDP port.
Disabling the NetSetupSvc after WSL 2 is started.
This service is responsible for setting up the "vEthernet (WSL)", so if this service is disabled at first system boot, WSL 2 will fail to run. However, after WSL 2 has ever been started, keeping this service enable somehow causes a temporary packet loss between WSL 2 and Windows host around 1 to 2 seconds after the system wakes up from modern standby, for around 1 to 2 seconds as well. I can observe this behavior on both my Dell XPS 15 9560 and my Surface Go, both running 19041.508.
Keeping the system for an extended amount in modern standby (e.g. overnight) will almost certainly reproduce this behavior. Most of the time it will also result in VSCode asking for "reload the window" as well (like in #3126).
Therefore, I really hope that you migrate to AF_VSOCK/AF_HYPERV instead. Or perhaps, make this extension open source so I can modify it. 😁
Yeah this problem is horrible please escalate. I find myself having to restart vscode 2x to 3x daily because I do all my work in WSL remote and the reload ruins my terminal sessions with running programs. Terrible for programmer productivity.
Also for whatever stupid clearly related reason workplace settings on remote are not honored. So my windows always lose their color scheme (I use a different color scheme for each project). I'll open a second ticket for this issue but mention it because this chore of manually resetting color schemes in 6 windows wouldn't be relevant except for this super weird reload bug.
Please fix it ASAP thanks.
Reacted by Chris Bird, Kaiwen He and romdej
Reacted by Aditya Advani, WAN Chun Yu (Willis), Chris Bird and Lucas Basquerotto
I'd add that once WSL 2 is started, the hns service can be disabled to prevent the Hyper-V virtual switches from disconnecting when the computer enters modern standby. On my Dell XPS 15 9560, disabling this service doesn't seem to prevent the computer from entering DRIPS either.
The only downside is that if we stop the WSL 2 (e.g. by logging off or running wsl --shutdown), it won't be able to start. In that case, to restart WSL 2 without rebooting the computer, we can take the following steps in order:
Stop the LxssManager service.
Enable and start the hns service.
Start the WSL 2 using the regular means.
Stop and disable the hns service.
Had done this in the last 4 days and no more reconnecting / "please reload window" after resuming from modern standby, even when the modern standby lasted overnight. It now works flawlessly as it should. But I have to stress again, this is just a hack, and there should be no reason for VSCode not to use AF_HYPERV/AF_VSOCK.
Also to Hyper-V team (where I can file this to them by the way?), there should be no reason why would you disconnect the virtual switches when the computer enters modern standby. I didn't find any single issue so far, even with regular Hyper-V VMs. Both the default NAT network and bridged networks works flawlessly as well with the hns service disabled after I've started at least one VM that uses the virtual switches.
This may be a more general connectivity issue as I’ve noticed other
services failing after standby. Only way to fix it I’ve found is wsl
shutdown/restart
This issue is still occurring, my vscode windows (of wsl2 remote) if left on standby for a while starts reconnecting and asks me to reload window everytime, reloading still does not solves the problem the only way i can get it to work again is by restarting my laptop.
Reacted by Fabian Terranova, Matt, GinkTran, Madhan Kumar and William Madié
Alexandru Dima (@alexdima)
This issue, that impacts millions of developers daily, should have been fixed long ago. Can we finally get someone to look at this please?
I've freshly installed Debian Trixie and this is still happening.
After coming back to my machine this morning, VSCode cannot reconnect. The only resolution to this is to close all VSCode windows, shutdown WSL, then fire everything back up again. Note that I start VSCode from inside WSL using 'code .', I am not sure if that is contributing.
In any case here's what I am seeing:
The WSL instance is still alive, and has network connectivity (i.e. can communicate to the internet)
Any attempt to connect to the WSL instance from Windows tanks with:
This issue, that impacts millions of developers daily,
Rik Kernaghan (@rkerno) It only sems to affect a few users. I don't see that issue and we only got a handful of reports on that in the last years. Wsl/Service/E_UNEXPECTED is a WSL issue with the distro crashing: microsoft/WSL#9563
This issue, that impacts millions of developers daily,
@rkerno It only sems to affect a few users. I don't see that issue and we only got a handful of reports on that in the last years. Wsl/Service/E_UNEXPECTED is a WSL issue with the distro crashing: microsoft/WSL#9563
Irrespective of the fact that how many users are being effected by it, it needs to be resolved as its a major issue and at times gets frustrating when we have to re-open everything all over again. It'd be great if someone can actively look into this issue to get it resolved.
Muhammad Subhan Khurshid (@SubhanKhurshid) If you also get the 'Wsl/Service/E_UNEXPECTED' message please add a comment to microsoft/WSL#9563. The WSL team would know how to collect information on how to collect additional logs that help them to find the underlying cause of the problem.
I don't see that issue and we only got a handful of reports on that in the last years.
Is this because many have given up on Microsoft tooling and switched to using Macs? What I don't get is why there aren't more of Microsoft's developers actually pitching in to solve this, or is everyone at MS using a Mac now too? I develop on a docked Surface Pro 7, these crashes happen every single day, often multiple times. I'm just back at my machine after 6 hours, and it's now just the expectation that I have to shut down all my VSCode sessions, shutdown WSL, and the start everything back up again.
The Windows Terminal session that started my Debian instance appears fine, responsive with network connectivity. It can actually launch another VSCode session, though it cannot connect through to the Debian instance.
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
2025-10-25 18:40:34.275 [warning] Skipping extension /c:/Users/rik/.vscode/extensions/ms-vscode.js-debug-companion-1.0.18 in favour of the builtin extension /d:/app/vscode/resources/app/extensions/ms-vscode.js-debug-companion.
2025-10-25 18:40:35.626 [error] [network] #1: https://az764295.vo.msecnd.net/extensions/chat.json - error GET Failed to fetch
2025-10-25 18:40:35.627 [warning] Failed to fetch chat participant registry Failed to fetch
2025-10-25 18:40:36.854 [info] Invoking resolveAuthority(wsl)...
2025-10-25 18:40:36.854 [info] [LocalProcess0][resolveAuthority(wsl,1)][0ms] obtaining proxy...
2025-10-25 18:40:36.855 [info] [LocalProcess0][resolveAuthority(wsl,1)][0ms] invoking...
2025-10-25 18:40:37.320 [info] [LocalProcess0][resolveAuthority(wsl,1)][465ms] returned WebSocket(127.0.0.1:4962)
2025-10-25 18:40:37.321 [info] resolveAuthority(wsl) returned 'WebSocket(127.0.0.1:4962)' after 466 ms
2025-10-25 18:40:37.324 [info] Creating a socket (renderer-Management-a8873ccd-6dd1-4d73-880a-3aa874c84b54)...
2025-10-25 18:40:37.328 [info] Creating a socket (renderer-ExtensionHost-db76bcc4-a730-441f-966f-e2caef916c73)...
2025-10-25 18:40:37.505 [info] Creating a socket (renderer-Management-a8873ccd-6dd1-4d73-880a-3aa874c84b54) returned an error after 181 ms.
2025-10-25 18:40:37.506 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.507 [error] [remote-connection][Management ][a8873…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:37.507 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.508 [error] [remote-connection][attempt 1] An error occurred in initial connection! Will retry... Error:
2025-10-25 18:40:37.509 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.510 [info] Invoking resolveAuthority(wsl)...
2025-10-25 18:40:37.511 [info] [LocalProcess0][resolveAuthority(wsl,2)][0ms] obtaining proxy...
2025-10-25 18:40:37.512 [info] [LocalProcess0][resolveAuthority(wsl,2)][0ms] invoking...
2025-10-25 18:40:37.513 [info] [LocalProcess0][resolveAuthority(wsl,2)][4ms] returned WebSocket(127.0.0.1:4962)
2025-10-25 18:40:37.513 [info] resolveAuthority(wsl) returned 'WebSocket(127.0.0.1:4962)' after 5 ms
2025-10-25 18:40:37.514 [info] Creating a socket (renderer-Management-328a8038-b987-4f28-be47-dc9dfd3a9bde)...
2025-10-25 18:40:37.703 [info] Creating a socket (renderer-ExtensionHost-db76bcc4-a730-441f-966f-e2caef916c73) returned an error after 376 ms.
2025-10-25 18:40:37.704 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.705 [error] [remote-connection][ExtensionHost][db76b…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:37.705 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.706 [error] [remote-connection][attempt 1] An error occurred in initial connection! Will retry... Error:
2025-10-25 18:40:37.706 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.707 [info] Creating a socket (renderer-ExtensionHost-2de262b1-b5a6-48cc-9ced-0075a08d4a04)...
2025-10-25 18:40:37.814 [info] Creating a socket (renderer-Management-328a8038-b987-4f28-be47-dc9dfd3a9bde) returned an error after 300 ms.
2025-10-25 18:40:37.814 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.814 [error] [remote-connection][Management ][328a8…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:37.814 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.815 [error] [remote-connection][attempt 2] An error occurred in initial connection! Will retry... Error:
2025-10-25 18:40:37.815 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.816 [info] Invoking resolveAuthority(wsl)...
2025-10-25 18:40:37.816 [info] [LocalProcess0][resolveAuthority(wsl,3)][0ms] obtaining proxy...
2025-10-25 18:40:37.816 [info] [LocalProcess0][resolveAuthority(wsl,3)][0ms] invoking...
2025-10-25 18:40:37.816 [info] [LocalProcess0][resolveAuthority(wsl,3)][2ms] returned WebSocket(127.0.0.1:4962)
2025-10-25 18:40:37.817 [info] resolveAuthority(wsl) returned 'WebSocket(127.0.0.1:4962)' after 2 ms
2025-10-25 18:40:37.817 [info] Creating a socket (renderer-Management-8f435c32-41b0-4d60-9db6-a441a627b887)...
2025-10-25 18:40:37.988 [info] Creating a socket (renderer-ExtensionHost-2de262b1-b5a6-48cc-9ced-0075a08d4a04) returned an error after 284 ms.
2025-10-25 18:40:37.989 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.990 [error] [remote-connection][ExtensionHost][2de26…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:37.990 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.994 [error] [remote-connection][attempt 2] An error occurred in initial connection! Will retry... Error:
2025-10-25 18:40:37.995 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:37.995 [info] Creating a socket (renderer-ExtensionHost-231c9ee5-d212-4200-bf7c-526676c2c414)...
2025-10-25 18:40:38.161 [info] Creating a socket (renderer-Management-8f435c32-41b0-4d60-9db6-a441a627b887) returned an error after 343 ms.
2025-10-25 18:40:38.162 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.162 [error] [remote-connection][Management ][8f435…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:38.163 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.164 [error] [remote-connection][attempt 3] An error occurred in initial connection! Will retry... Error:
2025-10-25 18:40:38.164 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.165 [info] Invoking resolveAuthority(wsl)...
2025-10-25 18:40:38.166 [info] [LocalProcess0][resolveAuthority(wsl,4)][0ms] obtaining proxy...
2025-10-25 18:40:38.166 [info] [LocalProcess0][resolveAuthority(wsl,4)][0ms] invoking...
2025-10-25 18:40:38.167 [info] [LocalProcess0][resolveAuthority(wsl,4)][4ms] returned WebSocket(127.0.0.1:4962)
2025-10-25 18:40:38.167 [info] resolveAuthority(wsl) returned 'WebSocket(127.0.0.1:4962)' after 4 ms
2025-10-25 18:40:38.168 [info] Creating a socket (renderer-Management-ae959c9c-75b9-4e14-b3c8-168e5b89c227)...
2025-10-25 18:40:38.342 [info] Creating a socket (renderer-ExtensionHost-231c9ee5-d212-4200-bf7c-526676c2c414) returned an error after 352 ms.
2025-10-25 18:40:38.343 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.344 [error] [remote-connection][ExtensionHost][231c9…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:38.345 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.346 [error] [remote-connection][attempt 3] An error occurred in initial connection! Will retry... Error:
2025-10-25 18:40:38.346 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.347 [info] Creating a socket (renderer-ExtensionHost-118543a7-c6c3-4cf0-8df9-b4778d177344)...
2025-10-25 18:40:38.534 [info] Creating a socket (renderer-Management-ae959c9c-75b9-4e14-b3c8-168e5b89c227) returned an error after 367 ms.
2025-10-25 18:40:38.535 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.535 [error] [remote-connection][Management ][ae959…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:38.536 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.536 [error] [remote-connection][attempt 4] An error occurred in initial connection! Will retry... Error:
2025-10-25 18:40:38.537 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.537 [info] Invoking resolveAuthority(wsl)...
2025-10-25 18:40:38.537 [info] [LocalProcess0][resolveAuthority(wsl,5)][0ms] obtaining proxy...
2025-10-25 18:40:38.538 [info] [LocalProcess0][resolveAuthority(wsl,5)][0ms] invoking...
2025-10-25 18:40:38.538 [info] [LocalProcess0][resolveAuthority(wsl,5)][2ms] returned WebSocket(127.0.0.1:4962)
2025-10-25 18:40:38.538 [info] resolveAuthority(wsl) returned 'WebSocket(127.0.0.1:4962)' after 3 ms
2025-10-25 18:40:38.539 [info] Creating a socket (renderer-Management-2a3fd4c2-bc1c-4deb-9a6e-7ac0d06efdbc)...
2025-10-25 18:40:38.700 [info] Creating a socket (renderer-ExtensionHost-118543a7-c6c3-4cf0-8df9-b4778d177344) returned an error after 356 ms.
2025-10-25 18:40:38.700 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.700 [error] [remote-connection][ExtensionHost][11854…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:38.701 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.702 [error] [remote-connection][attempt 4] An error occurred in initial connection! Will retry... Error:
2025-10-25 18:40:38.702 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.702 [info] Creating a socket (renderer-ExtensionHost-35e7db08-98bc-45e8-a9db-c03a8ae06e5d)...
2025-10-25 18:40:38.886 [info] Creating a socket (renderer-Management-2a3fd4c2-bc1c-4deb-9a6e-7ac0d06efdbc) returned an error after 350 ms.
2025-10-25 18:40:38.887 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.887 [error] [remote-connection][Management ][2a3fd…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:38.888 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.888 [error] [remote-connection][attempt 5] An error occurred in initial connection! It will be treated as a permanent error. Error:
2025-10-25 18:40:38.889 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.889 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.889 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.890 [error] Cannot register remote filesystem provider. Error while fetching remote environment. WebSocket close with status code 1006
2025-10-25 18:40:38.890 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.890 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.891 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.899 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:38.899 [warning] Ignoring the error while validating workspace folder vscode-remote://wsl%2Bdebian/home/rkerno/src/m/minterpreter - ENOPRO: No file system provider found for resource 'vscode-remote://wsl%2Bdebian/home/rkerno/src/m/minterpreter'
2025-10-25 18:40:38.899 [error] CodeExpectedError
at Pnt.j (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:64931)
at async Pnt.bb (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:75217)
at async vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:74943
2025-10-25 18:40:38.900 [error] ENOPRO: No file system provider found for resource 'vscode-remote://wsl%2Bdebian/home/rkerno/src/m/minterpreter/.git/config': CodeExpectedError
at Pnt.j (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:64931)
at async Pnt.exists (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:66954)
at async Promise.all (index 0)
2025-10-25 18:40:39.006 [info] Settings Sync: Updating due to initialize
2025-10-25 18:40:39.007 [info] Settings Sync: Updating authentication providers. Authentication Providers from store: [{"id":"github","scopes":["user:email"]},{"id":"microsoft","scopes":["openid","profile","email","offline_access"]}]
2025-10-25 18:40:39.008 [info] Settings Sync: Authentication providers updated ["github","microsoft"]
2025-10-25 18:40:39.058 [error] ENOPRO: No file system provider found for resource 'vscode-remote://wsl%2Bdebian/home/rkerno/src/m/minterpreter/pom.xml': CodeExpectedError
at Pnt.j (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:64931)
at async Pnt.exists (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:66954)
at async Promise.all (index 0)
2025-10-25 18:40:39.101 [error] CodeExpectedError
at Pnt.j (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:64931)
at async Pnt.bb (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:75217)
at async vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:74943
2025-10-25 18:40:39.147 [error] WebSocket close with status code 1006: CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:39.148 [error] ENOPRO: No file system provider found for resource 'vscode-remote://wsl%2Bdebian/home/rkerno/src/m/minterpreter': CodeExpectedError
at Pnt.j (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:64931)
at async Pnt.s (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:65621)
at async Pnt.resolve (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:65502)
at async Vst.j (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3066:27255)
2025-10-25 18:40:39.148 [error] ENOPRO: No file system provider found for resource 'vscode-remote://wsl%2Bdebian/home/rkerno/src/m/minterpreter/.vscode': CodeExpectedError
at Pnt.j (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:64931)
at async Pnt.exists (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:66954)
at async vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:494:21773
at async Promise.all (index 0)
at async LPe.v (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:494:21880)
2025-10-25 18:40:39.148 [error] WebSocket close with status code 1006: CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:39.454 [info] Creating a socket (renderer-ExtensionHost-35e7db08-98bc-45e8-a9db-c03a8ae06e5d) returned an error after 754 ms.
2025-10-25 18:40:39.457 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:39.458 [error] [remote-connection][ExtensionHost][35e7d…][initial][WebSocket(127.0.0.1:4962)] socketFactory.connect() failed or timed out. Error:
2025-10-25 18:40:39.458 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:39.458 [error] [remote-connection][attempt 5] An error occurred in initial connection! It will be treated as a permanent error. Error:
2025-10-25 18:40:39.458 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:39.458 [error] Error received from starting extension host (kind: Remote)
2025-10-25 18:40:39.458 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:39.523 [error] CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:49.013 [error] WebSocket close with status code 1006: CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:40:58.904 [error] WebSocket close with status code 1006: CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:41:00.905 [error] WebSocket close with status code 1006: CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:41:09.428 [error] TreeError [DebugRepl] Tree input not set: Error: TreeError [DebugRepl] Tree input not set
at Yd.C (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:416:30917)
at Yd.updateChildren (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:416:30824)
at vZ.value (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:2054:35241)
at x.B (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:30:747)
at x.C (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:30:817)
at x.fire (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:30:1034)
at Fme.setVisible (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:532:2801)
at vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:648:11845
at Array.map (<anonymous>)
at sh.setVisible (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:648:11836)
2025-10-25 18:41:12.192 [error] WebSocket close with status code 1006: CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:41:14.155 [error] WebSocket close with status code 1006: CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:42:08.726 [error] WebSocket close with status code 1006: CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
2025-10-25 18:42:36.442 [error] WebSocket close with status code 1006: CodeExpectedError: WebSocket close with status code 1006
at WebSocket.<anonymous> (vscode-file://vscode-app/d:/app/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3088:94910)
Attempting to open a new Debian console errors too:
Catastrophic failure
Error code: Wsl/Service/E_UNEXPECTED
[process exited with code 4294967295 (0xffffffff)]
You can now close this terminal with Ctrl+D, or press Enter to restart.
I realise this is Windows 10, and therefore because it's been so long, this O/S is now out of support!
From an administrative PowerShell I ran the following:
PS C:\WINDOWS\system32> taskkill /im wslservice.exe /f
SUCCESS: The process "wslservice.exe" with PID 5736 has been terminated.
This now lets me run WSL commands to access the Debian instance but VSCode is still toast even after reloading windows. So a fresh VSCode launch is still required, but slightly better than wsl --shutdown in that the Debian instance remains running during this sequence.
So this proves to me that the problem lies in wslservice.exe.
And stopped logging when I came back to my machine this morning:
wpr -stop logs.ETL
Interesting to note that WSL did not crash this time....could be an uncanny coincidence, but I wonder if there is a side effect from logging that interacts with standby / hibernation?
Martin Aeschlimann (@aeschli) I remembered to start a trace last night and came back to the usual errors....trace attached.
Trace created using these commands:
wpr -start wsl.wprp -filemode
wpr -stop logs.ETL
The zip is password protected (I am unsure whether there is sensitive info included): reach out to me for the password when you're ready to analyse: rik.kernaghan at project catalysts dot com.
Thanks Rik Kernaghan (@rkerno), that's great! Can you please (if you haven't already) file a new issue against https://github.com/microsoft/WSL/issues?
Unfortunately I can not move the issue.
I already pinged the WSL team after your last message. I don't know what their status on this issue. I hope your new log will help them.
Activity
Chuxel commentedon Aug 1, 2020
Martin Aeschlimann (@aeschli) Is this just another variation of challenges with reconnecting after sleep?
jamestut commentedon Sep 9, 2020
Seems like the WSL remote extension is using TCP/IP for the connectivity to the WSL 2 container. When the system enters modern standby, Hyper-V will pause running VMs and
Hyper-V-VmSwitchwill "disconnect" itself from host. On a system with plenty of virtual switches, Hyper-V will sometimes takes a full minute to restore connectivity of all of those virtual switches, further exaggerating this problem.Replacing TCP/IP sockets with the Hyper-V sockets (
AF_VSOCKon the Linux side andAF_HYPERVon the Windows side) instead of the regular TCP/IP should solve this problem.aeschli commentedon Sep 9, 2020
Let see if increasing the timeout helps
aeschli commentedon Sep 28, 2020
I wasn't able to reproduce the issue.
adrianghc commentedon Sep 28, 2020
Lately I have found that this issue does not always occur, or at least it seems to happens less frequently. Perhaps something seemingly unrelated somehow mitigated this to a degree. I'll try to see if I find a pattern, and will try to get a better idea of how often it still occurs.
jamestut commentedon Oct 4, 2020
Issue happened (much) less often if I can get Hyper-V virtual switches to wake up faster, in case of short modern standby sessions. (e.g. the typical duration of lunch break, commuting, etc.). Several ways that I can do to speed this up are:
The Windows Firewall rules on Windows 10 can easily reach thousands of entries, because they're automatically created every time an app tries to bind and listen to a TCP/UDP port.
NetSetupSvcafter WSL 2 is started.This service is responsible for setting up the "vEthernet (WSL)", so if this service is disabled at first system boot, WSL 2 will fail to run. However, after WSL 2 has ever been started, keeping this service enable somehow causes a temporary packet loss between WSL 2 and Windows host around 1 to 2 seconds after the system wakes up from modern standby, for around 1 to 2 seconds as well. I can observe this behavior on both my Dell XPS 15 9560 and my Surface Go, both running 19041.508.
Keeping the system for an extended amount in modern standby (e.g. overnight) will almost certainly reproduce this behavior. Most of the time it will also result in VSCode asking for "reload the window" as well (like in #3126).
Therefore, I really hope that you migrate to
AF_VSOCK/AF_HYPERVinstead. Or perhaps, make this extension open source so I can modify it. 😁ninjaa commentedon Oct 8, 2020
Yeah this problem is horrible please escalate. I find myself having to restart vscode 2x to 3x daily because I do all my work in WSL remote and the reload ruins my terminal sessions with running programs. Terrible for programmer productivity.
Also for whatever stupid clearly related reason workplace settings on remote are not honored. So my windows always lose their color scheme (I use a different color scheme for each project). I'll open a second ticket for this issue but mention it because this chore of manually resetting color schemes in 6 windows wouldn't be relevant except for this super weird reload bug.
Please fix it ASAP thanks.
jamestut commentedon Oct 10, 2020
I'd add that once WSL 2 is started, the
hnsservice can be disabled to prevent the Hyper-V virtual switches from disconnecting when the computer enters modern standby. On my Dell XPS 15 9560, disabling this service doesn't seem to prevent the computer from entering DRIPS either.The only downside is that if we stop the WSL 2 (e.g. by logging off or running
wsl --shutdown), it won't be able to start. In that case, to restart WSL 2 without rebooting the computer, we can take the following steps in order:LxssManagerservice.hnsservice.hnsservice.Had done this in the last 4 days and no more reconnecting / "please reload window" after resuming from modern standby, even when the modern standby lasted overnight. It now works flawlessly as it should. But I have to stress again, this is just a hack, and there should be no reason for VSCode not to use
AF_HYPERV/AF_VSOCK.Also to Hyper-V team (where I can file this to them by the way?), there should be no reason why would you disconnect the virtual switches when the computer enters modern standby. I didn't find any single issue so far, even with regular Hyper-V VMs. Both the default NAT network and bridged networks works flawlessly as well with the
hnsservice disabled after I've started at least one VM that uses the virtual switches.40 remaining items
atlamors commentedon Mar 9, 2024
I'm still experiencing this.
WSL 2
VSCode
Version: 1.87.1 (user setup)
Commit: 1e790d77f81672c49be070e04474901747115651
Date: 2024-03-06T00:21:36.258Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Windows_NT x64 10.0.22631
mrjrieke commentedon Mar 9, 2024
SubhanKhurshid commentedon Dec 1, 2024
This issue is still occurring, my vscode windows (of wsl2 remote) if left on standby for a while starts reconnecting and asks me to reload window everytime, reloading still does not solves the problem the only way i can get it to work again is by restarting my laptop.
robotex82 commentedon Sep 1, 2025
I am having the same problem on a lenovo yoga 2-in-1 aura
wsl --version
WSL-Version: 2.5.9.0
Kernelversion: 6.6.87.2-1
WSLg-Version: 1.0.66
MSRDC-Version: 1.2.6074
Direct3D-Version: 1.611.1-81528511
DXCore-Version: 10.0.26100.1-240331-1435.ge-release
Windows-Version: 10.0.26100.4946
uname -a
Linux 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC x86_64 x86_64 x86_64 GNU/Linux
Version: 1.103.2 (user setup)
Commit: 6f17636121051a53c88d3e605c491d22af2ba755
Date: 2025-08-20T16:45:34.255Z
Electron: 37.2.3
ElectronBuildId: 12035395
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Windows_NT x64 10.0.26100
rkerno commentedon Oct 22, 2025
Alexandru Dima (@alexdima)
This issue, that impacts millions of developers daily, should have been fixed long ago. Can we finally get someone to look at this please?
I've freshly installed Debian Trixie and this is still happening.
After coming back to my machine this morning, VSCode cannot reconnect. The only resolution to this is to close all VSCode windows, shutdown WSL, then fire everything back up again. Note that I start VSCode from inside WSL using 'code .', I am not sure if that is contributing.
In any case here's what I am seeing:
This is so easily reproduceable, but if you're having difficulty, let me know what you need and I can send fresh diagnostics.
aeschli commentedon Oct 23, 2025
Rik Kernaghan (@rkerno) It only sems to affect a few users. I don't see that issue and we only got a handful of reports on that in the last years.
Wsl/Service/E_UNEXPECTEDis a WSL issue with the distro crashing: microsoft/WSL#9563SubhanKhurshid commentedon Oct 23, 2025
Irrespective of the fact that how many users are being effected by it, it needs to be resolved as its a major issue and at times gets frustrating when we have to re-open everything all over again. It'd be great if someone can actively look into this issue to get it resolved.
aeschli commentedon Oct 23, 2025
Muhammad Subhan Khurshid (@SubhanKhurshid) If you also get the 'Wsl/Service/E_UNEXPECTED' message please add a comment to microsoft/WSL#9563. The WSL team would know how to collect information on how to collect additional logs that help them to find the underlying cause of the problem.
rkerno commentedon Oct 25, 2025
Is this because many have given up on Microsoft tooling and switched to using Macs? What I don't get is why there aren't more of Microsoft's developers actually pitching in to solve this, or is everyone at MS using a Mac now too? I develop on a docked Surface Pro 7, these crashes happen every single day, often multiple times. I'm just back at my machine after 6 hours, and it's now just the expectation that I have to shut down all my VSCode sessions, shutdown WSL, and the start everything back up again.
The Windows Terminal session that started my Debian instance appears fine, responsive with network connectivity. It can actually launch another VSCode session, though it cannot connect through to the Debian instance.
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)Attempting to open a new Debian console errors too:
I realise this is Windows 10, and therefore because it's been so long, this O/S is now out of support!
rkerno commentedon Oct 25, 2025
From an administrative PowerShell I ran the following:
This now lets me run WSL commands to access the Debian instance but VSCode is still toast even after reloading windows. So a fresh VSCode launch is still required, but slightly better than
wsl --shutdownin that the Debian instance remains running during this sequence.So this proves to me that the problem lies in wslservice.exe.
rkerno commentedon Oct 27, 2025
I used this command to run a trace last night:
And stopped logging when I came back to my machine this morning:
Interesting to note that WSL did not crash this time....could be an uncanny coincidence, but I wonder if there is a side effect from logging that interacts with standby / hibernation?
rkerno commentedon Nov 17, 2025
Martin Aeschlimann (@aeschli) I remembered to start a trace last night and came back to the usual errors....trace attached.
Trace created using these commands:
The zip is password protected (I am unsure whether there is sensitive info included): reach out to me for the password when you're ready to analyse: rik.kernaghan at project catalysts dot com.
logs.zip
aeschli commentedon Nov 19, 2025
Thanks Rik Kernaghan (@rkerno), that's great! Can you please (if you haven't already) file a new issue against https://github.com/microsoft/WSL/issues?
Unfortunately I can not move the issue.
I already pinged the WSL team after your last message. I don't know what their status on this issue. I hope your new log will help them.
fsw0422 commentedon Dec 27, 2025
Wandering if this is due to clock skew...
I see that WSL2 is syncing with NTP server separately from Windows host (and presumably, both write to the same hardware clock device?)
Or is there an internal connection idle timeout in the WSL extension?
alexdima commentedon Feb 28, 2026
It is possible this is caused by using wall-clock time in some places like e.g. https://github.com/microsoft/vscode/blob/405897eb1103a7141acc9113defc0aaa1287a12a/src/vs/base/parts/ipc/common/ipc.net.ts#L1134-L1137