-
Notifications
You must be signed in to change notification settings - Fork 30.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
[wsl] VSCode not opening in WSL after WSL update #198285
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.84.2. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding! |
Just upgraded to 1.84.2. |
Same failure with VS Code Insider (1.85.0-insider) |
|
Same here
|
I've been able to make it work again, unexpectedly. For the last year, every single working day, I started VSCode with This time, instead, I just double clicked the icon on the Windows desktop, and VSCode started without errors, connected to WSL, and opened the last file I was editing yesterday, in the Ubuntu folder. |
1 - I confirm 🎉, but only when I reboot my machine and if VSCode on WSL is the first thing I do. 3 - After I successfuly open WSCode on WSL and I close it, subsequent attempts to re-open it succeed. 4 - It looks like VSCode hijack WSL so that wsl.exe cannot use it, and wsl.exe hijack WSL so that VSCode cannot use it. In case 3, I can get the following error message:
At this point, $PATH does not contain Windows PATH anymore. |
Somehow starting wsl from powershell as admin seems to fix it for me. Opening the standalone wsl.exe is still borked with the paths not being translated, but wsl from powershell and VSCode work now. |
Same issue using the most up-to-date version of VS Code and WSL. Can confirm that starting VS Code with the executable right after a reboot (instead of running "code . " in the WSL terminal) works for VS Code. Edit: Docker Desktop still does not start |
There has been no changes to the WSL extension recently. I suspect it's a problem in WSL 5.15.90. @craigloewen-msft microsoft/WSL#10752 (comment) also mentions this and has a workaround. |
Good idea. I've found that after a reboot:
For unknown reason, VSCode is starting in admin mode on my machine, instead of normal mode. |
The suggestion from here works for me. Add the following to .wslconfig:
After rebooting the laptop (just wsl --shutdown was not sufficient for me) I can start VS Code (both from the exe or the wsl terminal) & Docker desktop without issues. Don't know what are the repercussions for disabling virtio9p but things seem to work okay for me. |
I have the same issue. How did you check in which mode is running VsCode? Also I found that always is getting setup from Windows, not from wsl. |
It is written in the seach bar, on the top of the Window (e.g. 🔍my_project [WSL: Ubuntu] [Administrator]) |
I have the exact same issue @ecastro-capgemini and the virtio9p solution hasn't changed anything. |
Could you try restarting after changing the setting please? |
I had restarted multiple times but the issue was still there. Then, I decided to install a competitor paid IDE for PHP with remote connection capabilities and it worked right away. Both IDEs worked at that point and continued to be working up to now. We will see if the issue will return in VS. |
@ecastro-capgemini - it worked on my captop. |
I've litterally re-registred Ubuntu and the issue wasn't fix. |
please note by saying,
Put changes in |
Thank you for the clarification. That worked right away! |
I did the changes as mentioned here but it isn't working for me. /.vscode/extensions/ms-vscode-remote.remote-wsl-0.81.8/scripts/wslCode.sh: 63: /home/vanguard/.vscode/bin/e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff/bin/remote-cli/code: not found
|
@benhillis Can we move this issue to the WSL repo, or is there already a corresponding issue? |
Seems to be resolved by WSL 2.0.14
|
this works for me |
Seems to be resolved by WSL 2.0.14 |
Thanks all for the continued feedback. It sounds like upgrading to WSL 2.0.14 resolved the issue for several folks. Are there still folks experiencing trouble here? If so, to help the WSL team take a closer look, could you please take a trace? https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1. |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
code .
=> It workswsl --update
)Work around : install VSCode for Linux (sudo snap install code --classic) and use it in degraded mode.
Failure log:
The text was updated successfully, but these errors were encountered: