Skip to content

Setting Up VS Code

Edit and run code on your Mac from Visual Studio Code with the Remote - SSH extension.

On this page

Install the extension

In VS Code, open the Extensions view and install Remote - SSH (ms-vscode-remote.remote-ssh) from Microsoft. Make sure Tailscale is connected and you can already sign in with ssh from a terminal.

Connect

  1. Open the Command Palette (⇧⌘P on macOS, Ctrl+Shift+P on Windows/Linux).
  2. Run Remote-SSH: Connect to Host…
  3. Choose the my-mac entry from your ~/.ssh/config, or type <username>@<your-mac>.<tailnet>.ts.net.
  4. If asked for the remote platform, choose macOS.
  5. Use File → Open Folder to open a folder on the Mac.

On first connection VS Code installs its server component in ~/.vscode-server on the Mac, which requires the Mac to reach the internet.

Open from the command line

Terminal
$ code --remote ssh-remote+my-mac /Users/<username>/my-project

Forwarding ports

When a dev server starts on the Mac, VS Code usually offers to forward its port automatically. You can also add ports in the Ports panel and open them at http://localhost:<port>.

Need a hand? Check the status page or contact support.