Introduction

VS Code Remote SSH Not Working usually means the editor can start the SSH command but fails later while installing or starting the VS Code server on the remote machine. The root cause is often one of four things: plain SSH connectivity is broken, shell startup scripts print unexpected output, the remote VS Code server is stale, or the auth path never completes cleanly.

Symptoms

  • VS Code stays on Setting up SSH Host or Installing VS Code Server
  • Remote windows fail while plain terminal SSH may still work
  • The remote extension host crashes or reconnects repeatedly
  • Authentication prompts appear inconsistently or never complete

Common Causes

  • The underlying SSH connection is failing or using the wrong config
  • Shell startup output breaks the protocol VS Code expects during server bootstrap
  • The remote VS Code server install is corrupted or version-mismatched
  • The remote workspace or extension set is too heavy during startup

Step-by-Step Fix

  1. 1.Confirm plain SSH works first
  2. 2.Test the exact host alias from your terminal before debugging VS Code itself.
bash
ssh -v my-remote-host
  1. 1.Check shell startup output
  2. 2.VS Code Remote SSH expects a clean non-interactive shell. Extra banner text can break startup.
bash
ssh my-remote-host 'echo shell-ok'
  1. 1.Clear the remote VS Code server
  2. 2.Remove the remote server install so VS Code can redeploy a clean copy.
bash
rm -rf ~/.vscode-server ~/.vscode-server-insiders
  1. 1.Reconnect with the minimum extension set
  2. 2.If the base SSH path works, temporarily disable heavy remote extensions and reconnect.

Prevention

  • Keep shell startup scripts quiet for non-interactive sessions
  • Re-test the raw SSH alias whenever Remote SSH starts failing
  • Let VS Code redeploy the remote server after major version jumps
  • Keep large remote workspaces trimmed with watch and search exclusions