-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Can not connect to WSL2 running Ubuntu-22.04... #221727
Comments
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.91.1. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding! |
VS Code updated to latest version. Got the same results and same error persists: 2024-07-15 13:03:25.659 [error] CodeExpectedError: WebSocket close with status code 1006 |
Can you remove the `networkingMode=mirrored`` from your wslconfig file to see if that causes the problem? |
Greetings @aeschli ! I commented the line and now VS Code can connect to WSL2 and install extensions in Ubuntu. Thanks for the suggestion! However, when I do this, I also loose the capability of connecting to the outside world from Ubuntu. So, in order to install or update any package, I have to shutdown WSL, uncomment the "networkingMode=mirrored" line and save the .wslconfig file, initiate a new WSL session, do the update, and then revert everything again. Do you have any thoughts about how to solve this problem? I've had this problem since last year, and had given up on using WSL until I found the "networkingMode=mirrored" option a couple of weeks ago. I'd appreciate your comments. Cheers, ++José |
We have microsoft/vscode-remote-release#9222 for this and we have contacted the WSL team: microsoft/WSL#11184 Can you please collect networking logs by following the instructions below and attach them, together with a description of your distro setup in microsoft/WSL#11184 ? |
Marking as dup of microsoft/vscode-remote-release#9222. |
I have the same problem. But I seem to have found a workaround. [boot] After deleting the two lines, vscode worked smoothly. I can keep setting "networkingMode=mirrored" in .wslconfig and my vscode can connect to wsl, which has network connection The content of my .wslconfig: [wsl2] But the problem arise after I upgrade wsl from Ubuntu 20.04 to Ubuntu 24.04 using do-release-upgrade. Before that, systemd=true and networkingMode=mirrored coexist fairly well. |
My Pc started this error today |
Type: Bug
Please take a look at the details provided here ==> https://stackoverflow.com/questions/78733419/can-not-connect-vscode-to-wsl2-running-ubuntu-22-04
VS Code version: Code 1.91.0 (ea1445c, 2024-07-01T18:52:22.949Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Connection to 'WSL: Ubuntu-22.04' could not be established WebSocket close with status code 1006
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Connection to 'WSL: Ubuntu-22.04' could not be established WebSocket close with status code 1006
A/B Experiments
The text was updated successfully, but these errors were encountered: