Skip to content

Codex Windows crashed with WSL - WSL config location #13699

Open

Description

@kamiljozwik

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

Image

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

Activity

  1. added
    appIssues related to the Codex desktop app
    on Mar 6, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    on Mar 6, 2026
  3. github-actions commented on Mar 6, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  4. kamiljozwik commented on Mar 7, 2026

    @kamiljozwik
    Author

    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 codex as I don't want to break CLI version

  5. imadreamerboy commented on Mar 7, 2026

    @imadreamerboy

    second 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

  6. kamiljozwik commented on Mar 8, 2026

    @kamiljozwik
    Author

    ✅ 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...

  7. quantuan125 commented on Mar 8, 2026

    @quantuan125

    Any update on this? Experiencing the exact same issue, but with different code...

    ON IINIT

    Image

    ON RELOAD

    Image
  8. TotoQian commented on Mar 10, 2026

    @TotoQian

    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.

  9. askxue commented on Mar 12, 2026

    @askxue

    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.

    "runCodexInWindowsSubsystemForLinux": false,
    
    "integratedTerminalShell": "powershell"
    

    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.

  10. kamiljozwik commented on Mar 12, 2026

    @kamiljozwik
    Author

    I also encountered this problem. My solution is to open the file "C:\Users.codex.codex-global-state.json", and modify the two settings within it.

    "runCodexInWindowsSubsystemForLinux": false,
    
    "integratedTerminalShell": "powershell"
    

    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! 🎈

  11. wbdb commented on Mar 12, 2026

    @wbdb

    Continue here for the problem unrelated to permission :) #14461

  12. Dahgoth commented on Mar 25, 2026

    @Dahgoth

    Same here with "permission denied" problem after switching to WSL:

      (code=126, signal=null).
    Most recent error: /usr/bin/bash: line 1: exec: /mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.313.5234.0_x64__2p2nqsd0c76g0/app/resources/codex: cannot execute: Permission denied
    

    Steps:

    1. Install Codex from Microsoft Store
    2. Run it
    3. Change settings to use WSL
    4. Restart an app
    Image
  13. MeloHenrique commented on Mar 30, 2026

    @MeloHenrique

    @Dahgoth and to everyone needing help with this issue.

    First do in your terminal
    wsl -l -v

    That 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 --install

    That 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.

  14. Saunak626 commented on Mar 31, 2026

    @Saunak626

    @Dahgoth and to everyone needing help with this issue.

    First do in your terminal wsl -l -v

    That 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 --install

    That 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.

  15. MeloHenrique commented on Mar 31, 2026

    @MeloHenrique

    @Dahgoth and to everyone needing help with this issue.
    First do in your terminal wsl -l -v
    That 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 --install
    That 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?

  16. Saunak626 commented on Apr 1, 2026

    @Saunak626

    @Dahgoth and to everyone needing help with this issue.
    First do in your terminal wsl -l -v
    That 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 --install
    That 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?

    Image Image

    .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

  17. added
    appIssues related to the Codex desktop app
    and removed
    appIssues related to the Codex desktop app
    on Apr 1, 2026
  18. Bluestar-34 commented on Apr 7, 2026

    @Bluestar-34

    I also encountered this problem. My solution is to open the file "C:\Users.codex.codex-global-state.json", and modify the two settings within it.

    "runCodexInWindowsSubsystemForLinux": false,
    
    "integratedTerminalShell": "powershell"
    

    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.

    you saved me.

  19. hugo2006alm commented on Apr 20, 2026

    @hugo2006alm

    Hello,

    I ran into this issue on WSL2 and managed to fix it by granting execute permissions to the codex binary directly from PowerShell (as Administrator):

    takeown /f "C:\Program Files\WindowsApps\OpenAI.Codex_<version>_x64__2p2nqsd0c76g0\app\resources\codex"
    icacls "C:\Program Files\WindowsApps\OpenAI.Codex_<version>_x64__2p2nqsd0c76g0\app\resources\codex" /grant "*S-1-1-0:(RX)"

    Note: use *S-1-1-0 instead of Everyone — on non-English Windows the group name is localized and icacls won't resolve it.

    After this WSL correctly picks up the execute bit and the app works fine.

  20. The-Guagua-Queen commented on Apr 22, 2026

    @The-Guagua-Queen

    Hello,

    I ran into this issue on WSL2 and managed to fix it by granting execute permissions to the codex binary directly from PowerShell (as Administrator):

    takeown /f "C:\Program Files\WindowsApps\OpenAI.Codex_x64__2p2nqsd0c76g0\app\resources\codex"
    icacls "C:\Program Files\WindowsApps\OpenAI.Codex
    _x64__2p2nqsd0c76g0\app\resources\codex" /grant "*S-1-1-0:(RX)"
    Note: use *S-1-1-0 instead of Everyone — on non-English Windows the group name is localized and icacls won'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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions