vscode-remote-release
vscode-remote-release copied to clipboard
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
Issue Type: Bug
Disclaimer: My english isn't that good so I'll be using Bahasa Indonesia Tidak bisa buka semua file pakai Vscode WSL ini jadi tulisannya " Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006) " pls fix it I have school project and it's urgent
VS Code version: Code 1.58.2 (c3f126316369cd610563c75b1b1725e0679adfb3, 2021-07-14T22:10:15.214Z) OS version: Windows_NT x64 10.0.19043 Restricted Mode: No Fetching remote diagnostics for 'WSL: Ubuntu-20.04' failed: WebSocket close with status code 1006
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz (8 x 1800) |
| GPU Status | 2d_canvas: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: enabled_on video_decode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 7.88GB (2.70GB free) |
| Process Argv | --folder-uri=vscode-remote://wsl+Ubuntu-20.04/home/hardi/Pi_pos --remote=wsl+Ubuntu-20.04 --crash-reporter-id badf4cba-f09c-48f9-bd77-8072abaf5834 |
| Screen Reader | no |
| VM | 0% |
Fetching remote diagnostics for 'WSL: Ubuntu-20.04' failed: WebSocket close with status code 1006
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
pythonvspyt700cf:30270857
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551:30311712
vspre833:30321513
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscus158:30321503
pythonvsuse255:30335481
vscod805cf:30301675
pythonvspyt200:30331937
vscextlang:30333561
binariesv615:30325510
bridge0708:30335490
/needsMoreInfo
Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.
Happy Coding!
Facing the same issue on the same version but on mac os 11.5 on an intel Macbook while trying to connect remotely to Arch Linux(Linux 5.4.86-1-lts) using the remote-ssh extension.
i am also facing problem on macos 11.5 big sur intel,
Open Workspace In Container..
or Try a Development Container Sample,
it builds docker images which is perfect but can't open file in workspace container error code returns 1006 :
Could not fetch remote environment
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
Hi all, thanks for reporting. You all 3 appear to be using different extensions, so it'd be most helpful to report the problems in 3 separate issues. Also please include relevant information, like logs and minimum repro steps, in those issues: https://code.visualstudio.com/docs/remote/troubleshooting#_reporting-issues. Thanks!
I'm not sure if this will solve your problem, but I ran across this same issue and ended up fixing it. Wanted to share my solution in case it helps anyone else out.
In the sshd config on the REMOTE host (/etc/ssh/sshd_config) make sure you have these lines AllowAgentForwarding yes AllowTcpForwarding yes
Then reload/restart sshd and try again.
This started happening suddenly today, in my WSL2 setup that was working fine for over two months.
I changed the setting remote.WSL.server.connectThroughLocalhost (Settings -> Extensions -> Remote - WSL -> Connect Through Localhost) from disabled to enabled, and that fixed the issue for me.
Maybe the IP of the virtual machine changed in some unexpected way? How does Remote-WSL actually lookup the IP for the VM when that setting is disabled? Also, it says that it will fallback to localhost when that setting is disabled, but it looks like this is not happening correctly for some reason.
Disable Kill switch feature in case you are connected to VPN (e.g. Malwarebytes Privacy).
I had this issue as well. Also on a WSL2 setup with Ubuntu 20.04.1 LTS / Windows 10. What I tried that didn't work:
- Restarting WSL
wsl --shutdown - Restarting the machine
- Removing the contents of
/root/.vscode-server
What did work:
- Changing the setting for
remote.WSL.server.connectThroughLocalhostto localhost. (Thanks @thnee!)
Screenshot of the error (with verbose logging)

I literally just got the same issue out of nowhere - restarted after a GPU update and in the middle of my work afterwards suddenly boom - connection errors. I checked and the terminal indicated that WSL crashed completely so I restarted it. The terminal now worked without issues but VS Code kept throwing the same error (event after a restart).
I checked the setting @thnee pointed out (or a setting similar to it) and seems like I already had it set to localhost which was not the default. I've changed it back to the default (maybe a new value) of wslExeProxy and then it started working again.

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!