VS Code and Copilot on a Pi Zero 2 WH via SSHFS
Tutorial · Raspberry Pi · VS Code · SSHFS · ~20 min setup
This week on Talkshow Onpoint, we will be giving away some Raspberry Pi’s and this will be the last show of this season, so enter to Win Mo’ Pi!
The Pi Zero 2 can’t run VS Code — so we mount its filesystem over SSH and let your Mac or Windows machine do all the heavy lifting.
Raspberry Pi OS Lite (64-bit)· macOS & Windows· ~20 min setup
The Raspberry Pi Zero 2 WH packs a quad-core Cortex-A53 and built-in Wi-Fi into a board the size of a stick of gum. But its 512 MB of RAM means running VS Code locally is out of the question — the editor alone would consume most of it before you wrote a single line of code.
The solution is SSHFS (SSH Filesystem). Rather than running anything extra on the Pi, we mount its filesystem over the network onto your Mac or Windows machine. VS Code opens that mount like any local folder — and GitHub Copilot has no idea it’s talking to a tiny ARM board on your desk.
💻 Your machine (VS Code + Copilot) ⟷ 🔒 SSHFS tunnel ⟷ 🍓 Pi Zero 2 WH (only sshd)
The Pi only runs sshd — the standard SSH daemon. Nothing is installed on it beyond the OS. Your editor, Copilot, and all extension processes stay on your fast local machine.
Table of Contents
What you need
Raspberry Pi Zero 2 WH + micro-SD card (16 GB+)
Micro-USB power supply (5V / 1.2A+)
Your Wi-Fi SSID & password (2.4 GHz — the Pi Zero is single-band)
macOS or Windows 10/11 on your dev machine
A GitHub account with Copilot access
Flash Raspberry Pi OS Lite (64-bit)
Open Raspberry Pi Imager. The built-in configuration wizard handles everything headless — no manual SD card editing needed.
Choose device, OS & storage
Choose Device → Raspberry Pi Zero 2 W
Choose OS → Raspberry Pi OS (other) → Raspberry Pi OS Lite (64-bit)
Choose Storage → select your SD card
Configure headless options (⚙️ gear icon)
Click the gear / “Edit Settings” button before writing:
Hostname → e.g.
pizeroEnable SSH → turn on, select Allow public-key authentication only (we’ll add the key next)
Username & password → set something other than the default
Wi-Fi → SSID, password, and your country code
Locale → your timezone
⚠️ The Pi Zero 2 WH only supports 2.4 GHz Wi-Fi. If you have separate 2.4 and 5 GHz SSIDs, make sure you enter the 2.4 GHz one. A 5 GHz network will silently fail.
Click Write and wait for it to finish (~2–3 minutes).
SSH key setup
SSHFS authenticates over SSH, so key-based auth is essential — you don’t want a password prompt interrupting your mount every time. Generate a key on your machine and copy it to the Pi on first boot.
Generate a key (if you don’t have one)
macOSWindows
ssh-keygen -t ed25519 -C "pi-zero"bashBoot the Pi and copy your key
Insert the SD card, connect power, and wait 60–90 seconds for first boot. Then copy your public key over. You’ll need to use password auth just this once.
macOSWindows
ssh-copy-id youruser@pizero.localbashCreate an SSH config alias
This saves you typing the full address every time, and SSHFS will use it too. Add the following to ~/.ssh/config on your machine (create it if it doesn’t exist):
Host pizero
HostName pizero.local
User youruser
IdentityFile ~/.ssh/id_ed25519
ServerAliveInterval 60
ServerAliveCountMax 3ssh configTest that it works before moving on:
ssh pizerobashYou should land at the Pi shell with no password prompt. Type exit to return.
Mount with SSHFS on macOS
macOS needs two things: macFUSE (a kernel extension that lets FUSE filesystems work) and sshfs itself. The easiest way to get both is via Homebrew.
Install macFUSE
macFUSE requires a kernel extension, so it can’t be installed silently via Homebrew alone. Download and run the installer from the official site:
osxfuse.github.io → download the .dmg and run it. You’ll need to approve the system extension in System Settings → Privacy & Security and reboot.
Install sshfs via Homebrew
brew install gromgit/fuse/sshfs-macbashℹ️ The standard brew install sshfs formula was removed from Homebrew core when macFUSE went closed-source. The gromgit/fuse/sshfs-mac tap is the maintained replacement.
Create a mount point and mount the Pi
# Create a local folder to mount into
mkdir -p ~/mnt/pizero
# Mount
sshfs pizero:/home/youruser ~/mnt/pizero -o follow_symlinksbashThe Pi’s home directory is now accessible at ~/mnt/pizero. You can browse it in Finder too — it appears as a network drive.
Unmount when done
umount ~/mnt/pizerobashOptional: mount on login with a shell alias
Add this to your ~/.zshrc or ~/.bashrc for a quick shortcut:
alias mountpi='sshfs pizero:/home/youruser ~/mnt/pizero -o follow_symlinks'
alias umountpi='umount ~/mnt/pizero'bashMount with SSHFS on Windows
Windows needs WinFsp (the Windows equivalent of FUSE) and SSHFS-Win. Both are free and install in minutes.
Install WinFsp
Download the installer from winfsp.dev and run it. Accept defaults.
Install SSHFS-Win
Download from github.com/winfsp/sshfs-win (Releases → latest .msi) and run the installer.
Map the Pi as a network drive
Open File Explorer
Right-click This PC → Map network drive…
Choose a drive letter (e.g.
Z:)In the Folder field enter:
\\sshfs\youruser@pizero.local\home\youruserunc pathCheck Reconnect at sign-in if you want it to persist across reboots
Click Finish — Windows will connect using your SSH key
⚠️ If pizero.local doesn’t resolve, install Bonjour (available standalone from Apple, or bundled with iTunes). Alternatively, use the Pi’s IP address directly in the UNC path.
Or mount from PowerShell
net use Z: \\sshfs\youruser@pizero.local\home\youruserpowershellThe Pi’s home folder now appears as drive Z: in File Explorer and every file dialog.
Open the mount in VS Code
This is the straightforward part — VS Code doesn’t know or care that it’s looking at a mounted SSHFS directory.
macOSWindows
# Open your project folder directly from the terminal
code ~/mnt/pizero/projects/my-projectbashOr use File → Open Folder and navigate to the mount point. Everything works as normal — file tree, search, editing. When you save a file, it’s written directly to the Pi’s SD card over the SSH tunnel.
The integrated terminal connects to the Pi
VS Code’s terminal still runs on your local machine. To get a shell on the Pi, open a separate terminal and SSH in:
ssh pizerobashRun your code there. You can have VS Code editing files on the left and a Pi shell on the right — a clean split between editing and execution.
💡
Keep a terminal tab open with ssh pizero alongside VS Code. Edit in VS Code, switch to the terminal to run. It quickly becomes second nature.
GitHub Copilot
Because VS Code is running entirely on your local machine, Copilot works exactly as it does for any other project — no configuration changes needed.
Install the extension
Open the Extensions panel (
Ctrl+Shift+X/Cmd+Shift+X)Search GitHub Copilot and install it (
GitHub.copilot)Sign in to GitHub when prompted
Optionally install GitHub Copilot Chat for the inline chat panel
Open a .py file in your Pi project and start typing — Copilot’s suggestions appear inline as usual.
💡 Add a comment at the top of your file to give Copilot hardware context:
# Raspberry Pi Zero 2 W — using RPi.GPIO, Python 3.11This steers suggestions toward correct GPIO pin numbers, library calls, and Pi-specific patterns rather than generic Python.
Tips & troubleshooting
Pi-side: free up RAM
Since you’re running headless, the GPU doesn’t need any shared RAM. Add this to /boot/firmware/config.txt:
gpu_mem=16config.txtThen reboot. This recovers ~48 MB for your programs.
Pi-side: install dev tools
sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3-pip python3-venv build-essentialbashIf the mount freezes or disconnects
SSHFS mounts can stall if the Pi goes idle or loses Wi-Fi. The ServerAliveInterval 60 in your SSH config helps, but if it does hang:
macOSWindows
# Force unmount a stale SSHFS mount
diskutil unmount force ~/mnt/pizerobashIf pizero.local doesn’t resolve
Find the Pi’s IP in your router’s admin panel (look for a device named pizero), then use the IP everywhere instead of the hostname. Update your SSH config’s HostName line to the IP address, and consider setting a DHCP reservation in your router so it never changes.
SD card write speed
File saves travel over Wi-Fi to the SD card, so you may notice a slight lag on large saves. Use a quality A2-rated card (e.g. SanDisk Extreme Pro) for noticeably better random write performance.
🔥 Avoid adding swap on the Pi if you can — swap on an SD card causes heavy write cycles and will shorten its life. Keep your Pi-side processes light and let your local machine handle the heavy lifting.
What to build next
With VS Code, Copilot, and a clean SSH connection to the Pi, you’re set up for real work:
🔌 GPIO & sensors
Write and edit your RPi.GPIO code in VS Code with Copilot, run it via the SSH terminal.
🌐 Flask web server
Build a lightweight API on the Pi, access it from your browser on the same network.
📡 MQTT & automation
Connect to Mosquitto and build sensor pipelines or Home Assistant integrations.
🐍 Virtual environments
Use python3 -m venv on the Pi — the venv folder shows up in your mount like any other directory.
Join the show
Watch live every Wednesday at 9 PM ET
We talk tech, Community, Culture and Critical Thinking. Come hang out on YouTube or Twitch.




Amazing, I will be there on Wednesday. gotta win mo pi