Oct 22, 2026 · @Jim Skon
VS Code on your laptop can edit, compile and run programs that live on the class Linux server. Your files stay on the server, but you work in a normal editor window. Setup takes about 10 minutes the first time.
Before you start
- VS Code installed on your laptop, from code.visualstudio.com.
- Your login: your student username, and your password. It starts out as your student ID; use your new one if you have changed it with
passwd. - The network: the server’s address, 10.192.145.179, works only on the campus network. Off campus, connect to the college VPN first.
- Windows only: Windows 10 and 11 include the
sshprogram VS Code needs. To check, open PowerShell and typessh -V; it should print a version number.
Step 1: Install the Remote – SSH extension
- Open VS Code.
- Click the Extensions icon in the left bar (four squares), or press Ctrl+Shift+X (Windows) or Command+Shift+X (Mac).
- Search for Remote – SSH. Choose the one published by Microsoft and click Install.
When it is installed, a small green or blue >< button appears in the bottom-left corner of the window. You will use it to connect.
Step 2: Connect to the server
- Open the Command Palette: Ctrl+Shift+P (Windows) or Command+Shift+P (Mac).
- Type Remote-SSH: Connect to Host and press Enter.
- The first time, the server is not listed yet. Choose Add New SSH Host, then type the connection with your own username:
ssh yourusername@10.192.145.179
For example, ssh jones1@10.192.145.179.
- When asked which SSH configuration file to update, choose the first one (the one in your user folder).
- Open the Command Palette again, choose Remote-SSH: Connect to Host, and pick 10.192.145.179. A new VS Code window opens.
- If asked for the remote platform, choose Linux.
- If asked whether you trust the host, choose Continue.
- Type your password when asked, and press Enter.
The first connection takes a minute while VS Code installs its helper program on the server. When it finishes, the bottom-left corner reads SSH: 10.192.145.179. Everything you do in this window now happens on the server.
Step 3: Make a folder and open it
Opening a folder lets VS Code show your server files in the Explorer on the left, so you can click between them.
- Open a terminal inside VS Code with Terminal > New Terminal, or press Control+
on Windows and Mac (the backtick key, under Esc). The terminal is a command line on the server, the same one you get withssh`. - Make a folder for this course:
mkdir csds
- Choose File > Open Folder, select csds in your home directory (
/home/yourusername/csds), and click OK. Enter your password again if asked.
The Explorer now lists the contents of csds, and new terminals start inside it. Next time, File > Open Recent reopens it directly.
Step 4: Write, compile and run C++
- In the Explorer, hover over CSDS and click the New File icon, or choose File > New File. Name it
main.cpp. - Type this program and save it with Ctrl+S (Windows) or Command+S (Mac):
#include <iostream>
using namespace std;
int main() {
cout << "Hello from VS Code on Linux!" << endl;
return 0;
}- In the terminal, compile and run it:
g++ -Wall -o app main.cpp ./app
You should see Hello from VS Code on Linux!. The -Wall option turns on warnings, which catch many mistakes before you run the program. If the compiler reports an error, it gives the file and line number, such as main.cpp:5:5; fix that line, save, and compile again.
Add C++ support on the server. VS Code may suggest installing the C/C++ extension (by Microsoft) when you open main.cpp. Accept it, or install it from the Extensions view, where it shows an Install in SSH: 10.192.145.179 button. It adds error underlining, autocomplete and the debugger. Extensions for remote work are installed on the server, so you only do this once.
Everything you save is stored on the server, in your home directory. You can also use the Source Control view for Git, exactly as you would on your laptop.
Optional: Log in without a password
VS Code asks for your password every time it connects, and sometimes again when you open a folder. An SSH key removes that. You make a pair of keys on your laptop: a private key that never leaves it, and a public key that you copy to the server. Do this once per laptop, in a terminal on your laptop (not the server).
1. Make a key. On a Mac, use the Terminal app; on Windows, use PowerShell:
ssh-keygen -t ed25519
Press Enter to accept the default file location. It then asks for a passphrase: press Enter twice for none, or choose one to protect the key.
2. Copy the public key to the server. Type your server password one last time when asked.
Mac or Linux:
ssh-copy-id yourusername@10.192.145.179
Windows (PowerShell, all on one line):
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh yourusername@10.192.145.179 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
3. Test it. Run ssh yourusername@10.192.145.179. If it logs you in without asking for a password, VS Code will connect without one too. Type exit to leave.
Troubleshooting
| Problem | What to try |
|---|---|
| Connection times out | You are probably off the campus network. Connect to the college VPN and try again. |
| Permission denied | Check the username in the host you added, then retype the password slowly. Remember it is your new password if you changed it. |
| It keeps asking for the password | Normal without an SSH key. Set one up as described above. |
| “Could not establish connection” after it worked before | Open the Command Palette, run Remote-SSH: Kill VS Code Server on Host, and connect again. |
./app: No such file or directory | The compile failed or you are in a different folder. Run ls to see what is there, and compile again. |
g++ prints errors | Read the first error first; later ones are often caused by it. Fix that line, save, and recompile. |
Still stuck? Bring your laptop to the next class, or email your instructor with a screenshot of the error.
