Fix it
- 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. - Install from PowerShell, not Command Prompt: the one-line installer above, or
npm install -g @openai/codex. Theirmline is PowerShell syntax; in CMD it fails with'irm' is not recognized(why). - Make sure
wingetexists. OpenAI's Windows page assumes it; if it's missing, update Windows or install the Windows Package Manager. - Inside Codex, run
/statusand/debug-configto see the active sandbox, permission profile and loaded config. - Match the failure below. Most Windows-only problems are sandbox setup or permissions.
Sandbox errors
| You see | Cause | Fix |
|---|---|---|
The elevated sandbox setup fails | The UAC prompt was declined, or the machine blocks local user/group creation, firewall rule changes or the logon rights the sandbox users need | Run setup again and approve the admin prompt; on a company laptop, ask IT. If policy allows, use unelevated meanwhile |
Windows error 1385 | The sandbox users exist, but Windows policy denies them the logon type they need to start commands | IT grants the logon rights; compare group policy if only some machines fail; unelevated as a stopgap |
Warning that folders are writable by Everyone | Folder permissions too broad for the sandbox to protect | Remove Everyone write access where appropriate, then restart Codex or re-run setup |
| Commands can't reach the network | Some permission modes run with outbound network off on purpose | Check the mode; if network was expected, restart Codex; if it repeats, keep the sandbox log |
| Sandbox worked, then stopped | Moved repo, changed permissions or Windows policies | Restart Codex; re-run the MXC probe or the elevated setup |
Codex says it switched you to unelevated | Elevated setup wasn't available | Fine 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 codexconfirms it's on the WSLPATH. - Keep repositories under
~/, not/mnt/c/...: Windows-mounted paths are slower and cause symlink and permission problems. If WSL still feels slow, runwsl --updatethenwsl --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.logwith: 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-secretsfolder. stdin is not a terminalfrom 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
- Codex CLI: stdin is not a terminal
- Codex CLI: Error loading config.toml
- Gemini CLI not opening the browser to sign in
Sources
Read 30 Nov 2026. These tools change often: if a step no longer matches, the linked page wins.
- Codex docs: Windows sandbox (troubleshooting and FAQ): learn.chatgpt.com/docs/windows/windows-sandbox
- Codex docs: WSL: learn.chatgpt.com/docs/windows/wsl
- openai/codex README (install commands): github.com/openai/codex/blob/main/README.md
- reviewready CLI: one command that checks an AI app repo before it ships
- Exposed API key checker: find API keys committed to a repo or shipped to the browser
- Install Claude Code on Windows: commands and install error fixes