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

Problem with SSH connection from windows #808

Closed
kefniark opened this issue Nov 14, 2023 · 3 comments · Fixed by #848
Closed

Problem with SSH connection from windows #808

kefniark opened this issue Nov 14, 2023 · 3 comments · Fixed by #848
Labels

Comments

@kefniark
Copy link

kefniark commented Nov 14, 2023

What happened?
Getting some issue when trying to setup a dev environment, even with basic quickstart example (like nodejs).

  • Devpod desktop installed on my local windows 11
  • The docker is hosted on a ubuntu server 23.04
  • Both connected through ssh provider

Provisioning the container and using vscode web work both fine 👍
But when I try to connect to the devcontainer through ssh or use VSCode, it fails 😢

$ ssh test-nodejs.devpod
/bin/sh: line 0: exec: C:DevPoddevpod-cli.exe: not found
kex_exchange_identification: Connection closed by remote host

Looks like there is a path somewhere that struggle between / and \\ and I end up with neither.

I use gitbash and both windows or linux path are supported, C:\\DevPod\\devpod-cli.exe or /c/DevPod/devpod-cli.exe are both valid path and point to the same file, but out of the box devpod seems to try guessing and get it wrong.

Is there a way to update this path? Maybe an env variable or a settings ?
even just using devpod-cli.exe should works, it's in the PATH.

Local Environment:

  • DevPod Version: 0.4.2
  • Operating System: windows
  • ARCH of the OS: AMD64

DevPod Provider:

  • Local/remote provider: ssh
@pascalbreuninger
Copy link
Member

hey @kefniark, thanks for opening the issue. We'll look into it, looks like yet another path conversion issue indeed

@butonic
Copy link

butonic commented Jan 4, 2024

I noticed similar problems when trying to ssh into a remote kubernetes pod from Windows. devpod uses C:\Program Files\DevPod\devpod-cli.exe in the .ssh/config file:

Host my-kubernetes.devpod
  ForwardAgent yes
  LogLevel error
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  ProxyCommand C:\Program Files\DevPod\devpod-cli.exe ssh --stdio --context default --user vscode my-kubernetes
  User vscode

The ProxyCommand should be quoted like

Host my-kubernetes.devpod
  ForwardAgent yes
  LogLevel error
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  ProxyCommand "C:\Program Files\DevPod\devpod-cli.exe" ssh --stdio --context default --user vscode my-kubernetes
  User vscode

Which allows connecting but then copying the the vscode server seems to hang:

...
[00:13:05.544] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[00:13:05.578] > OpenSSH_for_Windows_9.2p1, LibreSSL 3.6.2

[00:13:05.581] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[00:13:05.624] > OpenSSH_9.4p1, OpenSSL 3.1.2 1 Aug 2023

[00:13:05.627] Expecting scp to be next to ssh at C:\Program Files\Git\usr\bin\scp.exe
[00:13:05.627] Testing scp with "C:\Program Files\Git\usr\bin\scp.exe"
[00:13:05.664] scp exited with code: 1
[00:13:05.664] Got stderr from scp: usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]
           [-i identity_file] [-J destination] [-l limit] [-o ssh_option]
           [-P port] [-S program] [-X sftp_option] source ... target
[00:13:05.666] Copying file to remote with "C:\Program Files\Git\usr\bin\scp.exe" "vscode-server.tar.gz" "vscode-server.tar.gz.done" "my-kubernetes.devpod":"/home/vscode/.vscode-server/bin//0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2"
[00:13:05.666] Using cwd: file:///c%3A/Users/jfd/AppData/Local/Temp/vscode_server_1704409985455
[00:13:05.666] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[00:13:06.049] >  
...
[00:22:03.310] > 
...

anyway, one thing at a time.

@nmartins
Copy link

nmartins commented Feb 9, 2024

