Codex Windows crashed with WSL - WSL config location
What version of the Codex App are you using (From “About Codex” dialog)?
Version Unknown (this is what I see in winget)
What subscription do you have?
Enterprise
What platform is your computer?
Windows
What issue are you seeing?
Codex crashed with the following error:
Codex app-server exited unexpectedly (code=126, signal=null).
Most recent error: /usr/bin/bash: line 1: exec: /mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.305.950.0_x64__2p2nqsd0c76g0/app/resources/codex: cannot execute: Permission denied
<img width="543" height="556" alt="Image" src="https://github.com/user-attachments/assets/faba893a-159b-44b4-a426-5748c8b000a0" />
What steps can reproduce the bug?
Set Codex to work with WSL
What is the expected behavior?
App is working fine.
Additional information
Error message is saying: Check your settings to disable running in WSL if you are seeing compatibility issues
Where can I find a config file with this setting? Maybe removing it helps.
Reinstalling the Codex app won't clean the configuration, and it is not clear how to reinstall Codex as a fresh app with default config
17 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
It looks like once WSL is chosen, you are locked forever with this bug.
Simple instruction on how to reset/install fresh version of the Codex app (or at least which file to edit to switch back from WSL to regular PowerShell) would be very helpful. Now, even though I am on an enterprise plan, I am totally blocked from using the Windows app.
Reinstalling won't work, and I don't want to manually remove every folder named
codexas I don't want to break CLI versionsecond this, i tried resetting the configs etc. the cli and extensions work but not the app in combination with WSL.
edit: updating to thew newest version on WSL/extension and app (foce update via check updates in ms store) fixed it. @kamiljozwik
✅ The most recent version of Windows Subsystem for Linux is already installed
✅ Codex cli updated in both Windows and WSL (Ubuntu)
✅ Code Windows app updated 5 minutes ago
❌ Codex crashed with the following error: Most recent error: /usr/bin/bash: line 1: exec: /mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.306.996.0_x64__2p2nqsd0c76g0/app/resources/codex: cannot execute: Permission denied
If it won't change soon, I don't see a reason to keep paying for Codex (and we have 50+ ChatGPT enterprise licenses), as half of our developers are stuck with this error, while these ones with Claude Code operate flawlessly...
Any update on this? Experiencing the exact same issue, but with different code...
ON IINIT
<img width="545" height="559" alt="Image" src="https://github.com/user-attachments/assets/b469e6b0-99c8-424c-8709-4ee26f33a728" />
ON RELOAD
<img width="546" height="557" alt="Image" src="https://github.com/user-attachments/assets/f413fed5-fca6-47a6-aa9f-9b45b88f9ef5" />
I encountered this issue as well, and I’ve already solved it.
The cause was that Codex was installed on the D drive instead of the C drive.
Reinstalling it on the C drive fixed the problem and it works normally now.
I also encountered this problem.
My solution is to open the file "C:\Users\<username>\.codex\.codex-global-state.json", and modify the two settings within it.
Then restart Codex, and it will return to the previous conversation state.
I think there are bugs in the current Windows Codex's compatibility with WSL, and it needs to be fixed by OpenAI.
Please marry me 💖
It solved my issue, thank you so much! 🎈
Continue here for the problem unrelated to permission :) https://github.com/openai/codex/issues/14461
Same here with "permission denied" problem after switching to WSL:
Steps:
<img width="560" height="560" alt="Image" src="https://github.com/user-attachments/assets/d6aeb0b5-8213-47b7-89ff-989b2b680ef6" />
@Dahgoth and to everyone needing help with this issue.
First do in your terminal
wsl -l -vThat command will show the distros you currently have and it will mark the default one with "*".
I am not sure, however it seems that the go to is Ubuntu or any other Ubuntu based distro.
If you do not have any of the reccomended distros you can just do
wsl --installThat will install Ubuntu.
Then you need to set your distro as the default one, for Ubuntu you just do
wsl --setdefault Ubuntu
After this, you should be good to go, just restart codex application.
Hope this helps or at least gives some direction.
It doesn't work. The fundamental bug is that the Codex Windows app cannot be configured to run the agent in WSL2.
I need some more information to replicate this problem.
I am currently on windows, using the Codex Windows App. I've configured it to run on wsl 2. The ubuntu installation I mentioned is using wsl 2.
Am I missing something?
<img width="888" height="838" alt="Image" src="https://github.com/user-attachments/assets/2f191fdf-b6fe-47c9-929d-f5cef031ffe8" />
<img width="572" height="85" alt="Image" src="https://github.com/user-attachments/assets/3a7f5589-9aac-4db2-95fa-de1c17d90a87" />
.codex/config.toml----------
model = "gpt-5.4"
model_reasoning_effort = "high"
personality = "pragmatic"
[windows] -------------------
run_in_wsl = true
codex-global-state.json
"runCodexInWindowsSubsystemForLinux":true,"integratedTerminalShell":"powershell","localeOverride":"en-US"
.wslconfig--------------------
[wsl2]
networkingMode=mirrored
[experimental]
autoProxy=true
dnsTunneling=true
firewall=true
you saved me.
Hello,
I ran into this issue on WSL2 and managed to fix it by granting execute permissions to the
codexbinary directly from PowerShell (as Administrator):Note: use
*S-1-1-0instead ofEveryone— on non-English Windows the group name is localized andicaclswon't resolve it.After this WSL correctly picks up the execute bit and the app works fine.
Thank you, I used your method and successfully solved my problem.