codex - 💡(How to fix) Fix Codex Desktop WSL mode starts Windows app-server and leaves thread in PowerShell [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#21147Fetched 2026-05-06 06:25:57
View on GitHub
Comments
3
Participants
2
Timeline
9
Reactions
0
Timeline (top)
labeled ×4commented ×3mentioned ×1subscribed ×1

Code Example

C:\Program Files\WindowsApps\OpenAI.Codex_26.429.3425.0_x64__2p2nqsd0c76g0\app\Codex.exe

---

currentVersion=0.125.0-alpha.3

---

codex-cli 0.128.0

---

"runCodexInWindowsSubsystemForLinux": true,
"integratedTerminalShell": "wsl",
"electron-saved-workspace-roots": ["\\\\wsl.localhost\\Ubuntu\\home\\<user>\\<workspace>"],
"active-workspace-roots": ["\\\\wsl.localhost\\Ubuntu\\home\\<user>\\<workspace>"]

---

shell=powershell
cwd=C:\home\<user>\<workspace>

---

wsl.exe -d Ubuntu --cd "/mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.429.3425.0_x64__2p2nqsd0c76g0/app/resources" -- /usr/bin/bash -lc "... exec /mnt/c/Users/<windows-user>/AppData/Local/OpenAI/Codex/bin/codex.exe app-server --analytics-default-enabled"

codex.exe app-server --analytics-default-enabled
powershell.exe child of codex.exe

---

wsl.exe -d Ubuntu -- bash -lc 'cd /home/<user>/<workspace> && pwd && uname -a && git rev-parse --show-toplevel && command -v codex && codex --version && command -v node && node --version'

/home/<user>/<workspace>
Linux <host> 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
/home/<user>/<workspace>
/usr/local/bin/codex
codex-cli 0.128.0
/usr/bin/node
v18.19.1

---

[projects.'c:\home\<user>\<workspace>']
trust_level = "trusted"

---

shell=bash or equivalent Linux shell
cwd=/home/<user>/<workspace>
pwd -> /home/<user>/<workspace>
uname -a -> Linux ...
git rev-parse --show-toplevel -> /home/<user>/<workspace>

---

shell=powershell
cwd=C:\home\<user>\<workspace>
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using?

Codex Desktop for Windows 26.429.3425.0 from Microsoft Store path observed in process tree:

C:\Program Files\WindowsApps\OpenAI.Codex_26.429.3425.0_x64__2p2nqsd0c76g0\app\Codex.exe

The app-server reports:

currentVersion=0.125.0-alpha.3

The WSL-installed CLI reports:

codex-cli 0.128.0

Platform

Windows 11 x64 with WSL2 Ubuntu.

What issue are you seeing?

Codex Desktop is configured for WSL, and the persisted app state shows WSL mode enabled:

"runCodexInWindowsSubsystemForLinux": true,
"integratedTerminalShell": "wsl",
"electron-saved-workspace-roots": ["\\\\wsl.localhost\\Ubuntu\\home\\<user>\\<workspace>"],
"active-workspace-roots": ["\\\\wsl.localhost\\Ubuntu\\home\\<user>\\<workspace>"]

However, new threads still start with a Windows runner:

shell=powershell
cwd=C:\home\<user>\<workspace>

That cwd is invalid from Windows, so basic commands fail before any repo work can begin.

The process tree suggests Desktop launches through WSL but then executes the Windows Codex app-server from /mnt/c, which appears to make the agent runtime Windows/PowerShell rather than a true Linux/WSL runner:

wsl.exe -d Ubuntu --cd "/mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.429.3425.0_x64__2p2nqsd0c76g0/app/resources" -- /usr/bin/bash -lc "... exec /mnt/c/Users/<windows-user>/AppData/Local/OpenAI/Codex/bin/codex.exe app-server --analytics-default-enabled"

codex.exe app-server --analytics-default-enabled
powershell.exe child of codex.exe

So the app seems to use WSL as a launch wrapper, but the actual app-server/command execution path remains Windows-side.

WSL itself works

Explicit WSL invocation succeeds and reaches the intended repo:

wsl.exe -d Ubuntu -- bash -lc 'cd /home/<user>/<workspace> && pwd && uname -a && git rev-parse --show-toplevel && command -v codex && codex --version && command -v node && node --version'

/home/<user>/<workspace>
Linux <host> 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
/home/<user>/<workspace>
/usr/local/bin/codex
codex-cli 0.128.0
/usr/bin/node
v18.19.1

Attempts already tried

  • Fully quit/restarted Codex Desktop and opened a fresh thread from the WSL workspace.
  • Verified WSL settings persisted in .codex-global-state.json.
  • Removed stale project trust entries for invalid Windows aliases such as c:\home\<user>\<workspace>, /mnt/d/..., and c:\mnt\d\....
  • Reset saved/active workspace roots to the WSL UNC path only.
  • Confirmed Codex Desktop rewrites the invalid Windows project entry on relaunch:
[projects.'c:\home\<user>\<workspace>']
trust_level = "trusted"

Expected behavior

When WSL mode is enabled and a WSL workspace is selected, new local threads should use a Linux/WSL runner:

shell=bash or equivalent Linux shell
cwd=/home/<user>/<workspace>
pwd -> /home/<user>/<workspace>
uname -a -> Linux ...
git rev-parse --show-toplevel -> /home/<user>/<workspace>

Actual behavior

New local threads still use:

shell=powershell
cwd=C:\home\<user>\<workspace>

The cwd is invalid, and the spawned app-server path indicates the Windows codex.exe is being launched from inside WSL rather than a Linux app-server being used.

Related issue

Possibly related but not the same as #20415. That issue reports automation failures/stalls for WSL workspaces. In this case, the repro is a normal interactive fresh local thread, without automations.

extent analysis

TL;DR

The issue can be resolved by ensuring that the Codex Desktop app-server is launched with the correct WSL configuration, using a Linux runner instead of the Windows PowerShell.

Guidance

  • Verify that the runCodexInWindowsSubsystemForLinux setting is correctly set to true in the persisted app state.
  • Check the electron-saved-workspace-roots and active-workspace-roots settings to ensure they point to the correct WSL UNC path.
  • Investigate why the codex.exe app-server is being launched from the Windows side instead of using a Linux app-server, potentially by modifying the launch command to use the WSL bash shell.
  • Test the WSL configuration by running the wsl.exe command with the --cd option to verify that the correct directory is being used.

Example

No code snippet is provided as the issue seems to be related to the configuration and launch process of the Codex Desktop app.

Notes

The issue appears to be specific to the interaction between the Codex Desktop app and the WSL configuration on Windows 11. Further investigation is needed to determine the root cause of the problem.

Recommendation

Apply a workaround by modifying the launch command to use the WSL bash shell, as the issue seems to be related to the incorrect use of the Windows PowerShell. This should allow the app to use the correct Linux runner and resolve the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When WSL mode is enabled and a WSL workspace is selected, new local threads should use a Linux/WSL runner:

shell=bash or equivalent Linux shell
cwd=/home/<user>/<workspace>
pwd -> /home/<user>/<workspace>
uname -a -> Linux ...
git rev-parse --show-toplevel -> /home/<user>/<workspace>

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING