Fix pages / Codex CLI

Codex CLI: "Error: `codex sandbox uninstall` is only supported on Windows"

Error: `codex sandbox uninstall` is only supported on Windows

Tool: 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 --.

Last verified 2026-10-10 (0.161.0, 0.162.0, 0.162.1). Page updated . Also as Markdown and JSON.

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 101

First 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 1

Same 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 1

Fix verified: running commands directly under Linux sandbox succeeds (Codex CLI 0.162.1):

$ codex sandbox echo 'sandbox active' </dev/null
sandbox active
# exit 0

Fix verified: forwarding command with '--' separator succeeds (Codex CLI 0.162.1):

$ codex sandbox -- echo 'forwarded command' </dev/null
forwarded command
# exit 0

Why 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

Sources

Last verified: 2026-10-10.