Connect VS Code to your mini with Remote - SSH
Set up an SSH host in Visual Studio Code, open a project on your rented mini and check that the integrated terminal runs on the remote computer.
Before you start Install desktop VS Code on the computer in front of you. In My minis, open Workspace details for your rental. Keep its SSH command and host fingerprint handy.
View full-size screenshot ↗
Open the desktop app. From Welcome you can begin without a Microsoft account. If a sign-in prompt appears, choose Continue without Signing In.
View full-size screenshot ↗
Press F1 and type Terminal: Create New Terminal. Press Enter on the highlighted command.
View full-size screenshot ↗
Run your SSH command with the folder-creation command appended. Compare the entire SHA256 fingerprint with Workspace details before accepting.
View full-size screenshot ↗
Enter your machine password. Here the mini replied with /Users/miniguide/mini-project, then SSH returned to the laptop.
View full-size screenshot ↗
Open Extensions in the left sidebar. Choose Microsoft’s Remote - SSH search result.
View full-size screenshot ↗
Check the publisher next to the extension name, then click Install on the details page.
View full-size screenshot ↗
Press F1. Search for Remote-SSH: Open SSH Configuration File and run it.
View full-size screenshot ↗
Choose the config under your user folder. On this computer it’s /home/you/.ssh/config.
View full-size screenshot ↗
This example calls the connection my-mini. Fill in the machine username and hostname from Workspace details before saving.
View full-size screenshot ↗
Open the Command Palette and type Remote-SSH: Connect to Host. Choose Connect to Host or Connect Current Window to Host.
View full-size screenshot ↗
Pick the nickname you saved in the previous step.
View full-size screenshot ↗
Check the account in the prompt, type its current password and press Enter. The first connection also installs VS Code Server.
View full-size screenshot ↗
Look in the lower-left corner for SSH: my-mini. Use Open Folder in this remote window.
View full-size screenshot ↗
Select mini-project in the remote home folder and click OK.
View full-size screenshot ↗
For your own empty practice folder, choose Trust Folder & Continue if this prompt appears.
View full-size screenshot ↗
Use New File beside the project name in Explorer. Type hello.txt and press Enter.
View full-size screenshot ↗
Type Hello from my mini, add a line break and save. The window title still shows the SSH connection.
View full-size screenshot ↗
In a new terminal in the remote window, run pwd and then cat hello.txt. Compare the output with the line you typed.
View full-size screenshot ↗
Click the SSH badge and choose Close Remote Connection. The saved file stays on the mini.
Captured in desktop VS Code on Ubuntu while working on a physical Mac mini. The terminal and folder picker show the Mac’s /Users path. Click any screenshot for the full window.
Where do the editor and your project live?
Try a small experiment. Type a line on your laptop, click Save, then ask the mini to read it back. With Microsoft’s Remote - SSH extension, the editor stays on your computer while the file lives on the mini. A single text file is all you need to try it.
When a step asks for the Command Palette, open the View menu and choose Command Palette, or press F1. Start typing the command name and select the matching result. On Windows and Linux you can also press Ctrl+Shift+P. On a Mac, press ⇧⌘P.
First, check your SSH login from this computer. →-
Open VS Code and make a practice folder
Launch VS Code. If the welcome screen offers GitHub sign-in, you can choose Continue without Signing In and finish the prompts. Open the Command Palette and run
Terminal: Create New Terminal. A panel opens along the bottom. This first terminal runs on your own computer.Copy the SSH command from Workspace details. At the end of it, add a space followed by the quoted text shown below. Press Enter. This asks the mini to create a folder in your home directory and print its location. The sample screenshots use port 2222. Keep the port from your own rental.
ssh you@animal.loginmini.com "mkdir -p ~/mini-project && ls -d ~/mini-project"On the first connection, compare the entire fingerprint with the one in Workspace details before typing
yes. At the password prompt, type your current machine password and press Enter. Nothing appears as you type. Look for a path ending in/mini-project, followed by your local prompt. If you need a hand with this first login, follow the SSH walkthrough.See screenshots for this step
View full-size screenshot ↗
Start in the Welcome tab Open the desktop app. From Welcome you can begin without a Microsoft account. If a sign-in prompt appears, choose Continue without Signing In.
View full-size screenshot ↗
Open your first terminal Press F1 and type Terminal: Create New Terminal. Press Enter on the highlighted command.
View full-size screenshot ↗
Check who answered Run your SSH command with the folder-creation command appended. Compare the entire SHA256 fingerprint with Workspace details before accepting.
View full-size screenshot ↗
Look for the project path Enter your machine password. Here the mini replied with /Users/miniguide/mini-project, then SSH returned to the laptop.
-
Find the extension published by Microsoft
Click the Extensions icon on the left. It looks like a group of squares. Search for
Remote - SSHand select the result with that exact name from Microsoft. Pick Install on its details page. When the button changes to Uninstall, the extension is ready.See screenshots for this step
View full-size screenshot ↗
Find Remote - SSH Open Extensions in the left sidebar. Choose Microsoft’s Remote - SSH search result.
View full-size screenshot ↗
Click Install Check the publisher next to the extension name, then click Install on the details page.
-
Give your mini a name in VS Code
In the Command Palette, run
Remote-SSH: Open SSH Configuration File…. Select the file inside your own user folder. On Windows it usually ends in%USERPROFILE%\.ssh\config. On macOS and Linux, look for~/.ssh/config.In a new file, replace the sample entry with the block below. If you already have hosts saved, append the block on a new line. You can keep
my-minias the nickname. Copy your own hostname and machine username from Workspace details, and change the port if your rental lists a different one. Save with Ctrl+S or ⌘S.Host my-mini HostName animal.loginmini.com User you Port 22See screenshots for this step
View full-size screenshot ↗
Open the SSH configuration Press F1. Search for Remote-SSH: Open SSH Configuration File and run it.
View full-size screenshot ↗
Choose your personal file Choose the config under your user folder. On this computer it’s /home/you/.ssh/config.
View full-size screenshot ↗
Save the host entry This example calls the connection my-mini. Fill in the machine username and hostname from Workspace details before saving.
-
Connect to the saved host
Open the Command Palette again. Run
Remote-SSH: Connect to Host…and choosemy-mini. If a platform menu appears, choose macOS for a Mac mini or Linux for an Ubuntu mini. Type your machine password when prompted.The first connection may take a few minutes while VS Code installs its server in your remote account. Watch the lower-left corner. Once it reads
SSH: my-mini, you can open a folder on the mini.See screenshots for this step
View full-size screenshot ↗
Start a remote connection Open the Command Palette and type Remote-SSH: Connect to Host. Choose Connect to Host or Connect Current Window to Host.
View full-size screenshot ↗
Select my-mini Pick the nickname you saved in the previous step.
View full-size screenshot ↗
Enter the machine password Check the account in the prompt, type its current password and press Enter. The first connection also installs VS Code Server.
View full-size screenshot ↗
Find the SSH badge Look in the lower-left corner for SSH: my-mini. Use Open Folder in this remote window.
-
Open the project on the mini
In that remote window, choose Open Folder on the welcome page, or use File → Open Folder. Select
mini-projectin your remote home folder and confirm with OK. The title bar should now includemini-project [SSH: my-mini].VS Code may ask whether you trust the folder. You just created this empty practice folder yourself, so you can trust it. For a project from someone else, review its contents before allowing tasks or extensions to run.
See screenshots for this step
View full-size screenshot ↗
Choose the remote folder Select mini-project in the remote home folder and click OK.
View full-size screenshot ↗
Trust the folder you created For your own empty practice folder, choose Trust Folder & Continue if this prompt appears.
-
Save one line and read it back
In Explorer on the left, hover over the project heading and click the New File icon (a page with a plus). Type
hello.txtand press Enter. WriteHello from my mini, press Enter to end the line, then save the file.In this same window, choose Terminal → New Terminal or use the Command Palette again. Run these commands on separate lines. The first prints the project folder on the mini. The second prints the line you just saved.
pwd cat hello.txtSee screenshots for this step
View full-size screenshot ↗
Create hello.txt Use New File beside the project name in Explorer. Type hello.txt and press Enter.
View full-size screenshot ↗
Save a line on the mini Type Hello from my mini, add a line break and save. The window title still shows the SSH connection.
View full-size screenshot ↗
Read your edit back In a new terminal in the remote window, run pwd and then cat hello.txt. Compare the output with the line you typed.
-
Disconnect and return another day
Click
SSH: my-miniin the lower-left corner and choose Close Remote Connection. Next time, connect to the same saved host and reopenmini-project. Your copy ofhello.txtwill be waiting there.See screenshots for this step
View full-size screenshot ↗
Close the connection Click the SSH badge and choose Close Remote Connection. The saved file stays on the mini.