I wanted to use VS Code on my Linux or macOS machine to work on a remote FreeBSD box. The open-source VS Code build already works on FreeBSD, but I wasn’t trying to move my laptop or desktop OS to FreeBSD (yet).
For projects like Sylve, my usual setup was NFS or SSHFS. And honestly? It was painful. With several language servers running, some files could take 5–10 minutes just to open. NFS was a bit more tolerable, but the permission issues weren’t helping.
Then I tried VS Code’s Remote SSH extension on OpenWRT which is anothe niche platform I constantly work on. It’s musl-based and not an officially supported environment, so I wasn’t expecting much.
It worked out of the box. And it was fast. No hacks, no drama. Just editing files on the device as if they were local.
Naturally, I tried my FreeBSD box next. VS Code stopped me with:
Unsupported platform: FreeBSD
Let the Linuxulator handle it
Fair enough. But before giving up, I found vscode-server-freebsd. It runs VS Code’s Linux server through FreeBSD’s Linuxulator.
The setup was almost laughably simple. I’d already done most of it while configuring FreeBSD: enable the Linuxulator and install a Rocky Linux 9 userland.
service linux enable # This enables the Linuxulator emulation layer
service linux start
pkg install linux_base-rl9 # Install a Linux base system (Rocky 9 in this case)
Keep the Linux bits separate
I didn’t want the Linux PATH leaking into my normal FreeBSD shell. So I left the global environment and .zshrc alone, and put it in ~/.bash_linux:
PATH="/compat/linux/usr/local/sbin:/compat/linux/usr/local/bin:/compat/linux/usr/sbin:/compat/linux/usr/bin:/compat/linux/sbin:/compat/linux/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
This file only needs to be sourced for the VS Code connection. I told sshd to accept BASH_ENV:
sysrc sshd_flags="-o AcceptEnv=BASH_ENV"
Then sent it from the client’s SSH config:
SetEnv BASH_ENV=".bash_linux"
My full config on the macOS client looked like this:
Host sylve-code
Hostname 192.168.72.172
SetEnv BASH_ENV=".bash_linux"
User root
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
ServerAliveInterval 60
ServerAliveCountMax 3
RemoteCommand /compat/linux/bin/bash
The RemoteCommand starts Linux Bash, and BASH_ENV loads the session-specific PATH. That’s it. My normal FreeBSD shell stays untouched.
And then… it just worked
Honestly, I expected extensions to break or language servers to crash. Something had to go wrong, right?
They worked fine. Rollup’s native binary was the one exception for my FreeBSD setup, but it has a WASM build. So I tried an npm override:
{
"overrides": {
"rollup": "npm:@rollup/wasm-node@^4.30.1"
}
}
Problem solved.
The result was fast remote development on FreeBSD, with Linux binaries running transparently through the Linuxulator and none of the SSHFS/NFS headaches. I’m seriously impressed with how well it implements Linux ABI compatibility. My editor, extensions, and language servers just work.
It removed a real blocker from my workflow. And yes, it genuinely feels like magic.