Remote Environments & VS Code
SSH, VS Code Remote, WSL, and Codespaces — working where the tools live
Why this lesson exists
Here’s the reality: most LLM CLI tools run best in a Linux environment. But most of you aren’t sitting in front of a Linux computer. You’re on a Mac laptop, a Windows machine, a university lab workstation, or a government-issued device.
That’s fine. You have several ways to get to a Linux shell, and this lesson covers all of them. By the end, you’ll have a working environment — and a mental model for understanding where your commands actually run.
The mental model: Local vs Remote
Before we set up anything, internalize this:
| Concept | What it means | Example |
|---|---|---|
| Local | Commands run on the computer in front of you | Your laptop |
| WSL | A Linux system running inside Windows | Ubuntu on your Windows machine |
| Remote (SSH) | Commands run on a server somewhere else | A university cluster, cloud VM, or work server |
The key insight: when you type a command, it runs wherever your terminal is connected to — not necessarily on the machine you’re looking at. If you’re SSH’d into a server, ls shows files on that server, not your laptop.
This is why the “Where Am I?” check matters:
whoami # What user?hostname # What machine?pwd # What directory?Run these whenever you’re unsure. It takes 2 seconds and prevents real confusion.
Option 1: VS Code — The recommended cockpit
VS Code (Visual Studio Code) is a code editor that gives you a file explorer, a built-in terminal, and the ability to connect to remote machines — all in one window. It’s the single best tool for this course, regardless of your background.
Why VS Code?
- See your files AND type commands in the same window
- Works on Mac, Windows, and Linux
- Connect to remote servers with the Remote SSH extension — edit files on a server as if they were local
- Built-in terminal that matches your environment (WSL on Windows, bash on Mac/Linux)
- Port forwarding happens automatically — when you run a web server remotely, VS Code lets you view it in your local browser
Install VS Code
- Go to code.visualstudio.com
- Download for your OS and install
- Open it — you’ll see a welcome tab
Open the integrated terminal
Press Ctrl+` (backtick) or go to View → Terminal. A terminal panel appears at the bottom. This is where you’ll type all your commands.
On Windows with WSL: VS Code automatically detects WSL. In the terminal dropdown (the + icon), select Ubuntu (WSL) or set it as your default terminal profile in settings.
Open VS Code Settings (Ctrl+,), search for terminal default profile windows, and set it to Ubuntu (WSL). Now every new terminal in VS Code opens in Linux.
Option 2: SSH — Connecting to a remote server
If your instructor has given you access to a remote Linux server (university cluster, cloud VM, training environment), you connect to it using SSH.
Connecting from your terminal
ssh yourname@server.example.eduYou’ll be asked for your password (or it’ll use your SSH key if configured). Once connected, you’re now running commands on that remote machine.
Connecting from VS Code (recommended)
- Install the Remote - SSH extension in VS Code (search “Remote SSH” in the Extensions panel)
- Press Ctrl+Shift+P → type “Remote-SSH: Connect to Host”
- Enter
yourname@server.example.edu - VS Code opens a new window connected to the remote server
- Open a folder, open the terminal — you’re working on the server with the full VS Code experience
When you’re connected via VS Code Remote SSH and start a web server (like python -m http.server 8000 or npm run dev), VS Code automatically detects it and offers to forward the port. You can then open localhost:8000 in your local browser to see the output. No extra setup needed.
SSH without VS Code
If VS Code isn’t available, you can SSH from any terminal:
ssh yourname@server.example.eduTo view web content you generate on the server, use port forwarding:
ssh -L 8080:localhost:8080 yourname@server.example.eduThis maps port 8080 on the server to port 8080 on your laptop. Start a web server on the remote machine, then open localhost:8080 in your local browser.
Keep your session alive
If you close your laptop or lose network, your SSH session dies and any running process stops. Two solutions:
- tmux — a terminal multiplexer that keeps your session alive:
Terminal window tmux # Start a new session# ... do your work ...# Press Ctrl+B, then D to detachtmux attach # Reconnect later - VS Code Remote — reconnects automatically when your network comes back
Option 3: GitHub Codespaces — Zero install
If you can’t install anything on your machine (locked-down work computer, university lab, or you just want the fastest start), GitHub Codespaces gives you a full Linux development environment in your browser.
What it is
A cloud-hosted VS Code environment with a terminal, file explorer, and pre-installed tools. You get a real Linux shell with full internet access — no local installation needed.
How to use it
- Go to github.com/codespaces
- Click “New codespace”
- Choose a blank template or your instructor’s template repository
- Wait ~30 seconds — a full VS Code opens in your browser
You now have a Linux terminal at the bottom. Install tools exactly as you would on any Linux machine:
node --version # Node.js is pre-installednpm --version # npm too- Requires a GitHub account
- 60 hours/month of compute on the default plan (plenty for training)
- Network: some university or corporate networks block github.com — check with your instructor
- Data persistence: files persist in your codespace, but codespaces auto-delete after 30 days of inactivity. Push your work to a git repo to save it permanently.
Option 4: WSL (already set up)
If you followed the Windows instructions in Lesson 2, you already have WSL. You can:
- Open Ubuntu from the Start menu
- Type
wslin any terminal - Use the Ubuntu profile in Windows Terminal
- Set WSL as your default terminal in VS Code
WSL is a real Linux environment. Every command in this course works natively.
Which option should I use?
| Situation | Recommended setup |
|---|---|
| Mac laptop | VS Code + built-in terminal (you’re already on Unix) |
| Windows with admin rights | WSL2 + VS Code (set WSL as default terminal) |
| Windows without admin rights | GitHub Codespaces or SSH to a provided server |
| University lab computer | SSH into your university’s Linux server + VS Code Remote |
| Government-issued machine | Ask your IT about approved dev environments; SSH or Codespaces if available |
| Any machine, fastest start | GitHub Codespaces (browser-based, nothing to install) |
The clipboard problem
Copying and pasting between your local machine and a remote terminal can be tricky:
| Terminal | How to paste |
|---|---|
| VS Code integrated terminal | Ctrl+V (just works) |
| Windows Terminal (WSL/SSH) | Ctrl+Shift+V or right-click |
| macOS Terminal | Cmd+V |
| PuTTY / traditional SSH clients | Right-click to paste |
| tmux | Ctrl+B then ] to enter copy mode |
API key tip: When pasting API keys into a terminal prompt that hides input (like a password field), you won’t see anything appear. That’s normal — it’s hiding the text for security. Just paste and press Enter.
Preflight checklist
Before moving on, confirm these work in your environment:
whoami # Shows your usernamehostname # Shows your machine nameecho "Hello!" # Prints textls # Lists filespwd # Shows current directoryIf all five work, your environment is ready. Let’s keep building.