Vscode-remote-release: Cannot start VSCode in WSL in 10.0.19555

Created on 31 Jan 2020  路  9Comments  路  Source: microsoft/vscode-remote-release


  • VSCode Version: 1.42.0-insiders (system setup)
  • Local OS Version: Microsoft Windows [Version 10.0.19555.1001]
  • Remote OS Version: Debian, 4.19.84-microsoft-standard
  • Remote Extension/Connection Type: WSL
  • WSL Version: 2

Steps to Reproduce:

  1. Start VS Code
  2. Open Remote Explorer, Select 'WSL Target'
  3. Hover on any distro, click 'Connect to WSL'

Remote-WSL Logs:

[2020-01-31 11:45:39.437] Resolving wsl+Debian, resolveAttempt: 1
[2020-01-31 11:45:39.535] Starting VS Code Server inside WSL (Debian)
[2020-01-31 11:45:39.535] Extension version: 0.42.1, Windows build: 19555. Multi distro support: available. WSL path support: enabled
[2020-01-31 11:45:39.777] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Debian -e sh -c "[ -d ~/.vscode-server-insiders/bin/8d4cdbaa8d64514a5eb3b186b9a31b66cd8a9753 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2020-01-31 11:45:49.919] Unable to detect if server is already installed: Error: Command failed: C:\WINDOWS\System32\wsl.exe -d Debian -e sh -c "[ -d ~/.vscode-server-insiders/bin/8d4cdbaa8d64514a5eb3b186b9a31b66cd8a9753 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2020-01-31 11:45:49.919] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
[2020-01-31 11:45:49.922] Launching C:\WINDOWS\System32\wsl.exe -d Debian sh -c 'env && VSCODE_WSL_DEBUG_INFO=true "$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 8d4cdbaa8d64514a5eb3b186b9a31b66cd8a9753 insider .vscode-server-insiders 0  ' in c:\Users\RyuZU#YourSlave\.vscode-insiders\extensions\ms-vscode-remote.remote-wsl-0.42.1
[2020-01-31 11:46:00.058] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
[2020-01-31 11:46:00.058] VS Code Server for WSL closed unexpectedly.
[2020-01-31 11:46:00.058] For help with startup problems, go to
[2020-01-31 11:46:00.059] https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2020-01-31 11:46:00.078] WSL Daemon exited with code 0


Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Not Tried

Notes:
There is newly posted issues on microsoft/WSL#4860, where the similar error is happened but in my case, the error only happen VS Code trying to start in WSL. Directly execute wsl.exe -d Debian -e sh -c "[ -d ~/.vscode-server-insiders/bin/8d4cdbaa8d64514a5eb3b186b9a31b66cd8a9753 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)" just return found in the console.

Microsoft Windows [Version 10.0.19555.1001]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>wsl --list --verbose
  NAME      STATE           VERSION
* Debian    Stopped         2

C:\WINDOWS\system32>wsl.exe -d Debian -e sh -c "[ -d ~/.vscode-server-insiders/bin/8d4cdbaa8d64514a5eb3b186b9a31b66cd8a9753 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
found
C:\WINDOWS\system32>

Calling code-insiders . inside WSL result a similar behavior, which is A connection attempt failed because...

wsl2

Most helpful comment

I decided not to keep pruning my Windows path, and am changing it within a Powershell session instead. It works! No Win10 rollback required. I posted the workaround in detail here in case it helps anyone. https://github.com/microsoft/WSL/issues/4860#issuecomment-581592480

All 9 comments

I have the same issue. I tried to purge/reinstall openssh per this comment on microsoft/WSL#4860, but it did not resolve this issue.

Based on another comment on microsoft/WSL#4860, the issues happened due to a long Path environment variable. I removed some path from the Path entry (I removed a path that point to Java binary since I don鈥檛 use it often), and I can launch VS Code with WSL2 again. The fix for that is coming up in the next Insiders build so anyone that have this similar issues can try this temporary workaround before the next update come out.

It is weird that it didn't happen when using Command Prompt or Powershell... I haven't tried comparing the environment value between them to see if there is any different between VSC and console.

Thanks @syaraf-az got the pointer.
Looks like an upstream issue in WSL2: https://github.com/microsoft/WSL/issues/4860

I'm able to reproduce, but haven't found a workaround so far. I'll add a more specific message to the error dialog. So far it looks like reverting to 19551 is the best option.

Hmm...
I actually following the issues in microsoft/WSL#4860 and used the workaround by shortening the Path length. So far, the workaround worked fine on my computer. I can use WSL2 with VS Code - Insiders in 10.0.19555.1001 normally without reverting to the previous version.

I don't know if this information help or not, but my current Path length is 308 character in Windows, 428 characters in WSL2. There is also an instance where VSC is updated, and it failed to connect to WSL with same error 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond' but calling it inside WSL terminal somehow allow the server instance in WSL to be updated and VSC is again able to connect to it after reloading VSC window.

Thanks @syaraf-az . I had the same problem, removed parts of the path that I didn't require for now, and it started workin again.

I've been commenting in https://github.com/microsoft/WSL/issues/4860 as well. I was able to get WSL going by shortening my Windows path, but VSCode still cannot access WSL; same errors as @syaraf-az 's original post above, except with Ubuntu-18.04 and Ubuntu, with Win10 Insider Preview 19555.

I keep pruning my PATH and retrying, but still no success with VSCode/WSL yet. At this point:
Windows path length 392
WSL2 path length 472

Knowing @syaraf-az has VSC/WSL working with a path of 428 in WSL gives me hope as I'm not too far off from that. I'll try another round of pruning later today and report back.

Incidentally, I thought I'd try moving the VSCode path earlier in the PATH (it now begins at character 57 in Windows and 158 in WSL2) but that has not helped, either.

I decided not to keep pruning my Windows path, and am changing it within a Powershell session instead. It works! No Win10 rollback required. I posted the workaround in detail here in case it helps anyone. https://github.com/microsoft/WSL/issues/4860#issuecomment-581592480

I just received build 10.0.19559.1000 on my device and seems like the issue is fixed?
I tried adding back the path that I already removed and VS Code seems able to start properly with WSL2. Not too sure as WSL2 is working properly on my device after the Path variable is trimed in build 19555.1001.

Oh, sorry, I forgot to close this issue:
A few days ago I pushed new versions of the Remote - WSL extension (0.41.9, 0.42.3) with a workaround to overcome the PATH length issues (the extension uses an empty PATH when internally calling wsl.exe).

Was this page helpful?
0 / 5 - 0 ratings