Codex no longer supports WSL1. According to OpenAI's Windows docs, WSL1 was supported through Codex 0.114. Starting in 0.115, the Linux sandbox moved to bubblewrap, which needs WSL2. Run wsl -l -v in PowerShell. If your distribution shows version 1, convert it with wsl --set-version <DistroName> 2, or run Codex natively on Windows instead.
Applies to: Windows, WSL1, Codex 0.115 and later
Check your WSL version
In PowerShell:
wsl -l -v
Look at the VERSION column for the distribution where you run Codex.
Convert to WSL2
wsl --set-version <DistroName> 2
Replace <DistroName> with the name from the list, for example Ubuntu. Then reopen the distribution and run codex again.
Can’t use WSL2?
Run Codex natively on Windows instead. Use the PowerShell installer for the CLI, or the ChatGPT desktop app with its default Windows-native agent. See Download Codex for Windows.
Questions people ask
Will converting to WSL2 delete my files?
Conversion keeps the distribution's files, but it can take a while for large distributions. Back up anything important first, as with any system change.
Sources
We link to the official source for every instruction on this page. If anything here disagrees with them, trust the official source and tell us.