Vscode-remote-release: Unable to download vscode server from WSL

Created on 3 May 2019  路  13Comments  路  Source: microsoft/vscode-remote-release


VSCode Version: 1.34.0-insider (user setup)
Local OS Version: Windows 10, 1803
Remote OS Version: Ubuntu 18.04
Remote Extension/Connection Type: WSL

Steps to Reproduce:

  1. Install VS Code insiders
  2. Install Remote-WSL extension
  3. Try to launch a remote WSL window.
  4. See below errors.
[2019-05-03 14:44:06.720] Starting VS Code Server inside WSL.
[2019-05-03 14:44:07.614] Launching C:\WINDOWS\System32\wsl.exe bash -i -c "./scripts/wslServer.sh 473af338e1bd9ad4d9853933da1cd9d5d9e07dc9 insider .vscode-remote  " in c:\Users\mario_limonciello\.vscode-insiders\extensions\ms-vscode-remote.remote-wsl-0.32.0
[2019-05-03 14:44:09.413] Installing VS Code Server 473af338e1bd9ad4d9853933da1cd9d5d9e07dc9
[2019-05-03 14:44:09.713] Downloading:     
[2019-05-03 14:44:10.314] Failed
[2019-05-03 14:44:10.314] Will not apply HSTS. The HSTS database must be a regular and non-world-writable file.
[2019-05-03 14:44:10.314] ERROR: could not open HSTS store at '/home/supermario/.wget-hsts'. HSTS will be disabled.
[2019-05-03 14:44:10.314] --2019-05-03 09:44:10--  https://update.code.visualstudio.com/commit:473af338e1bd9ad4d9853933da1cd9d5d9e07dc9/server-linux-x64/insider
[2019-05-03 14:44:10.314] Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 51.144.164.215
[2019-05-03 14:44:10.314] Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|51.144.164.215|:443... 
[2019-05-03 14:44:10.415] connected.
[2019-05-03 14:44:10.415] Unable to establish SSL connection.
[2019-05-03 14:44:10.415] ERROR: Failed to download https://update.code.visualstudio.com/commit:473af338e1bd9ad4d9853933da1cd9d5d9e07dc9/server-linux-x64/insider to /home/supermario/.vscode-remote/bin/473af338e1bd9ad4d9853933da1cd9d5d9e07dc9-1556894649.tar.gz
[2019-05-03 14:44:10.415] VS Code Server for WSL closed unexpectedly.

Worth noting I do need an NTLM proxy, so it's entirely possible that needs to be configured in advance within WSL somehow..

wsl

Most helpful comment

My solution is ~.wgetrc with
use_proxy=on
http_proxy=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
check_certificate = off

All 13 comments

@aeschli How are you downloading the server?

In insiders I hit ctrl-shift-p and then hit Remote-WSL: New Window

Received this:
image

Which correlated to that log. So I guess the extension is trying to download the server in WSL for me?

@joaomoreno We do wget -O "$name" -o /dev/stdout --progress=dot "https://update.code.visualstudio.com/commit:$COMMIT/server-linux-x64/$QUALITY"

Yup. That won't really work behind a proxy.

Is it possible to do the curl/wget from the Windows side and pass the binary result into WSL?

Although I guess there's still going to be problems with proxy for extensions and the like.

Also, having problems with this.

