Codex CLI: "Error: `codex sandbox uninstall` is only supported on Windows"
Error: `codex sandbox uninstall` is only supported on WindowsTool: OpenAI Codex CLI (codex). Versions: Affected: 0.162.0 and later on Linux and macOS; last version without this error: 0.161.0; we reproduced it on 0.161.0, 0.162.0, 0.162.1. Exit code 1.
Cause: Codex CLI 0.162.0 added codex sandbox uninstall exclusively to clean up machine-wide accounts and network rules created by the legacy Windows sandbox, and explicitly rejects the command on other platforms.
Fix: Do not run codex sandbox uninstall on Linux or macOS; use codex sandbox <COMMAND> or -- if running an executable named uninstall.
# Linux and macOS require no uninstallation or reset: sandboxes are ephemeral
# run commands inside the Linux sandbox directly
codex sandbox <command>
# if executing an external binary literally named 'uninstall', pass '--' first
codex sandbox -- uninstall [args]On Linux and macOS, Codex creates ephemeral sandboxes on the fly using bubblewrap and macOS Seatbelt respectively without persistent machine-wide user accounts or network rules. The codex sandbox uninstall command exists solely for Windows administrator cleanup of legacy sandbox accounts and network rules. To forward commands to the sandbox without CLI subcommand collision, prefix them with --.
How did we reproduce the Codex CLI error?
A fresh Debian 13 VM from bin/sandbox-run (Node.js 24, root, online, no credentials for any service), destroyed after the run. Run on . Failing command: codex sandbox uninstall </dev/null.
Before 0.162.0: treated as running a command named 'uninstall' inside the sandbox (Codex CLI 0.161.0):
$ codex sandbox uninstall </dev/null
thread 'main' (2) panicked at linux-sandbox/src/linux_run_main.rs:1598:5:
Failed to execvp uninstall: No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
# exit 101First bad release: rejected on non-Windows platforms (Codex CLI 0.162.0):
$ codex sandbox uninstall </dev/null
Error: `codex sandbox uninstall` is only supported on Windows
# exit 1Same in latest stable release 0.162.1 (Codex CLI 0.162.1):
$ codex sandbox uninstall </dev/null
Error: `codex sandbox uninstall` is only supported on Windows
# exit 1Fix verified: running commands directly under Linux sandbox succeeds (Codex CLI 0.162.1):
$ codex sandbox echo 'sandbox active' </dev/null
sandbox active
# exit 0Fix verified: forwarding command with '--' separator succeeds (Codex CLI 0.162.1):
$ codex sandbox -- echo 'forwarded command' </dev/null
forwarded command
# exit 0Why does Codex CLI print this error?
Pull request #50437 (merged 2026-10-02, shipped in 0.162.0) added codex sandbox uninstall to remove machine-wide legacy Windows sandbox accounts and network rules with administrator privileges. In codex-rs/cli/src/sandbox_uninstall.rs, SandboxUninstallCommand::run conditionally compiles clean_up_legacy_windows_sandbox() on Windows and bails with "codex sandbox uninstall is only supported on Windows" on all other operating systems. (openai/codex PR #50437)
Related Codex CLI fixes and pages
error: unexpected argument '--full-auto' found(Codex CLI 0.147.0 and later)Not inside a trusted directory and --skip-git-repo-check was not specified.(Codex CLI all versions we ran (0.129.0 to 0.160.1))- Codex CLI tool page: codex sandbox uninstall fails on Linux
- All fix pages
Sources
- PR #50437: Add a CLI command to uninstall the legacy Windows sandbox (read 2026-10-10)
- Codex CLI 0.162.0 release notes (read 2026-10-10)
- Codex CLI 0.162.1 release notes (read 2026-10-10)
- codex-rs/cli/src/sandbox_uninstall.rs at rust-v0.162.0 (read 2026-10-10)
- OpenAI Codex Sandboxing Concepts (read 2026-10-10)
Last verified: 2026-10-10.