Still experiencing this issue in 0.5.2
`[10:12:00.660] Log Level: 2
[10:12:00.666] VS Code version: 1.86.1
[10:12:00.666] Remote-SSH version: remote-ssh@0.108.0
[10:12:00.666] win32 x64
[10:12:00.667] SSH Resolver called for "ssh-remote+vscode-tmf632-ssh.devpod", attempt 1
[10:12:00.667] "remote.SSH.useLocalServer": false
[10:12:00.667] "remote.SSH.useExecServer": false
[10:12:00.667] "remote.SSH.showLoginTerminal": false
[10:12:00.667] "remote.SSH.remotePlatform": {}
[10:12:00.667] "remote.SSH.path": undefined
[10:12:00.668] "remote.SSH.configFile": undefined
[10:12:00.668] "remote.SSH.useFlock": true
[10:12:00.668] "remote.SSH.lockfilesInTmp": false
[10:12:00.669] "remote.SSH.localServerDownload": auto
[10:12:00.669] "remote.SSH.remoteServerListenOnSocket": false
[10:12:00.669] "remote.SSH.showLoginTerminal": false
[10:12:00.669] "remote.SSH.defaultExtensions": []
[10:12:00.669] "remote.SSH.loglevel": 2
[10:12:00.669] "remote.SSH.enableDynamicForwarding": true
[10:12:00.669] "remote.SSH.enableRemoteCommand": false
[10:12:00.669] "remote.SSH.serverPickPortsFromRange": {}
[10:12:00.669] "remote.SSH.serverInstallPath": {}
[10:12:00.672] SSH Resolver called for host: vscode-tmf632-ssh.devpod
[10:12:00.672] Setting up SSH remote "vscode-tmf632-ssh.devpod"
[10:12:00.674] Using commit id "31c37ee8f63491495ac49e43b8544550fbae4533" and quality "stable" for server
[10:12:00.675] Install and start server if needed
[10:12:03.250] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[10:12:03.251] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[10:12:03.251] Checking ssh with "C:\Windows\ssh.exe -V"
[10:12:03.252] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[10:12:03.252] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[10:12:03.253] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[10:12:03.254] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[10:12:03.254] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[10:12:03.254] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[10:12:03.287] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

[10:12:03.290] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 51599 "vscode-tmf632-ssh.devpod" bash
[10:12:03.291] Terminal shell path: C:\Windows\System32\cmd.exe
[10:12:20.296] Resolver error: Error: Connecting with SSH timed out
at g.Timeout (c:\Users\NunoMartins.vscode\extensions\ms-vscode-remote.remote-ssh-0.108.0\out\extension.js:2:460371)
at Timeout._onTimeout (c:\Users\NunoMartins.vscode\extensions\ms-vscode-remote.remote-ssh-0.108.0\out\extension.js:2:579770)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7)
[10:12:20.299] ------

[10:12:23.747] > 10:12:23�[38;5;6minfoWaiting for devpod agent to come up...

�]0;C:\Windows\System32\cmd.exe�
[10:12:23.748] Got some output, clearing connection timeout
[10:12:46.753] > 10:12:46 �[38;5;6minfo Waiting for devpod agent to come up...
[10:13:09.767] > 10:13:09 �[38;5;6minfo Waiting for devpod agent to come up...
[10:13:32.795] > 10:13:32 �[38;5;6minfo Waiting for devpod agent to come up...
[10:13:55.817] > 10:13:55 �[38;5;6minfo Waiting for devpod agent to come up...
[10:14:18.830] > 10:14:18 �[38;5;6minfo Waiting for devpod agent to come up...
[10:14:41.843] > 10:14:41 �[38;5;6minfo Waiting for devpod agent to come up...
[10:15:04.860] > 10:15:04 �[38;5;6minfo Waiting for devpod agent to come up...
[10:15:27.871] > 10:15:27 �[38;5;6minfo Waiting for devpod agent to come up...
[10:15:50.896] > 10:15:50 �[38;5;6minfo Waiting for devpod agent to come up...
[10:16:13.909] > 10:16:13 �[38;5;6minfo Waiting for devpod agent to come up...
[10:16:36.933] > 10:16:36 �[38;5;6minfo Waiting for devpod agent to come up...
[10:16:59.958] > 10:16:59 �[38;5;6minfo Waiting for devpod agent to come up...
[10:17:23.398] > 10:17:23 �[38;5;1merror Try enabling Debug mode under Settings to see a more verbose output
10:17:23 �[38;5;1mfatal connect to server: timeout waiting for instance connection: context deadline exceeded
kex_exchange_identification: Connection closed by remote host
The process tried to write to a nonexistent pipe.
[10:17:24.663] "install" terminal command done
[10:17:24.663] Install terminal quit with output: kex_exchange_identification: Connection closed by remote host
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants