user452306
user452306

Reputation: 179

Can't connect remotely using Remote-SSH: "spawn UNKNOWN"

I'm trying to remotely connect to a server (running on Ubuntu 16.04.7 LTS) through VSCode (started on WSL).

I've set the path to my WSL Config file (with the SSH keys inside) in VSCode Remote-SSH.

I can reach and connect to the server through the terminal as well as the VSCode terminal.

Yet, when trying to connect through Remote-SSH I'm getting the message

Failed to connect to the remote extension host server (Error: spawn UNKNOWN)

with the following error log:

[13:50:42.906] Log Level: 2
[13:50:42.922] [email protected]
[13:50:42.922] win32 x64
[13:50:42.925] SSH Resolver called for "ssh-remote+<net>.net", attempt 1
[13:50:42.925] SSH Resolver called for host: <net>.net
[13:50:42.926] Setting up SSH remote "<net>.net"
[13:50:42.970] Using commit id "<CommitID>" and quality "stable" for server
[13:50:42.974] Install and start server if needed
[13:50:44.876] Checking ssh with "ssh -V"
[13:50:44.888] Finding installed ssh failed: spawn UNKNOWN
[13:50:44.897] Resolver error: Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:394:11)
    at Object.spawn (child_process.js:549:9)
    at c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:242426
    at new Promise (<anonymous>)
    at q (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:242347)
    at k (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:242298)
    at _ (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:245580)
    at P (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:245741)
    at O (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:242117)
    at C (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:242026)
    at Object.t.generateMultiLineCommand (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:243396)
    at q (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:107623)
    at c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:105016
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
    at async Object.t.withShowDetailsEvent (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:110096)
    at async Object.t.resolve (c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:108158)
    at async c:\Users\<user>\.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:143767
[13:50:44.908] ------

Already tried setting up manually the vscode server remotely as suggested here

Thanks in advance for any help!

Upvotes: 4

Views: 13807

Answers (4)

Kajal Mondal
Kajal Mondal

Reputation: 1

I encountered the "Can't connect remotely using Remote-SSH: spawn UNKNOWN" error while using VS Code version 1.85.2.

The issue was resolved automatically after upgrading to VS Code version 1.96.2

Upvotes: -1

uzay95
uzay95

Reputation: 16632

Before connecting by VSCode you need to make ssh connection from terminal to save remote host fingerprint to known_hosts file.

I didn't try but you may also add StrictHostKeyChecking no line into your ssh config file as below:

Remote open ssh config file

ssh config file path

without StrictHostKeyChecking line

with StrictHostKeyChecking line

Upvotes: 0

Javier S
Javier S

Reputation: 396

Had the same problem.

After trying everything, the only thing that worked 100% was just killing vs-code and opening it again.

Upvotes: 5

tallwithknees
tallwithknees

Reputation: 311

Seems things got messed up with the update. I fixed it by reinstalling the Remote SSH extension: ms-vscode-remote.remote-ssh and reloading as you will be instructed to do. I also just installed the entire Remote Development extension: ms-vscode-remote.vscode-remote-extensionpack and reloaded vscode as instructed by vscode.

Before this though, I deleted (rm -rf) the contents of /home/<your_username>/.vscode-server/ bin/ and data/

Upvotes: 1

Related Questions