Skip to content

Windows Codex App cannot locate CLI when installed on non-standard drive #22672

Open

Description

@Y1-Bit

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

Image

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?

  1. 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:) .
  2. Install the Codex Windows app from the Microsoft Store.
  3. Open Codex and go to: Settings -> Agent Environment
  4. Set the environment to: Windows Subsystem for Linux
  5. (Optional) Set the integrated terminal shell to WSL as well.
  6. Fully terminate all Codex processes via Task Manager.
  7. Relaunch the Codex app.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    appIssues related to the Codex desktop app
    on May 14, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    on May 14, 2026
  3. git97shunxin commented on May 16, 2026

    @git97shunxin

    It did work when Codex was installed on C drive,I'm curious about how you found this solution

  4. z1131392774 commented on May 25, 2026

    @z1131392774

    It did work when Codex was installed on C drive,I'm curious about how you found this solution当 Codex 安装在 C 驱动器上时,这是可以工作的,我对你是如何找到这个解决方案感到好奇

    same.it work for me.thank u very much!

  5. LCYing101 commented on Jun 8, 2026

    @LCYing101

    It did help me

  6. Beowulfwar commented on Jun 13, 2026

    @Beowulfwar

    Workaround that fixed it for me on Windows + WSL

    I was getting:

    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:

    Missing optional dependency @openai/codex-linux-x64
    

    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.

  7. cls1277 commented on Jun 13, 2026

    @cls1277

    Workaround that fixed it for me on Windows + WSL

    I was getting:

    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:

    Missing optional dependency @openai/codex-linux-x64
    

    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.

  8. koybe commented on Jun 13, 2026

    @koybe

    Workaround that fixed it for me on Windows + WSL

    I was getting:

    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:

    Missing optional dependency @openai/codex-linux-x64
    

    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

  9. BretJohnson commented on Jun 13, 2026

    @BretJohnson

    Thank you, @Beowulfwar. That worked for me as well, though I had it adjust it since I had node installed with nvm:

    #!/usr/bin/env sh
    
    export PATH="/home/bret/.nvm/versions/node/v24.15.0/bin:$PATH"
    exec /home/bret/.nvm/versions/node/v24.15.0/bin/codex "$@"
    
  10. ethanyanjiali commented on Jun 15, 2026

    @ethanyanjiali

    Thanks for the workaround, OAI team really need to fix their s

  11. stonstad commented on Aug 3, 2026

    @stonstad

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

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