Local: macOS 12.6, vscode1.72.2, remote-ssh v0.90.1 preview
Server: Tencent Cloud Lightweight Server centOS7.6
Server ssh configuration is set: AllowTcpForwarding yes
The local command line ssh connection server can be entered normally.
The error message is:
channel 2: open failed: administratively prohibited: open failed
Related
I have a development server that only enables the HTTP server while I have an active session on it. The connection is configured in ~/.ssh/config, and VSCode uses this for the remote session as well:
Host devserver
HostName <hostname>
User <username>
IdentityFile ~/.ssh/id_rsa
ForwardAgent yes
In VSCode I use the default settings for Remote SSH, when first connecting to the remote, only the platform was set:
{
"remote.SSH.remotePlatform": {
"devserver": "linux"
},
}
Through a regular terminal, when I SSH into the server and issue the w command, I get:
14:26:23 up 343 days, 23:53, 1 user, load average: 4.45, 4.65, 3.93
USER TTY FROM LOGIN# IDLE JCPU PCPU WHAT
username pts/0 ip-address 14:26 1.00s 0.05s 0.00s w
However, if I start a VSCode Remote-SSH session to the server, my HTTP server doesn't get started. If I issue the w command in the VSCode terminal, the table is empty:
14:28:27 up 343 days, 23:55, 0 users, load average: 4.59, 4.67, 4.04
USER TTY FROM LOGIN# IDLE JCPU PCPU WHAT
Is there a way to start a login session from VSCode when remote-developing on the server?
Goal: Get regular Bash and Git in Terminal working for Python projects in Visual Studio Code.
Anytime I launch, I see this error. I cannot open code or use Terminal.
Error Message:
The editor cannot be opened due to an unexpected error: No file system provider found for resource 'vscode-remote://wsl%2Bubuntu/...'
Update: Uninstalled WSL. I no longer have the below old Terminal output.
Terminal:
[2022-06-13 15:53:18.277] Resolving wsl+ubuntu, resolveAttempt: 1
[2022-06-13 15:53:18.361] Starting VS Code Server inside WSL (wsl1)
[2022-06-13 15:53:18.361] Extension version: 0.66.3
[2022-06-13 15:53:18.361] Windows build: 19044. Multi distro support: available. WSL path support: enabled
[2022-06-13 15:53:18.361] No shell environment set or found for current distro.
[2022-06-13 15:53:18.546] WSL daemon log file:
[2022-06-13 15:53:18.548] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Ubuntu -e sh -c "[ -d ~/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2022-06-13 15:53:19.023] Probing result: x86_64
[2022-06-13 15:53:19.024] No server install found in WSL, needs linux-x64
[2022-06-13 15:53:19.024] Downloading server on client side to C:\Users\dabell\AppData\Local\Temp\vscode-remote-wsl\c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5\vscode-server-stable-linux-x64.tar.gz.
[2022-06-13 15:53:19.024] https://update.code.visualstudio.com/commit:c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/server-linux-x64/stable
[2022-06-13 15:53:26.719] Unable to download server on client side: Error: Request downloadRequest failed with message: getaddrinfo ENOTFOUND update.code.visualstudio.com. Will try to download on WSL side.
[2022-06-13 15:53:26.721] Launching C:\WINDOWS\System32\wsl.exe -d Ubuntu sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 stable code-server .vscode-server --host=127.0.0.1 --port=0 --connection-token=1433349295-3472956524-2784734323-674824766 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2022-06-13 15:53:27.103] Setting up server environment: Looking for /home/danielbellhv/.vscode-server/server-env-setup. Not found.
[2022-06-13 15:53:27.104] WSL version: 4.4.0-19041-Microsoft Ubuntu
[2022-06-13 15:53:27.104] Updating VS Code Server to version c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
[2022-06-13 15:53:27.104] Removing previous installation...
[2022-06-13 15:53:27.104] Installing VS Code Server for x64 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5)
[2022-06-13 15:53:27.104] Downloading:
[2022-06-13 15:53:37.329] 100%
[2022-06-13 15:53:37.329] Failed
[2022-06-13 15:53:37.331] --2022-06-13 16:53:37-- https://update.code.visualstudio.com/commit:c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/server-linux-x64/stable
[2022-06-13 15:53:37.331] Resolving update.code.visualstudio.com (update.code.visualstudio.com)...
[2022-06-13 15:53:47.093] failed: Temporary failure in name resolution.
[2022-06-13 15:53:47.093] wget: unable to resolve host address ‘update.code.visualstudio.com’
[2022-06-13 15:53:47.093] ERROR: Failed to download https://update.code.visualstudio.com/commit:c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/server-linux-x64/stable to /home/danielbellhv/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5-1655135606.tar.gz
[2022-06-13 15:53:47.094] VS Code Server for WSL closed unexpectedly.
[2022-06-13 15:53:47.094] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2022-06-13 15:53:47.116] WSL Daemon exited with code 0
This can be solved by restarting the WSL container's network.
Open Powershell from in Windows and type the following command:
Restart-Service LxssManager
I would advise saving it to a script such as restart-WSL-network.ps1 and setting up a shortcut to run this when it happens again.
I'm kind of late to the party, but I've just had this issue today. I only restarted Windows, and now it works fine!
Deleting the .vscode* folders in the home directory (in wsl) fixed the issue
running wsl --shutdown from windows command line and relaunch the vscode solved my issue.
I simply uninstalled and reinstalled WSL 2, from Windows Store.
You can via. command line, but I found using Windows Store to be more accessible / user friendly.
I installed remote-ssh plugin in my VSCode in an Ubuntu machine and I got a problem connecting to the remote server. The password prompt didn't appear and I couldn't enter my ssh passphrase and I suspect that's why the connection failed. Any advice? Thanks
[21:29:18.094] Spawning local server with {"serverId":1,"ipcHandlePath":"/run/user/1000/vscode-ssh-askpass-43be30dd59b7e1cc43e3ac15496de2994552e19d.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","34635","-o","ConnectTimeout=15","pipeline-azure-2.nplan.io"],"dataFilePath":"/home/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-pipeline-azure-2.nplan.io-c3f126316369cd610563c75b1b1725e0679adfb3-0.65.7/data.json"}
[21:29:18.094] Local server env: {"DISPLAY":":0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/home/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/snap/code/70/usr/share/code/code","VSCODE_SSH_ASKPASS_MAIN":"/home/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/run/user/1000/vscode-ssh-askpass-4ae6bcfc1164348347c6920b3ec572ba3eba795f.sock"}
[21:29:18.105] Spawned 239369
[21:29:18.301] > local-server-1> Spawned ssh, pid=239378
[21:29:18.305] stderr> OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f 31 Mar 2020
[21:29:23.099] stderr> debug1: Server host key: ssh-rsa SHA256:BJdFW33L3iusC5rckbrC9WmH7+dx5W1mC6VkyAsCFbs
[21:29:33.762] stderr> No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
[21:29:33.762] stderr>
[21:29:33.762] stderr>
[21:29:35.107] Terminating local server
[21:29:35.111] Resolver error: Error: Connecting with SSH timed out
at Function.Timeout (/home/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:64785)
at Timeout._onTimeout (/home/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:264709)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
[21:29:35.124] ------
I just deleted the .vscode-server folder on the server and voila!
Credits to: https://github.com/microsoft/vscode-remote-release/issues/3856#issuecomment-710733921
I have set up the cloud shell for vscode as given in this document; however it stopped connecting to the remote shell and it was only connected once initially. No VS Code version change happened. Current VSCode version is 1.46.1
Following are the logs thrown -
[13:31:22.078] Log Level: 2
[13:31:22.086] remote-ssh#0.51.0
[13:31:22.086] win32 x64
[13:31:22.093] SSH Resolver called for "ssh-remote+cloud-shell", attempt 1
[13:31:22.094] SSH Resolver called for host: cloud-shell
[13:31:22.094] Setting up SSH remote "cloud-shell"
[13:31:23.942] Using commit id "cd9ea6488829f560dc949a8b2fb789f3cdc05f5d" and quality "stable" for server
[13:31:23.945] Install and start server if needed
[13:31:23.951] Checking ssh with "ssh -V"
[13:31:23.957] Got error from ssh: spawn ssh ENOENT
[13:31:23.958] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[13:31:23.962] Got error from ssh: spawn C:\Windows\System32\OpenSSH\ssh.exe ENOENT
[13:31:23.962] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[13:31:28.385] > OpenSSH_8.3p1, OpenSSL 1.1.1g 21 Apr 2020
[13:31:28.390] Running script with connection command: "C:\Program Files\Git\usr\bin\ssh.exe" -T -D 50396 cloud-shell bash
[13:31:28.412] Terminal shell path: C:\Windows\System32\cmd.exe
[13:31:33.205] >
[13:31:33.206] Got some output, clearing connection timeout
[13:31:54.348] > ssh: connect to host 34.87.29.174 port 6000: Connection timed out
>
[13:31:54.764] "install" terminal command done
[13:31:54.765] Install terminal quit with output: ssh: connect to host 34.87.29.174 port 6000: Connection timed out
[13:31:54.766] Received install output: ssh: connect to host 34.87.29.174 port 6000: Connection timed out
[13:31:54.768] Resolver error: The connection timed out
[13:31:54.781] ------
I have successfully installed vs code server on the remote host following the steps here SSH with VSCode without internet.
Now when I ssh into the remote host, I can connect successfully and start working, but in the install terminal, it's still trying to install something, not sure if it's an extension on the remote host that I wanted to install earlier and later successfully installed with vsix. See the log from remote - ssh below, further down there's also output from the install terminal which shows a small bar moving, seemingly indicating progress of something.
How can I stop it from doing this every time I connect to the host? Thank you!!
[11:58:58.011] remote-ssh-nightly#2019.10.9540
[11:58:58.011] win32 x64
[11:58:58.013] SSH Resolver called for "ssh-remote+<hostname>", attempt 1
[11:58:58.013] SSH Resolver called for host: <hostname>
[11:58:58.013] Setting up SSH remote "<hostname>"
[11:58:58.028] Using commit id "<mycommitid>" and quality "stable" for server
[11:58:58.029] Testing ssh with ssh -V
[11:58:58.287] ssh exited with code: 0
[11:58:58.287] Got stderr from ssh: OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[11:58:58.290] Running script with connection command: ssh -T -D 61671 <hostname> bash
[11:58:58.292] Install and start server if needed
[11:58:58.295] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[11:58:58.639] >
[11:58:58.639] Got some output, clearing connection timeout
[11:58:59.616] > 6c2c07692b2a: running
>
[11:58:59.677] > Acquiring lock on /users/<myuserid>/.vscode-server/bin/<mycommitid>/vscode-remote-lock.<mycommitid>
> Found existing installation at /users/<myuserid>/.vscode-server/bin/<mycommitid>...
>
[11:58:59.718] > Found running server...
>
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
>
[11:58:59.739] > Checking server status on port 32772 with wget
> 6c2c07692b2a: start
> sshAuthSock====
> agentPort==32772==
> webViewServerPort====
> osReleaseId==centos==
> arch==x86_64==
> webUiAccessToken====
> 6c2c07692b2a: end
>
[11:58:59.739] Received install output:
sshAuthSock====
agentPort==32772==
webViewServerPort====
osReleaseId==centos==
arch==x86_64==
webUiAccessToken====
[11:58:59.740] Remote server is listening on port 32772
[11:58:59.740] Parsed server configuration: {"agentPort":32772,"osReleaseId":"centos","arch":"x86_64","webUiAccessToken":"","sshAuthSock":""}
[11:58:59.741] Starting forwarding server. localPort 61674 -> socksPort 61671 -> remotePort 32772
[11:58:59.742] Forwarding server listening on 61674
[11:58:59.742] Waiting for ssh tunnel to be ready
[11:58:59.750] [Forwarding server 61674] Got connection 0
[11:58:59.755] Tunneled remote port 32772 to local port 61674
[11:58:59.756] Resolved "ssh-remote+<hostname>" to "127.0.0.1:61674"
[11:58:59.756] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"success","osReleaseId":"centos","arch":"x86_64","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","remoteInConfigFile":"1","gotUnrecognizedPrompt":"0"},"measures":{"resolveAttempts":1,"retries":1}}
[11:58:59.756] ------
[11:58:59.784] [Forwarding server 61674] Got connection 1
[11:58:59.789] [Forwarding server 61674] Got connection 2
[12:01:59.722] >
[12:04:59.733] >
[12:07:59.744] >
Below is the output on the install terminal. At the end of this output, there's a small bar moving very slowly like a progress bar.
6c2c07692b2a: running
Acquiring lock on /users/<myuserid>/.vscode-server/bin/<commitid>/vscode-remote-lock.<commitid>
Found existing installation at /users/<myuserid>/.vscode-server/bin/<commitid>...
Found running server...
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
*
Checking server status on port 32772 with wget
6c2c07692b2a: start
sshAuthSock====
agentPort==32772==
webViewServerPort====
osReleaseId==centos==
arch==x86_64==
webUiAccessToken====
6c2c07692b2a: end