5

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!

4 Answers 4

7

Had the same problem.

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

Sign up to request clarification or add additional context in comments.

2 Comments

I wasted so much time on this, and all I had to do was restart!
exactly the same in my case :)
1

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/

Comments

0

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

Comments

0

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

1 Comment

This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.