Shipping an AI app or agent? Security review in 1 working day: $149 / ₹13,900. Request a review →
AI Review Ready
Home / Error fixes / Codex on Windows
Fix · Codex · Windows

Codex not working on Windows: the fixes

Fix: install from PowerShell with powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex", then run codex in PowerShell or Windows Terminal. If Codex starts but the commands it runs fail, look at the Windows sandbox first; its log is CODEX_HOME\.sandbox\sandbox.log.

Fix it

  1. Check the Windows version (winver). Windows 11 is recommended. A fully updated Windows 10 is "best effort" and must be version 1809 or newer, because Codex needs the modern console (ConPTY). Older Windows 10 builds are not recommended.
  2. Install from PowerShell, not Command Prompt: the one-line installer above, or npm install -g @openai/codex. The irm line is PowerShell syntax; in CMD it fails with 'irm' is not recognized (why).
  3. Make sure winget exists. OpenAI's Windows page assumes it; if it's missing, update Windows or install the Windows Package Manager.
  4. Inside Codex, run /status and /debug-config to see the active sandbox, permission profile and loaded config.
  5. Match the failure below. Most Windows-only problems are sandbox setup or permissions.

Sandbox errors

You seeCauseFix
The elevated sandbox setup failsThe UAC prompt was declined, or the machine blocks local user/group creation, firewall rule changes or the logon rights the sandbox users needRun setup again and approve the admin prompt; on a company laptop, ask IT. If policy allows, use unelevated meanwhile
Windows error 1385The sandbox users exist, but Windows policy denies them the logon type they need to start commandsIT grants the logon rights; compare group policy if only some machines fail; unelevated as a stopgap
Warning that folders are writable by EveryoneFolder permissions too broad for the sandbox to protectRemove Everyone write access where appropriate, then restart Codex or re-run setup
Commands can't reach the networkSome permission modes run with outbound network off on purposeCheck the mode; if network was expected, restart Codex; if it repeats, keep the sandbox log
Sandbox worked, then stoppedMoved repo, changed permissions or Windows policiesRestart Codex; re-run the MXC probe or the elevated setup
Codex says it switched you to unelevatedElevated setup wasn't availableFine short term (weaker network isolation, no denied read paths); IT can provision elevated

Pick the sandbox implementation

Codex has three on Windows: mxc (recommended where supported, no admin setup), elevated (preferred fallback, needs admin-approved setup) and unelevated (last resort). In config.toml:

[features]
prefer_mxc = true

[windows]
sandbox = "elevated"   # fallback when MXC isn't available; or "unelevated"

MXC needs Windows 11 24H2 (build 26100.9278) or 25H2 (build 26200.9278) with the capability rolled out. Test it on one command without changing your saved choice (Codex CLI 0.162.0+):

codex -c windows.sandbox=mxc sandbox --include-managed-config --permission-profile :workspace -- cmd.exe /d /c echo MXC_OK
$LASTEXITCODE

Expect MXC_OK and 0. Employees without admin rights can have IT provision the elevated sandbox for them with codex sandbox setup --elevated --user 'DOMAIN\name' --codex-home '<their CODEX_HOME>'.

Codex in WSL instead

  • WSL2 only: Codex 0.115 moved its Linux sandbox to bubblewrap, and WSL1 stopped working after 0.114.
  • Install inside the Linux shell (curl -fsSL https://chatgpt.com/codex/install.sh | sh); the Windows install isn't visible there. which codex confirms it's on the WSL PATH.
  • Keep repositories under ~/, not /mnt/c/...: Windows-mounted paths are slower and cause symlink and permission problems. If WSL still feels slow, run wsl --update then wsl --shutdown.

The VS Code extension is installed but does nothing

OpenAI's Windows page lists missing C++ build tools as a cause. Install the Visual Studio Build Tools C++ workload and the Microsoft Visual C++ Redistributable (x64), for example winget install --id Microsoft.VisualStudio.2022.BuildTools -e, then fully restart VS Code.

Still failing?

  • Send OpenAI CODEX_HOME\.sandbox\sandbox.log with: what you were doing, the sandbox implementation, the exact error, whether you saw 1385, your Windows build and whether it's Windows 10 or 11. Never send the .sandbox-secrets folder.
  • stdin is not a terminal from a script or pipe is a different problem: use codex exec.
  • Codex exits at start with a config message: Error loading config.toml.

Running Claude Code, Codex or Cursor on real repos, or shipping an AI agent? A Quick Review ($149 / ₹13,900, 1 working day) checks one repo, config or setup for leaked keys, risky agent permissions and MCP servers. Request a Quick Review

FAQ

Does Codex need WSL on Windows?

No. OpenAI's docs say Codex runs natively in PowerShell with a Windows sandbox. WSL2 is the option when you need Linux tooling or already work in WSL2.

Does Codex work on Windows 10?

Best effort only: it needs a fully updated Windows 10, version 1809 or newer, for ConPTY. Windows 11 is the recommended baseline.

What is Windows error 1385 in Codex?

Windows is denying the logon type the sandbox users need to start commands. It is a device policy issue for IT; the unelevated sandbox works as a stopgap.

Does Codex support WSL1?

No. WSL1 was supported through Codex 0.114; from 0.115 the Linux sandbox uses bubblewrap, which needs WSL2.

Related errors

Sources

Read 30 Nov 2026. These tools change often: if a step no longer matches, the linked page wins.

Related free tools