Support FreeBSD
Open 💬 10 comments Opened Mar 6, 2026 by mykola2312
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
0.111.0
What subscription do you have?
Plus
What platform is your computer?
FreeBSD 15.0-RELEASE-p2 amd64 amd64
What issue are you seeing?
In past codex cli was working fine, I've installed it from NPM. After update, it throws error about unsupported platform.
The change was introduced there https://github.com/openai/codex/commit/c19969c67609d5233293af649e7d061f7059620a
What steps can reproduce the bug?
install codex with npm on latest freebsd
What is the expected behavior?
working as in previous versions
Additional information
_No response_
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Hi, I also noticed the Problem that Codex CLI npm package explicitly blocks FreeBSD:
[clawdie@osa ~/codex]$ codex --version
codex-cli 0.111.0
[clawdie@osa ~/codex]$ codex
Error: Invalid argument (os error 22)
// codex.js - platform mapping
const PLATFORM_PACKAGE_BY_TARGET = {
"x86_64-unknown-linux-musl": "@openai/codex-linux-x64",
"aarch64-unknown-linux-musl": "@openai/codex-linux-arm64",
"x86_64-apple-darwin": "@openai/codex-darwin-x64",
"aarch64-apple-darwin": "@openai/codex-darwin-arm64",
"x86_64-pc-windows-msvc": "@openai/codex-win32-x64",
"aarch64-pc-windows-msvc": "@openai/codex-win32-arm64",
};
// FreeBSD not listed → throws "Unsupported platform: freebsd (x64)"
Workaround I tried is to Enable Linuxulator:
shell
1. Enable Linux compatibility at boot
sysrc linux_enable="YES"
2. Start Linuxulator
service linux start
3. Install Rocky Linux 9 base
pkg install linux_base-rl9
4. Mount required Linux filesystems
mount -t linprocfs linprocfs /compat/linux/proc
mount -t linsysfs linsysfs /compat/linux/sys
mount -t devfs devfs /compat/linux/dev
mount -t fdescfs -o linrdlnk fdescfs /compat/linux/dev/fd
mount -t tmpfs tmpfs /compat/linux/dev/shm
5. Add to /etc/fstab for persistence
cat >> /etc/fstab << 'EOF'
linprocfs /compat/linux/proc linprocfs rw 0 0
linsysfs /compat/linux/sys linsysfs rw 0 0
devfs /compat/linux/dev devfs rw 0 0
fdescfs /compat/linux/dev/fd fdescfs rw,linrdlnk 0 0
tmpfs /compat/linux/dev/shm tmpfs rw,mode=1777 0 0
EOF
6. Download and run Codex Linux binary
mkdir -p ~/codex && cd ~/codex
fetch https://github.com/openai/codex/releases/latest/download/codex-x86_64-unknown-linux-musl.tar.gz
tar -xzf codex-x86_64-unknown-linux-musl.tar.gz
./codex-x86_64-unknown-linux-musl
I tried both precompiled versions:
[clawdie@osa ~/codex]$ ls -alh
total 280 MB
drwxr-xr-x 2 clawdie clawdie 7B Mar 6 23:30 .
drwxr-xr-x 14 clawdie clawdie 29B Mar 7 07:18 ..
lrwxr-xr-x 1 clawdie clawdie 31B Mar 6 23:30 codex -> codex-x86_64-unknown-linux-musl
-rwxr-xr-x 1 clawdie clawdie 98M Mar 5 18:26 codex-x86_64-unknown-linux-gnu
-rw-r--r-- 1 clawdie clawdie 38M Mar 5 19:12 codex-x86_64-unknown-linux-gnu.tar.gz
-rwxr-xr-x 1 clawdie clawdie 102M Mar 5 18:30 codex-x86_64-unknown-linux-musl
-rw-r--r-- 1 clawdie clawdie 40M Mar 5 19:12 codex-x86_64-unknown-linux-musl.tar.gz
I canceled my subscription to Codex. This is OS based "discrimination"
Being able to use Codex on FreeBSD is a huge item on my wish list. Is there anything holding this back?
so this does not work?
https://www.freshports.org/misc/codex
It works, but:
╭───────────────────────────────────────────────────────────────╮
│ ✨ Update available! 0.117.0 -> 0.128.0 │
│ See https://github.com/openai/codex for installation options. │
│ │
│ See full release notes: │
│ https://github.com/openai/codex/releases/latest │
╰───────────────────────────────────────────────────────────────╯
╭────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.117.0) │
│ │
│ model: gpt-5.4 high /model to change │
│ directory: ~/clawdie-iso │
╰────────────────────────────────────────────╯
Tip: Update Required - This version will no longer be supported starting May 8th. Please upgrade to the latest version (https://github.com/openai/codex/releases/latest)
using your preferred package manager.
Also i can't select 5.5 model
You need to switch to pkg latest branch.
I was actually thinking about sandbox support. Unfortunately, even though jail/cap is extremely powerful, they cannot provide rootless userspace overlay similar to bubblewrap.
FreeBSD 13: codex --version
codex-cli 0.144.1
/model
codex-0.144-freebsd-build-manual-en.md
codex-0.144-freebsd-build-manual_ua.md
Yeah I've been trying to think of a good way to sandbox without root too @SchrodingerZhu. The only thing I have thought of so far is making a tiny SUID wrapper that jails codex to a context you define. I don't think capsicum is actually that helpful for the cases I've thought of so far. Not great...
On OpenBSD the story is a bit better ironically since you can restrict some syscalls with pledge and the FS with unveil without root access.
Btw in case anyone else finds this, there is a reasonably up to date codex in the ports tree and it works pretty well except for the fact that it's effectively unsandboxed. Take appropriate precautions.