Skip to content
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

Unable to download vscode server from WSL #79

Closed
superm1 opened this issue May 3, 2019 · 13 comments
Closed

Unable to download vscode server from WSL #79

superm1 opened this issue May 3, 2019 · 13 comments
Assignees
Labels
wsl Issue in vscode-remote WSL

Comments

@superm1
Copy link

superm1 commented May 3, 2019

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..

@joaomoreno
Copy link
Member

@aeschli How are you downloading the server?

@superm1
Copy link
Author

superm1 commented May 3, 2019

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?

@mjbvz mjbvz added the wsl Issue in vscode-remote WSL label May 3, 2019
@aeschli
Copy link
Contributor

aeschli commented May 6, 2019

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

@joaomoreno
Copy link
Member

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

@superm1
Copy link
Author

superm1 commented May 6, 2019 via email

@aeschli aeschli changed the title Unable to set up VS Code on WSL Unable to download vscode server from WSL May 7, 2019
@nafhn
Copy link

nafhn commented May 16, 2019

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).

@kvotheyr
Copy link

kvotheyr commented May 22, 2019

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`

@zephyrthenoble
Copy link

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

@ASk1
Copy link

ASk1 commented Jun 20, 2019

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

@aeschli aeschli closed this as completed Jun 20, 2019
@aeschli
Copy link
Contributor

aeschli commented Jun 21, 2019

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.

@iamteedoh
Copy link

@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?

@iamteedoh
Copy link

iamteedoh commented Jun 24, 2019

@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?

@iamteedoh
Copy link

@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.

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wsl Issue in vscode-remote WSL
Projects
None yet
Development

No branches or pull requests

9 participants