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 App cannot locate CLI when installed on non-standard drive #22672
What version of the Codex App are you using (From “About Codex” dialog)?
26.506.31421
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Environment:
Windows 11
WSL2 Ubuntu
Codex Windows Desktop App
Codex CLI installed both on Windows and WSL
Problem:
After enabling WSL integration, the Codex desktop app started showing:
"Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex."
Initially this looked like a WSL integration issue, but the actual root cause appears related to installing Codex on a non-standard drive (E: instead of C:).
What fixed it:
Moving/reinstalling Codex to the default C: drive immediately resolved the problem.
This suggests the Electron desktop app may have issues with:
non-standard installation drives
PATH propagation
Windows environment resolution
or WSL integration combined with custom install paths
What steps can reproduce the bug?
Set a custom installation drive in Windows Settings for Microsoft Store apps: System -> Storage -> Advanced storage settings -> Where new content is saved (for example E: instead of C:) .
Install the Codex Windows app from the Microsoft Store.
Open Codex and go to: Settings -> Agent Environment
Set the environment to: Windows Subsystem for Linux
(Optional) Set the integrated terminal shell to WSL as well.
Fully terminate all Codex processes via Task Manager.
Codex failed to start.
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
My setup:
Windows 11
Codex Desktop App
WSL enabled
Codex CLI installed in WSL
After reinstalling the Codex Desktop App, the error persisted. The key finding was that the Desktop App seemed to validate CODEX_CLI_PATH as a Windows path, but then execute it from the WSL/Linux side.
Then I fully closed Codex Desktop and reopened it:
taskkill /IM Codex.exe/F
After reopening the app, Codex started successfully.
So the working setup was:
CODEX_CLI_PATH points to:
C:\Users\jesse\codex-wsl
That file is executed by WSL as:
/mnt/c/Users/jesse/codex-wsl
And the wrapper calls the real WSL CLI:
/home/jesse/.local/bin/codex
This suggests the Desktop App may be mixing Windows path validation with WSL execution when resolving CODEX_CLI_PATH.
Reacted by lizhuoran, cls1277, nk-unireach, koybechan, Bret Johnson, Fernando Biani, Konrad, Zhiyong Ban, luabagg, bhattaraiprayag and 23 more
Codex failed to start.
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
My setup:
Windows 11
Codex Desktop App
WSL enabled
Codex CLI installed in WSL
After reinstalling the Codex Desktop App, the error persisted. The key finding was that the Desktop App seemed to validate CODEX_CLI_PATH as a Windows path, but then execute it from the WSL/Linux side.
What did not work:
CODEX_CLI_PATH=C:\Users\jesse\AppData\Roaming\npm\codex.cmd
That produced a Linux shell syntax error because WSL tried to execute the Windows .cmd file.
This also did not work correctly:
CODEX_CLI_PATH=C:\Users\jesse\AppData\Roaming\npm\codex
That made WSL try to run the Windows npm package through /mnt/c/..., causing:
The workaround was to create a Linux shell wrapper in a Windows-visible path and point CODEX_CLI_PATH to it.
In WSL:
cat > /mnt/c/Users/jesse/codex-wsl <<'EOF'
#!/usr/bin/env sh
exec /home/jesse/.local/bin/codex "$@"
EOF
chmod +x /mnt/c/Users/jesse/codex-wsl
/mnt/c/Users/jesse/codex-wsl --version
Then in PowerShell:
[Environment]::SetEnvironmentVariable("CODEX_CLI_PATH", "C:\Users\jesse\codex-wsl", "User")
Then I fully closed Codex Desktop and reopened it:
taskkill /IM Codex.exe /F
After reopening the app, Codex started successfully.
So the working setup was:
CODEX_CLI_PATH points to:
C:\Users\jesse\codex-wsl
That file is executed by WSL as:
/mnt/c/Users/jesse/codex-wsl
And the wrapper calls the real WSL CLI:
/home/jesse/.local/bin/codex
This suggests the Desktop App may be mixing Windows path validation with WSL execution when resolving CODEX_CLI_PATH.
thanks very much! This has bothered me for a long time.
Codex failed to start.
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
My setup:
Windows 11
Codex Desktop App
WSL enabled
Codex CLI installed in WSL
After reinstalling the Codex Desktop App, the error persisted. The key finding was that the Desktop App seemed to validate CODEX_CLI_PATH as a Windows path, but then execute it from the WSL/Linux side.
What did not work:
CODEX_CLI_PATH=C:\Users\jesse\AppData\Roaming\npm\codex.cmd
That produced a Linux shell syntax error because WSL tried to execute the Windows .cmd file.
This also did not work correctly:
CODEX_CLI_PATH=C:\Users\jesse\AppData\Roaming\npm\codex
That made WSL try to run the Windows npm package through /mnt/c/..., causing:
The workaround was to create a Linux shell wrapper in a Windows-visible path and point CODEX_CLI_PATH to it.
In WSL:
cat > /mnt/c/Users/jesse/codex-wsl <<'EOF'
#!/usr/bin/env sh
exec /home/jesse/.local/bin/codex "$@"
EOF
chmod +x /mnt/c/Users/jesse/codex-wsl
/mnt/c/Users/jesse/codex-wsl --version
Then in PowerShell:
[Environment]::SetEnvironmentVariable("CODEX_CLI_PATH", "C:\Users\jesse\codex-wsl", "User")
Then I fully closed Codex Desktop and reopened it:
taskkill /IM Codex.exe /F
After reopening the app, Codex started successfully.
So the working setup was:
CODEX_CLI_PATH points to:
C:\Users\jesse\codex-wsl
That file is executed by WSL as:
/mnt/c/Users/jesse/codex-wsl
And the wrapper calls the real WSL CLI:
/home/jesse/.local/bin/codex
This suggests the Desktop App may be mixing Windows path validation with WSL execution when resolving CODEX_CLI_PATH.
it works for me, thanks!~ but i think it should be a bug of codex desktop itself @codex
Activity
git97shunxin commentedon May 16, 2026
It did work when Codex was installed on C drive,I'm curious about how you found this solution
z1131392774 commentedon May 25, 2026
same.it work for me.thank u very much!
LCYing101 commentedon Jun 8, 2026
It did help me
Beowulfwar commentedon Jun 13, 2026
Workaround that fixed it for me on Windows + WSL
I was getting:
My setup:
After reinstalling the Codex Desktop App, the error persisted. The key finding was that the Desktop App seemed to validate
CODEX_CLI_PATHas a Windows path, but then execute it from the WSL/Linux side.What did not work:
That produced a Linux shell syntax error because WSL tried to execute the Windows
.cmdfile.This also did not work correctly:
CODEX_CLI_PATH=C:\Users\jesse\AppData\Roaming\npm\codexThat made WSL try to run the Windows npm package through
/mnt/c/..., causing:The workaround was to create a Linux shell wrapper in a Windows-visible path and point
CODEX_CLI_PATHto it.In WSL:
Then in PowerShell:
Then I fully closed Codex Desktop and reopened it:
After reopening the app, Codex started successfully.
So the working setup was:
This suggests the Desktop App may be mixing Windows path validation with WSL execution when resolving
CODEX_CLI_PATH.cls1277 commentedon Jun 13, 2026
thanks very much! This has bothered me for a long time.
koybe commentedon Jun 13, 2026
it works for me, thanks!~ but i think it should be a bug of codex desktop itself @codex
BretJohnson commentedon Jun 13, 2026
Thank you, @Beowulfwar. That worked for me as well, though I had it adjust it since I had node installed with nvm:
ethanyanjiali commentedon Jun 15, 2026
Thanks for the workaround, OAI team really need to fix their s
stonstad commentedon Aug 3, 2026
OpenAI team, I can't believe Codex fails when installed on a drive other than C:. If only they had autonomous agents to author better code...