Users can now run the Zed editor's remote development server on FreeBSD by leveraging the system's Linux compatibility layer and a specific kernel patch to fix a directory reading error. This workaround addresses a limitation where Zed's remote server fails to recognize FreeBSD as a supported platform, resulting in empty project trees or 'Invalid argument' errors.
Spoofing the Host Platform
Because Zed does not currently offer a native FreeBSD remote server, users can utilize the Linux binary provided by the Zed team. This requires enabling Linux compatibility on the FreeBSD host and using a wrapper script to intercept the `uname` command.
The wrapper script identifies the platform as 'Linux x86_64' while passing all other arguments to the real `uname` utility. This 'small lie' allows Zed to successfully initiate a connection and upload the Linux server binary to the host.

This script allows the Zed editor to believe it is running on a Linux host, enabling the use of the official Linux remote server binary on FreeBSD.
“It’s a small lie, but a contained one, and the part I’d love to retire.”
— Lying to Zed to get its remote server running on FreeBSD | Hayzam
The 768-Byte Buffer Regression
Even with the platform spoofed, users may encounter an 'Invalid argument (os error 22)' error when trying to view project files. This is caused by a regression in the FreeBSD kernel's Linux emulation layer (Linuxulator) that affects how directory entries are sized.
In layman's terms, Zed requests a batch of file names, but the Linuxulator rounds up the size of these batches to 512-byte blocks. If the total size exceeds the 768-byte buffer allocated by the caller, the emulation layer returns an error, causing Zed to report the folder as empty.
Chart drawn by HN Digest from figures reported by hayzam.com; values are shown as written in the source.
Kernel Fix and Implementation
The issue is resolved by applying kernel patch ec6629628cb, which was merged into the FreeBSD 15.2-RELEASE branch. This patch ensures that if a requested count is smaller than the standard 512-byte block, the read size is rounded up correctly without exceeding the maximum buffer size.

The patch ensures that directory read sizes are correctly rounded and capped to prevent 'os error 22' failures during file system access.
For those seeking a native experience, the `editors/zed` port also builds a remote server, but it may lag behind the official releases. The Linux-based route is generally preferred for staying current with the editor's latest features.
What Hacker News readers are saying
- Alternative: One commenter suggested that remote editing can be achieved without a specialized server by simply using SSH, noting that this method is often sufficient for many users. comment ↗
- Open question: Another user questioned why the remote server cannot be compiled natively for FreeBSD, noting that the editor itself only faces minor issues with audio calls. comment ↗
Summarized opinions from the Hacker News thread, not verified facts. Read the full discussion ↗