You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I updated the Codex app via the Windows Store and tested again, but the issue still occurs on my side. The app-server still exits with the same error when WSL mode is enabled (permission denied when trying to execute the runtime under WindowsApps).
Could you confirm which version contains the fix, or if there are any additional steps required after updating? I’m currently unable to start Codex when WSL execution is enabled.
It's now been resolved (update via Windows Store). I tested and it works.
Which version should we have? My codex app has been updated to version 26.304.1528.0, but I get the following error:
Codex app-server exited unexpectedly (code=126, signal=null). Most recent error: /usr/bin/bash: line 1: /mnt/c/Users/beems/.codex/bin/wsl/codex: Success
Edit 1:
I tried also with deleting the .codex folder in my user profile to start clean. But when setting it to use wsl, it give the above error again.
Edit 2:
I did some debugging with Chat. It came to the conclusion I was running WSL as arm64 and that triggered the error. The codex file at .codex/bin/wsl/codex shows ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, stripped.
Can others confirm that it isn't working and they are on arm64 WSL?
An error has occurred
Codex crashed with the following error:
Codex app-server exited unexpectedly (code=3221225781, signal=null).
Most recent error: None
Some things to try:
Check your config.toml for invalid settings
Check your settings to disable running in WSL if you are seeing compatibility issues
Try downloading a different version of the extension
@Mohitxxx@MertCtn Looks like a new bug. Best to create a separate issue. Everything is running smoothly here. This was a permissions error. Something seems to be wrong with Bash on your end.
To prevent permission error on your end check my script: #13488 (comment) If the error persists after that, it is a new problem.
These are the steps from Claude Sonnet 4.6 in English, and it helped me to solve the problem:
Root Cause
When Docker Desktop is installed, the WSL default distribution may be set to docker-desktop or docker-desktop-data. These are Docker's internal distributions and do not contain a full Linux environment (no /usr/bin/bash). Codex reads the WSL default distribution and tries to execute within it, resulting in this error.
Diagnostic Step
Run the following in PowerShell to check your current WSL status:
wsl -l -v
If the output looks like this:
NAME STATE VERSION
* docker-desktop Running 2
docker-desktop-data Running 2
Ubuntu Stopped 2
The * next to docker-desktop confirms this is the issue.
Fix Options
Fix 1: Change the WSL Default Distribution (Most Effective)
wsl --set-default Ubuntu
If your Ubuntu distribution has a different name (e.g. Ubuntu-22.04), replace accordingly. Then restart the Codex app.
Fix 2: Make Sure Ubuntu is Running on WSL2
If Ubuntu is still on WSL1, upgrade it:
wsl --set-version Ubuntu 2
Then run Fix 1 again.
Fix 3: If No Linux Distribution is Installed
If wsl -l -v only shows docker-desktop entries, you have no Ubuntu installed:
wsl --install
This installs Ubuntu as the default distribution. Restart your PC after.
Fix 4 (Temporary Workaround): Edit the Config File Manually
If none of the above resolves it immediately:
Open %USERPROFILE%\.codex\.codex-global-state.json
Set runCodexInWindowsSubsystemForLinux to false
Restart Codex, then go to Settings and switch back to WSL mode
Recommended Order
Run wsl -l -v to confirm the issue
Run wsl --set-default Ubuntu (or the correct distribution name)
Restart Codex
This approach directly addresses the root cause, unlike the permission fixes you previously attempted.
Activity
github-actions commentedon Mar 4, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Access is denied (0x5)#12974Powered by Codex Action
mahdimessai commentedon Mar 4, 2026
I found this temporary workaround until they fix this issue
The idea is to grant Read + Execute on the specific Codex package.
Run powershell as administrator.
Copy the folder path.
Run:
then Run:
Close codex app and re-open. Should work
etraut-openai commentedon Mar 4, 2026
Thanks for reporting. We understand the problem and are working on a fix.
wbdb commentedon Mar 4, 2026
PowerShell Script Fix:
BWBrook commentedon Mar 5, 2026
It's now been resolved (update via Windows Store). I tested and it works.
etraut-openai commentedon Mar 5, 2026
Thanks for the confirmation!
xvhuan commentedon Mar 5, 2026
I updated the Codex app via the Windows Store and tested again, but the issue still occurs on my side. The app-server still exits with the same error when WSL mode is enabled (permission denied when trying to execute the runtime under WindowsApps).
Could you confirm which version contains the fix, or if there are any additional steps required after updating? I’m currently unable to start Codex when WSL execution is enabled.
TheBeems commentedon Mar 5, 2026
Which version should we have? My codex app has been updated to version 26.304.1528.0, but I get the following error:
Codex app-server exited unexpectedly (code=126, signal=null). Most recent error: /usr/bin/bash: line 1: /mnt/c/Users/beems/.codex/bin/wsl/codex: SuccessEdit 1:
I tried also with deleting the .codex folder in my user profile to start clean. But when setting it to use wsl, it give the above error again.
Edit 2:
I did some debugging with Chat. It came to the conclusion I was running WSL as
arm64and that triggered the error. The codex file at.codex/bin/wsl/codexshowsELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, stripped.Can others confirm that it isn't working and they are on
arm64WSL?illgitthat commentedon Mar 5, 2026
@TheBeems @xvhuan Since the issue was closed out, open a new issue if you are still experiencing this.
peckomingo commentedon Mar 5, 2026
I am also on WSL and arm64 and have the same problem.
Mohitxxx commentedon Mar 6, 2026
An error has occurred
Codex crashed with the following error:
Codex app-server exited unexpectedly (code=3221225781, signal=null).
Most recent error: None
Some things to try:
Check your config.toml for invalid settings
Check your settings to disable running in WSL if you are seeing compatibility issues
Try downloading a different version of the extension
Any help...
MertCtn commentedon Mar 8, 2026
No it didn't fixed
wbdb commentedon Mar 9, 2026
@Mohitxxx @MertCtn Looks like a new bug. Best to create a separate issue. Everything is running smoothly here. This was a permissions error. Something seems to be wrong with Bash on your end.
To prevent permission error on your end check my script: #13488 (comment) If the error persists after that, it is a new problem.
TheBeems commentedon Mar 9, 2026
I created a new issue for machines on arm cpu's: #13565
But I assume it has very low priority. Is the codex app open source as well? So we can compile the app ourselves?
benchan111999-cmd commentedon Apr 27, 2026
These are the steps from Claude Sonnet 4.6 in English, and it helped me to solve the problem:
Root Cause
When Docker Desktop is installed, the WSL default distribution may be set to
docker-desktopordocker-desktop-data. These are Docker's internal distributions and do not contain a full Linux environment (no/usr/bin/bash). Codex reads the WSL default distribution and tries to execute within it, resulting in this error.Diagnostic Step
Run the following in PowerShell to check your current WSL status:
If the output looks like this:
The
*next todocker-desktopconfirms this is the issue.Fix Options
Fix 1: Change the WSL Default Distribution (Most Effective)
If your Ubuntu distribution has a different name (e.g.
Ubuntu-22.04), replace accordingly. Then restart the Codex app.Fix 2: Make Sure Ubuntu is Running on WSL2
If Ubuntu is still on WSL1, upgrade it:
Then run Fix 1 again.
Fix 3: If No Linux Distribution is Installed
If
wsl -l -vonly showsdocker-desktopentries, you have no Ubuntu installed:wsl --installThis installs Ubuntu as the default distribution. Restart your PC after.
Fix 4 (Temporary Workaround): Edit the Config File Manually
If none of the above resolves it immediately:
%USERPROFILE%\.codex\.codex-global-state.jsonrunCodexInWindowsSubsystemForLinuxtofalseRecommended Order
wsl -l -vto confirm the issuewsl --set-default Ubuntu(or the correct distribution name)This approach directly addresses the root cause, unlike the permission fixes you previously attempted.
這些是來自 Claude Sonnet 4.6 的步驟(英文版),它幫助我解決了問題:
這個問題的核心在於:Codex 嘗試在
docker-desktop這個 WSL 發行版中運行,而非真正的 Linux 發行版(如 Ubuntu),因此找不到/usr/bin/bash。 這是一個已知的 WSL 預設發行版設定問題。問題根源
當你安裝了 Docker Desktop 後,WSL 的預設發行版可能被設定為
docker-desktop或docker-desktop-data,而這些是 Docker 的內部發行版,並不包含完整的 Linux 環境(沒有/usr/bin/bash)。Codex 讀取 WSL 預設發行版並嘗試在其中執行,結果就出現此錯誤 。 github診斷步驟
先在 PowerShell 執行以下指令,確認目前 WSL 狀態:
如果輸出類似:
看到
*標記在docker-desktop旁邊,就確認是這個問題。修復方案
方案 1:更改 WSL 預設發行版(最根本的修復)
如果你的 Ubuntu 發行版名稱不同(例如
Ubuntu-22.04),請用正確名稱替換 。改完後重新啟動 Codex 即可。 [stackoverflow](https://stackoverflow.com/questions/72483632/ubuntu-error-the-command-docker-could-not-be-found-in-this-wsl-2-distro)方案 2:確認 Ubuntu 為 WSL2 版本
如果 Ubuntu 發行版仍是 WSL1,需要升級:
完成後再執行方案 1 。 [dev](https://dev.to/bowmanjd/install-docker-on-windows-wsl-without-docker-desktop-34m9/comments)
方案 3:如果未安裝任何 Linux 發行版
若
wsl -l -v只顯示docker-desktop系列,代表你尚未安裝 Ubuntu:wsl --install這會安裝 Ubuntu 作為預設發行版,完成後重啟電腦 。 [developers.openai](https://developers.openai.com/codex/windows)
方案 4(臨時 Workaround):手動修改設定檔
如果以上都無法立即解決,可暫時避免 app 無法啟動的問題 : [x](https://x.com/dkundel/status/2029263781558403504)
%USERPROFILE%\.codex\.codex-global-state.jsonrunCodexInWindowsSubsystemForLinux改為false建議執行順序
wsl -l -v確認問題wsl --set-default Ubuntu(或正確的發行版名稱)這個步驟比之前嘗試的權限修復更直接針對根本原因。