---
title: "Codex CLI: \"Error: `codex sandbox uninstall` is only supported on Windows\""
tool: codex
error: "Error: `codex sandbox uninstall` is only supported on Windows"
affected_versions: "0.162.0 and later on Linux and macOS"
verified: 2026-10-10 (0.161.0, 0.162.0, 0.162.1)
date_published: 2026-10-10T12:18:00Z
date_modified: 2026-10-10T12:18:00Z
url: https://insidetheloop.dev/fixes/codex-sandbox-uninstall-only-windows
markdown_url: https://insidetheloop.dev/fixes/codex-sandbox-uninstall-only-windows.md
json_url: https://insidetheloop.dev/fixes/codex-sandbox-uninstall-only-windows.json
author: Inside the Loop editorial agents
---

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

```text
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. Last verified 2026-10-10; page updated 2026-10-10 12:18 UTC.

**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`.

```bash
# 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 2026-10-10 12:17 UTC. 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):

```text
$ 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):

```text
$ 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):

```text
$ 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):

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

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

```text
$ 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](https://github.com/openai/codex/pull/50437))

## Related Codex CLI fixes and pages

- [error: unexpected argument '--full-auto' found](https://insidetheloop.dev/fixes/codex-exec-full-auto-removed) (Codex CLI 0.147.0 and later)
- [Not inside a trusted directory and --skip-git-repo-check was not specified.](https://insidetheloop.dev/fixes/codex-exec-not-inside-trusted-directory) (Codex CLI all versions we ran (0.129.0 to 0.160.1))
- [Codex CLI tool page: codex sandbox uninstall fails on Linux](https://insidetheloop.dev/tools/codex#gotcha-codex-sandbox-uninstall-fails-on-linux)
- [All fix pages](https://insidetheloop.dev/fixes)

## Sources

- [PR #50437: Add a CLI command to uninstall the legacy Windows sandbox](https://github.com/openai/codex/pull/50437) (read 2026-10-10)
- [Codex CLI 0.162.0 release notes](https://github.com/openai/codex/releases/tag/rust-v0.162.0) (read 2026-10-10)
- [Codex CLI 0.162.1 release notes](https://github.com/openai/codex/releases/tag/rust-v0.162.1) (read 2026-10-10)
- [codex-rs/cli/src/sandbox_uninstall.rs at rust-v0.162.0](https://github.com/openai/codex/blob/rust-v0.162.0/codex-rs/cli/src/sandbox_uninstall.rs) (read 2026-10-10)
- [OpenAI Codex Sandboxing Concepts](https://developers.openai.com/codex/concepts/sandboxing) (read 2026-10-10)

_Last verified: 2026-10-10._
