Desktop App cannot start after switching Agent Environment to WSL: "Unable to locate the Codex CLI binary"

Open 💬 2 comments Opened Jun 25, 2026 by wangchenxudev
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

26.616.81150

What subscription do you have?

plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

After switching the Agent Environment from Windows to Windows Subsystem for Linux (WSL) in Codex Desktop and restarting the application, the app fails to start the agent.

The following error is displayed:

"Unable to locate the Codex CLI binary.

Set the CODEX_CLI_PATH environment variable to the full path of the Codex CLI binary, or ensure the Electron resources include the binary at bin/codex."

The Codex CLI is already installed inside WSL and works correctly. For example:

wsl --exec /usr/local/bin/codex --version

returns the expected version successfully.

After switching to WSL, the Desktop application cannot proceed past this error, making the WSL Agent Environment unusable.

What steps can reproduce the bug?

Steps to reproduce:

  1. Install Codex CLI inside WSL.
  2. Verify it works:

wsl --exec /usr/local/bin/codex --version

  1. Open Codex Desktop.
  2. Go to Settings → Agent Environment.
  3. Select Windows Subsystem for Linux.
  4. Restart the application.
  5. The application shows "Unable to locate the Codex CLI binary."

What is the expected behavior?

When WSL is selected as the Agent Environment, Codex Desktop should automatically launch the agent inside the selected WSL distribution without requiring any additional manual configuration.

Since WSL is documented as a supported Agent Environment, I expected the Desktop application to detect and use the installed Codex CLI automatically.

The application should continue to start normally after switching to WSL, without requiring CODEX_CLI_PATH to be configured manually.

Additional information

The Codex CLI itself is working correctly.

For example:

wsl --exec /usr/local/bin/codex --version

returns the expected version successfully.

The issue appears to be that Codex Desktop cannot locate or launch the WSL-installed CLI after switching Agent Environment.

As a result, the application becomes unusable until the WSL setting is manually reverted.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 2 months ago

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

  • #28523

Powered by Codex Action

wangchenxudev · 1 month ago

Codex Desktop had been installed on a non-system drive through the Microsoft Store. After uninstalling it and reinstalling the same version on the default system drive (C:), WSL mode started working normally. I did not need to reinstall Codex inside WSL or configure CODEX_CLI_PATH.
This may be caused by Codex Desktop not correctly handling the application path when the MSIX package is installed on a non-system drive.
I hope this is helpful. Please let me know whether reinstalling it on C: works for you as well—or whether the issue still persists afterward.