The docs here (https://code.visualstudio.com/docs/remote/wsl) indicate that adding proxy vars for HTTP_PROXY and/or HTTPS_PROXY on the remote (WSL) side might solve this problem (that would make sense) but it does not seem to fix the issue described here. Further, this doc does not indicate where to add "global proxy settings". I tried /etc/environment, ~/.bashrc, and /etc/profile. Putting proxy settings in any of these places are adequate for other Linux utilities like curl or apt to "get out to the internet".

I feel like this could probably be fixed pretty easily by just having vscode pick up proxy vars in WSL - either from the user's default shell or from a specific file (the Vagrant proxyconf plugin uses /etc/environment).

I'm running into the same issue (behind corporate proxy). Any resolution for this?. Here's the log

`[2019-05-22 03:54:20.286] Starting VS Code Server inside WSL.

[2019-05-22 03:54:20.837] Launching C:\windows\System32\wsl.exe bash -c "./scripts/wslServer.sh 4ca38ce5584d7cd67b435b3c32ef1240c6a29628 insider .vscode-remote " in c:\Users\reddybvy.vscode-insiders\extensions\ms-vscode-remote.remote-wsl-0.36.0

[2019-05-22 03:54:22.938] Updating server...
[2019-05-22 03:54:23.538] Updating VS Code Server to version 4ca38ce5584d7cd67b435b3c32ef1240c6a29628
[2019-05-22 03:54:23.538] Removing previous installation...
[2019-05-22 03:54:24.440] Downloading:
[2019-05-22 03:55:54.945] VS Code Server for WSL failed to start. No messages received for 90s
[2019-05-22 03:55:54.945] For help with startup problems, go to
[2019-05-22 03:55:54.945] https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips`

I have found a workaround until this is fixed on the VS Code side if you are behind a proxy.

  1. Launch a normal WSL session
  2. Make sure all of your proxy variables are set
  3. Go to the location of the script to download the VS Code Server. This location is available by looking at the path that VS Code spits out when it errors. It should be something like /mnt/c/Users/yourname/.vscode-insiders/extensions/ms-vscode-remote.remote-wsl-0.36.0
  4. Run the bash command exactly as specified in log messages, the part in the quotes after bash -c (my command was ./scripts/wslServer.sh 6964233e81c68f5a5f34e7eb1da0836e1d539f14 insider .vscode-remote --disable-telemetry)
  5. Allow the script to run, download, and install the VS Code Server
  6. You can exit the server once it starts running
  7. Try opening a WSL window from VS Code

My solution is ~.wgetrc with
use_proxy=on
http_proxy=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
check_certificate = off

In the upcoming version we now download the server on the Windows side. That way we avoid problems with missing proxy settings or missing certificates.

@aeschli - in which version of what? WSL or VS Code? I'm currently running VS Code 1.35.1 and still the same issue so I'm assuming it's not in this version?

@zephyrthenoble - Followed your steps and 1-6 work fine. However, step 7 yields the following in VS Code when I launch a new WSL window from within VS Code:

[2019-06-24 12:00:27.075] Starting VS Code Server inside WSL.
[2019-06-24 12:00:28.582] Launching C:\WINDOWS\System32\wsl.exe bash -c "./scripts/wslServer.sh c7d83e57cd18f18026a8162d042843bda1bcf21f stable .vscode-server " in c:\Users\myuser.vscode\extensions\ms-vscode-remote.remote-wsl-0.38.0
[2019-06-24 12:00:28.875] Updating server...
[2019-06-24 12:00:28.875] Starting server in /bin/bash...
[2019-06-24 12:00:29.175] open terminal failed: not a terminal

Any thoughts?

@zephyrthenoble - Followed your steps and 1-6 work fine. However, step 7 yields the following in VS Code when I launch a new WSL window from within VS Code:

[2019-06-24 12:00:27.075] Starting VS Code Server inside WSL.
[2019-06-24 12:00:28.582] Launching C:\WINDOWS\System32\wsl.exe bash -c "./scripts/wslServer.sh c7d83e57cd18f18026a8162d042843bda1bcf21f stable .vscode-server " in c:\Users\myuser.vscode\extensions\ms-vscode-remote.remote-wsl-0.38.0
[2019-06-24 12:00:28.875] Updating server...
[2019-06-24 12:00:28.875] Starting server in /bin/bash...
[2019-06-24 12:00:29.175] open terminal failed: not a terminal

Any thoughts?

Found the issue! I use TMUX so if you have it enabled to come up when a shell starts, as I did, it'll render it as not a valid terminal. For example, I have the following in my .bashrc file:

[[ $- != *i* ]] && return
[[ -z "$TMUX" ]] && exec tmux

So I commented that out and tried WSL again within VS Code and it works fine.

Was this page helpful?
0 / 5 - 0 ratings