Setting Up VS Code
Edit and run code on your Mac from Visual Studio Code with the Remote - SSH extension.
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
- Open the Command Palette (⇧⌘P on macOS, Ctrl+Shift+P on Windows/Linux).
- Run Remote-SSH: Connect to Host…
- Choose the
my-macentry from your~/.ssh/config, or type<username>@<your-mac>.<tailnet>.ts.net. - If asked for the remote platform, choose macOS.
- 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
$ code --remote ssh-remote+my-mac /Users/<username>/my-projectForwarding 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.