You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows Codex cannot start when WSL mode is enabled (terminalShell=wsl) #14461
appIssues related to the Codex desktop appbugSomething isn't workingterminalIssues related to the in-app terminalwindows-osIssues related to Codex on Windows systems
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/bash or which bash inside your WSL terminal. Are you currently using Ubuntu as your default WSL distribution, or a minimal one like Alpine?
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/bash or which bash inside 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:
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.
➜ ~ wsl -l -v
NAME STATE VERSION
* docker-desktop Stopped 2
aimuo Running 2
➜ ~ wsl --set-default aimuo
操作成功完成。
➜ ~ wsl -l -v
NAME STATE VERSION
* aimuo Running 2
docker-desktop Stopped 2
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.
Codex CLI process exited classifiedAsExpected=false code=4294967295 ... signal=null
This 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=null wrapper error.
In this repro, changing ~/.codex/config.toml sandbox 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
App build (26.415.1938.0)
Changed persisted flags:
runCodexInWindowsSubsystemForLinux=false
integratedTerminalShell="powershell"
Result: app starts normally after full restart
Note: workaround only; root cause still appears to be WSL startup path
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.
Sharing a related WSL failure and a verified fix, in case it helps others finding this issue. Our symptom differs from the original report: the desktop app opened normally, but creating a task in WSL agent mode failed.
Environment:
Windows Codex desktop app 26.908.4834.0 (version observed in the installed package path in logs).
WSL2, with Ubuntu-24.04 already the default distribution.
Both WSL agent mode and the integrated WSL terminal enabled.
The desktop log showed thread/start failing with:
Invalid request: AbsolutePathBuf deserialized without a base path
What we found: the Windows user environment variable CODEX_CLI_PATH was explicitly pointing to a Windows executable:
Inspection of the running WSL process showed that it was actually executing this Windows codex.exe through WSL interop as the app-server. The app's bundled startup code also prioritized this environment override when selecting the WSL executable. The package contained a Linux ELF backend, but the override selected the Windows executable instead. This explains the platform/path mismatch when starting a task for a Linux project directory.
Fix confirmed on our machine: back up the existing override, remove it from the Windows user environment, fully exit Codex, and reopen it from the Windows Start menu. In PowerShell:
# Inspect and save the existing value before removing it.
[Environment]::GetEnvironmentVariable("CODEX_CLI_PATH","User")
# If it is an unwanted override pointing to Windows codex.exe:
[Environment]::SetEnvironmentVariable("CODEX_CLI_PATH",$null,"User")
After a full restart, creating and running a task in WSL worked normally. We kept both settings enabled:
There was no need to switch back to PowerShell or disable WSL agent mode. We do not know how the override was originally set. This is a fix for this specific environment-override scenario, not a claim that it explains all failures reported here. The task-creation error also matches the symptom described in #16815.
After making those changes and restarting the app, it launched normally. No more flickering or constant reloads.
I haven't tested the two settings separately, so I can't say for sure which one fixed it. It does seem related to the WSL integration, though.
I also noticed that #54478 was closed after a previous update reportedly fixed a similar issue. Since I'm still seeing this behavior on version 26.1103.7773.0, I thought it was worth documenting here.
Hopefully this helps someone running into the same problem!
appIssues related to the Codex desktop appbugSomething isn't workingterminalIssues related to the in-app terminalwindows-osIssues related to Codex on Windows systems
Activity
github-actions commentedon Mar 12, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
wbdb commentedon Mar 12, 2026
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?askxue commentedon Mar 13, 2026
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.
ralphtrickey commentedon Mar 13, 2026
I had that problem and found out my default wsl was docker desktop. I changed it to Ubuntu and was able to run Codex.
askxue commentedon Mar 14, 2026
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.
rainx0r commentedon Mar 19, 2026
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.
Saunak626 commentedon Mar 31, 2026
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.
squarepots commentedon Apr 12, 2026
same
Agwstin commentedon Apr 16, 2026
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\u0000o\u0000 \u0000s\u0000e\u0000 \u0000p\u0000u\u0000d\u0000o\u0000 ...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
AxENSRennes commentedon May 19, 2026
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.
yidianyiko commentedon Sep 13, 2026
Sharing a related WSL failure and a verified fix, in case it helps others finding this issue. Our symptom differs from the original report: the desktop app opened normally, but creating a task in WSL agent mode failed.
Environment:
26.908.4834.0(version observed in the installed package path in logs).Ubuntu-24.04already the default distribution.The desktop log showed
thread/startfailing with:What we found: the Windows user environment variable
CODEX_CLI_PATHwas explicitly pointing to a Windows executable:Inspection of the running WSL process showed that it was actually executing this Windows
codex.exethrough WSL interop as the app-server. The app's bundled startup code also prioritized this environment override when selecting the WSL executable. The package contained a Linux ELF backend, but the override selected the Windows executable instead. This explains the platform/path mismatch when starting a task for a Linux project directory.Fix confirmed on our machine: back up the existing override, remove it from the Windows user environment, fully exit Codex, and reopen it from the Windows Start menu. In PowerShell:
After a full restart, creating and running a task in WSL worked normally. We kept both settings enabled:
There was no need to switch back to PowerShell or disable WSL agent mode. We do not know how the override was originally set. This is a fix for this specific environment-override scenario, not a claim that it explains all failures reported here. The task-creation error also matches the symptom described in #16815.
MuriLovin commentedon Nov 10, 2026
I ran into a similar issue today (November 10, 2026) and wanted to share what worked for me in case it helps anyone else.
I'm running Windows 11 Pro 26H2 (build 26300.9711) with WSL2 enabled and Codex Desktop version
26.1103.7773.0.When I launched the app, the window would just keep flickering and reloading. It never actually reached a usable state.
After digging through the logs, I noticed a few recurring errors:
The
bwraperror caught my attention, especially after finding the similar report in #54478.I eventually got the app working by switching from WSL to the native Windows environment and setting PowerShell as the integrated terminal.
These are the settings I used in my
config.toml:After making those changes and restarting the app, it launched normally. No more flickering or constant reloads.
I haven't tested the two settings separately, so I can't say for sure which one fixed it. It does seem related to the WSL integration, though.
I also noticed that #54478 was closed after a previous update reportedly fixed a similar issue. Since I'm still seeing this behavior on version
26.1103.7773.0, I thought it was worth documenting here.Hopefully this helps someone running into the same problem!