Windows Codex cannot start when WSL mode is enabled (terminalShell=wsl)
Open 💬 10 comments Opened Mar 12, 2026 by askxue
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
26.309.3504.0
What subscription do you have?
plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Codex fails to start when the following configuration exists in: C:\Users<user>.codex\codex-global-state.json
"runCodexInWindowsSubsystemForLinux": true,
"integratedTerminalShell": "wsl"
When these options are enabled, Codex desktop cannot start successfully.
The application crashes during initialization.
<img width="549" height="550" alt="Image" src="https://github.com/user-attachments/assets/dde695a9-da33-4e58-a47c-6a61429a7cab" />
Manually editing the configuration file resolves the issue.
File: C:\Users<user>.codex\codex-global-state.json
"runCodexInWindowsSubsystemForLinux": false,
"integratedTerminalShell": "powershell"
After this change, Codex starts normally.
What steps can reproduce the bug?
- Install Windows Codex
- Open Settings
- Change the Agent environment to WSL
- Change the Integrated terminal shell to WSL
- Restart
You can see the Codex crashed!
What is the expected behavior?
Works well with WSL on Windows
Additional information
Happy to help test fixes if needed.
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
The error suggests that /usr/bin/bash is missing in your current environment. You can easily verify if it exists by running
ls -l /usr/bin/bashorwhich bashinside your WSL terminal. Are you currently using Ubuntu as your default WSL distribution, or a minimal one like Alpine?Thanks for the reply.
My WSL environment itself is working normally. Before Codex for Windows was released, WSL was actually my main development environment, and I used Codex CLI there regularly without any issues.
The problem only appears with the Codex Windows desktop app when both of these settings are enabled:
runCodexInWindowsSubsystemForLinux = true
integratedTerminalShell = "wsl"
My normal WSL development workflow (Node, pnpm, etc.) works fine outside of Codex.
I had that problem and found out my default wsl was docker desktop. I changed it to Ubuntu and was able to run Codex.
Thanks for the suggestion — that was exactly the issue.
My default WSL distro was
docker-desktop. After switching the default distro to my actual development environment (aimuo, which is Ubuntu), Codex now starts correctly with WSL mode enabled.So it seems Codex currently relies on the default WSL distro when launching.
<img width="770" height="840" alt="Image" src="https://github.com/user-attachments/assets/df2fe68c-0bca-4219-9ba2-2dd30c31ba20" />
I'm also getting this issue but the issue for me is not WSL defaulting to Docker Desktop, it's that my WSL distro (NixOS) actually doesn't have bash at the system level, only zsh.
It would be great if Codex on Windows through WSL could work with any bash-compatible shell.
Same bug: there is only one WSL system, and setting it as default still fails to start.
Currently, as long as "runCodexInWindowsSubsystemForLinux": true, the Codex app cannot be launched at all. Since the app won’t start, I can only access it by modifying the JSON file.
The fundamental bug is that the Codex Windows app cannot be configured to run the agent in WSL2.
same
Another confirmed reproduction on the Windows desktop app with a newer Store build.
Environment:
C:\Program Files\WindowsApps\OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0\app\Codex.exeWindows 10 Pro 25H2, build 26200.8246, x64User-visible error popup:
An error has occurredCodex crashed with the following error:(code=4294967295, signal=null)Most recent error: NoneWhat makes this look like the same root cause as #14461:
~/.codex/.codex-global-state.json"runCodexInWindowsSubsystemForLinux": true"integratedTerminalShell": "wsl"C:\Users\agust\AppData\Local\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\2026\04\16\...stdio_transport_spawned argsCount=2 executablePath=C:\Users\agust\.codex\bin\wsl\codex pid=25392 spawnCommand=wsl.exeFailed to parse MCP message ... Unexpected token 'N' ... is not valid JSONN\^@o\^@ \^@s\^@e\^@ \^@p\^@u\^@d\^@o\^@ ...Error code: Wsl/Service/CreateInstance/MountVhd/HCS/ERROR_PATH_NOT_FOUNDapp_server_connection.closed code=4294967295 ... signal=nullCodex CLI process exited classifiedAsExpected=false code=4294967295 ... signal=nullThis strongly suggests the desktop app is still entering the WSL startup path and then failing before the initialize handshake, with the UI surfacing only the generic
4294967295 / signal=nullwrapper error.In this repro, changing
~/.codex/config.tomlsandbox settings did not change the crash behavior, which further points to persisted desktop WSL mode as the real trigger.If useful, I can provide a larger sanitized excerpt from the package-local desktop log, but the key evidence above seems enough to tie this to the same WSL-enabled startup path discussed in this issue.
Edit:
Workaround confirmed
Same issue here on Windows. Since WSL is the main reason I want to use the desktop app, this makes the app pretty hard to use reliably. Would really appreciate a fix.