Foundations Module 3 · Command Line Basics

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:

ConceptWhat it meansExample
LocalCommands run on the computer in front of youYour laptop
WSLA Linux system running inside WindowsUbuntu on your Windows machine
Remote (SSH)Commands run on a server somewhere elseA 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:

Terminal window
whoami # What user?
hostname # What machine?
pwd # What directory?

Run these whenever you’re unsure. It takes 2 seconds and prevents real confusion.

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

  1. Go to code.visualstudio.com
  2. Download for your OS and install
  3. 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.

💡Set WSL as your default terminal in VS Code

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

Terminal window
ssh yourname@server.example.edu

You’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.

  1. Install the Remote - SSH extension in VS Code (search “Remote SSH” in the Extensions panel)
  2. Press Ctrl+Shift+P → type “Remote-SSH: Connect to Host”
  3. Enter yourname@server.example.edu
  4. VS Code opens a new window connected to the remote server
  5. Open a folder, open the terminal — you’re working on the server with the full VS Code experience
Port forwarding is automatic

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:

Terminal window
ssh yourname@server.example.edu

To view web content you generate on the server, use port forwarding:

Terminal window
ssh -L 8080:localhost:8080 yourname@server.example.edu

This 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 detach
    tmux 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

  1. Go to github.com/codespaces
  2. Click “New codespace”
  3. Choose a blank template or your instructor’s template repository
  4. 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:

Terminal window
node --version # Node.js is pre-installed
npm --version # npm too
Codespaces limitations
  • 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 wsl in 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?

SituationRecommended setup
Mac laptopVS Code + built-in terminal (you’re already on Unix)
Windows with admin rightsWSL2 + VS Code (set WSL as default terminal)
Windows without admin rightsGitHub Codespaces or SSH to a provided server
University lab computerSSH into your university’s Linux server + VS Code Remote
Government-issued machineAsk your IT about approved dev environments; SSH or Codespaces if available
Any machine, fastest startGitHub Codespaces (browser-based, nothing to install)

The clipboard problem

Copying and pasting between your local machine and a remote terminal can be tricky:

TerminalHow to paste
VS Code integrated terminalCtrl+V (just works)
Windows Terminal (WSL/SSH)Ctrl+Shift+V or right-click
macOS TerminalCmd+V
PuTTY / traditional SSH clientsRight-click to paste
tmuxCtrl+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:

Terminal window
whoami # Shows your username
hostname # Shows your machine name
echo "Hello!" # Prints text
ls # Lists files
pwd # Shows current directory

If all five work, your environment is ready. Let’s keep building.