codex - 💡(How to fix) Fix Codex Desktop cannot launch direct bash -lc from Windows, but wsl.exe --cd works [1 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#22492Fetched 2026-05-14 03:35:07
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Codex Desktop on Windows cannot launch direct bash -lc even from a normal Windows cwd, but launching Bash through wsl.exe --cd works.

Correlation id: d59c19ac-741f-4d5f-bcb5-7afaebb3b76d

Error Message

Error code: Bash/Service/CreateInstance/E_ACCESSDENIED

Root Cause

For WSL checkouts, this makes shell-feature commands harder and increases quoting issues because commands must be routed through PowerShell -> wsl.exe -> Bash.

Fix Action

Fix / Workaround

Workaround that succeeds

Code Example

Set-Location -LiteralPath $env:USERPROFILE
bash -lc 'echo ok'

---

Access is denied.
Error code: Bash/Service/CreateInstance/E_ACCESSDENIED

---

wsl.exe -d Ubuntu --cd /home/ekane/src/github.com/sentrylink/webapp -- bash -lc 'echo ok'
RAW_BUFFERClick to expand / collapse

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

26.506.31421

What subscription do you have?

Pro $200

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What issue are you seeing?

Summary

Codex Desktop on Windows cannot launch direct bash -lc even from a normal Windows cwd, but launching Bash through wsl.exe --cd works.

Correlation id: d59c19ac-741f-4d5f-bcb5-7afaebb3b76d

Reproduction details

From a Codex Desktop Windows shell context:

Set-Location -LiteralPath $env:USERPROFILE
bash -lc 'echo ok'

Actual result

Access is denied.
Error code: Bash/Service/CreateInstance/E_ACCESSDENIED

This also occurs when the active workspace is a WSL UNC path, but changing PowerShell's cwd to $env:USERPROFILE first does not fix it.

Workaround that succeeds

wsl.exe -d Ubuntu --cd /home/ekane/src/github.com/sentrylink/webapp -- bash -lc 'echo ok'

Expected behavior

Direct bash -lc should work the same way it does in an interactive PowerShell session, or Codex should clearly document/surface that direct bash.exe launch is blocked and recommend the wsl.exe --cd ... -- bash -lc ... pattern.

Impact

For WSL checkouts, this makes shell-feature commands harder and increases quoting issues because commands must be routed through PowerShell -> wsl.exe -> Bash.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex Desktop cannot launch direct bash -lc from Windows, but wsl.exe --cd works [1 participants]