mount-pi is a small macOS helper script for mounting Raspberry Pi project directories over SSHFS using macFUSE. It is intended for workflows where local tools such as VS Code or Codex need file-level access to a remote Pi checkout, while builds and tests still run on the Pi.
The script uses SSH aliases from ~/.ssh/config, so user names, hostnames, ports, keys, and host-key behavior stay in your normal SSH configuration.
mount-pi can:
- Mount a remote Pi directory under
$HOME/mnt/<name> - Open the mounted directory in VS Code
- Unmount one configured mount by name
- Unmount a specific mount path
- Force-unmount all SSHFS-style mounts under
$HOME/mnt - List current mounts under
$HOME/mnt
- macOS
- Homebrew
- macFUSE
- SSHFS for macOS
- VS Code command-line launcher,
code - SSH access to the remote Pi
macFUSE provides the filesystem layer used by SSHFS on macOS. Installing the macFUSE package lets third-party FUSE filesystems run on macOS, but the filesystem implementation, such as SSHFS, must be installed separately. macFUSE also notes that newer macFUSE releases are moving toward FSKit support on macOS 26, but existing SSHFS workflows may still require the traditional macFUSE setup path. (macFUSE)
Install macFUSE:
brew install --cask macfuseInstall SSHFS for macOS:
brew install gromgit/fuse/sshfs-macHomebrew’s core sshfs formula currently lists bottle support for Linux, not macOS, so the gromgit/fuse/sshfs-mac tap is commonly used for macOS SSHFS installs. (Homebrew Formulae)
On Apple Silicon Macs, macFUSE may require enabling user-managed kernel extensions before the macFUSE extension can load. Apple documents this under Startup Security Utility as Reduced Security with Allow user management of kernel extensions from identified developers. (Apple Support)
The macFUSE getting-started instructions describe the same flow: select Reduced Security, enable Allow user management of kernel extensions from identified developers, approve the change, and restart the Mac. (GitHub)
Typical sequence:
- Install macFUSE.
- If macOS blocks the system extension, shut down or reboot as prompted.
- Boot into Recovery:
- Shut down the Mac.
- Press and hold the power button until startup options appear.
- Choose Options.
- Open Startup Security Utility.
- Select the startup disk.
- Choose Security Policy.
- Select Reduced Security.
- Enable Allow user management of kernel extensions from identified developers.
- Restart macOS.
- After logging in, open System Settings → Privacy & Security.
- Approve the macFUSE system extension if macOS presents an Allow button.
- Restart again if prompted.
Do not skip the reboot steps. macFUSE may install successfully but fail to mount filesystems until the security policy and extension approval have fully taken effect.
Save the script as:
$HOME/bin/mount-piMake it executable:
chmod +x "$HOME/bin/mount-pi"Make sure $HOME/bin is on your PATH. For zsh:
echo 'export PATH="$HOME/bin:$PATH"' >> "$HOME/.zshrc"
source "$HOME/.zshrc"Add an alias to ~/.ssh/config:
Host pi
HostName pi.local
User pi
IdentityFile ~/.ssh/id_ed25519
StrictHostKeyChecking accept-new
ServerAliveInterval 15
ServerAliveCountMax 2Test normal SSH first:
ssh piThe script expects the alias to work before it attempts an SSHFS mount.
Mount the default remote path:
mount-pi piThis mounts:
pi:/home/pi
at:
$HOME/mnt/pi
and then opens that path in VS Code.
Mount a different remote path:
mount-pi pi /home/piMount a remote path using a custom local mount name:
mount-pi pi /home/pi pi-devThis mounts at:
$HOME/mnt/pi-dev
List current mounts under $HOME/mnt:
mount-pi --listUnmount by mount name:
mount-pi --unmount piUnmount by explicit path:
mount-pi --unmount-path ~/mnt/piUnmount all mounts under $HOME/mnt:
mount-pi --unmount-allShow help:
mount-pi --helpUse the mounted path for editing:
code "$HOME/mnt/pi"The script uses a conservative SSHFS option set intended for editor and Codex-style access:
-oServerAliveInterval=15
-oServerAliveCountMax=2
-oTCPKeepAlive=yes
-oConnectTimeout=10
-oreconnect
-oauto_cache
-ocache_timeout=2
-ocache_stat_timeout=2
-ocache_dir_timeout=2
-ocache_link_timeout=2
-oworkaround=rename
-odefer_permissionsThe short cache timeouts reduce stale directory and file metadata without turning caching off completely. reconnect helps SSHFS recover from transient network interruptions. workaround=rename helps with editor save patterns that write temporary files and then rename them over the original.
Install SSHFS:
brew install gromgit/fuse/sshfs-macThen check:
which sshfs
sshfs --versionRevisit the Apple Silicon security steps. You may need to approve the macFUSE extension in System Settings → Privacy & Security and reboot. On Apple Silicon, kernel-extension policy changes require Recovery-mode security changes and a restart. (Apple Support)
Force-unmount and re-mount:
mount-pi --unmount pi
mount-pi piOr unmount by path:
mount-pi --unmount-path ~/mnt/piIf necessary, use the all-mount cleanup:
mount-pi --unmount-allConnect once with normal SSH and resolve the host-key prompt:
ssh piThen re-run the mount.
Verify your SSH alias:
ssh piCheck the User, IdentityFile, and HostName entries in ~/.ssh/config.
Install the VS Code shell command from VS Code:
- Open VS Code.
- Press
Command+Shift+P. - Run Shell Command: Install 'code' command in PATH.
- Try again:
code "$HOME/mnt/pi"