Windows App opens WSL workspace but runs agent as Windows_NT, causing /bin/bash os error 2

Open 💬 2 comments Opened Jun 3, 2026 by RobbiePlus
💡 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.601.2237.0

What subscription do you have?

plus

What platform is your computer?

_No response_

What issue are you seeing?

Summary

Codex Windows App appears to open a WSL workspace path, but the agent runtime remains Windows native. As a result, exec_command tries to start Linux shell paths such as /bin/bash or /bin/sh through Windows CreateProcess, which fails with No such file or directory (os error 2).

Environment

  • Windows 11 Home
  • WSL2 Ubuntu-24.04
  • Codex Windows App: 26.601.2237.0
  • Codex CLI in WSL: 0.136.0
  • WSL project path:

\\wsl.localhost\Ubuntu-24.04\home\john\projects\codex-wsl-smoke

What works

PowerShell can call WSL successfully:

wsl.exe -d Ubuntu-24.04 --cd /home/john/projects/codex-wsl-smoke -e bash -lc 'pwd; whoami; uname -a; command -v bash; command -v sh; echo shell_ok'

Expected output is produced successfully from WSL:

/home/john/projects/codex-wsl-smoke
john
Linux ...
/usr/bin/bash
/usr/bin/sh
shell_ok

WSL Codex CLI also works normally inside the same WSL environment.

Windows native sandbox was previously broken but has been repaired. The Codex Windows App can now run PowerShell commands in a Windows native smoke project:

C:\codex-native-smoke

For example:

Get-Location
whoami

This succeeds and runs as the Codex sandbox user.

Problem

Codex Windows App opens the WSL workspace:

\\wsl.localhost\Ubuntu-24.04\home\john\projects\codex-wsl-smoke

But a self-check inside the Codex Windows App shows that the runtime is still Windows:

platform: win32
Windows_NT
user: John
bash not found
sh not found

At the same time, exec_command attempts to start Linux shell paths:

/bin/bash
/bin/sh

Because those are launched by Windows CreateProcess, the result is:

No such file or directory (os error 2)
bash not found
sh not found

Expected behavior

When Codex Windows App is configured for WSL / Ubuntu-24.04 and opens a WSL workspace, the agent runtime should run inside Ubuntu-24.04 and see:

/usr/bin/bash
/usr/bin/sh
Linux ...

It should not run as Windows_NT while trying to execute /bin/bash.

Actual behavior

The workspace path is WSL UNC, but the agent runtime remains Windows native:

workspace: \\wsl.localhost\Ubuntu-24.04\home\john\projects\codex-wsl-smoke
runtime: Windows_NT / win32
shell attempted: /bin/bash or /bin/sh
error: No such file or directory (os error 2)

Additional context

I have already confirmed this is not a repository-specific issue:

  • It reproduces in an empty WSL smoke project.
  • It is not caused by the main project repository.
  • WSL itself works from PowerShell.
  • WSL Codex CLI works normally.
  • Windows native sandbox now works after repairing the Codex sandbox setup.
  • The remaining failure appears to be WSL agent / workspace binding: Codex Windows App opens a WSL UNC path but keeps the agent runtime on Windows.

Request

Please check whether Codex Windows App is correctly binding WSL workspaces to the WSL agent runtime. The current behavior suggests that the App recognizes the WSL workspace path but does not actually switch the execution backend from Windows native to Ubuntu-24.04.

What steps can reproduce the bug?

Feedback ID: 019e8c49-7304-7910-9636-2fe3eb80273c

What is the expected behavior?

_No response_

Additional information

_No response_

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.

  • #26030
  • #25799
  • #25280

Powered by Codex Action

daniel-a-diaz · 2 months ago

I ran into this same problem and the simple solution was to simply SSH into WSL with Connections in Settings and it worked perfectly, and then I just just switched everything back to Windows and Powershell. There also wasn't any lag compared to when it tried to run everything through wsl.exe -d Ubuntu-24.04. I already had Codex CLI installed in WSL and it loaded all my sessions from there.

Just add this to your .ssh/config in Windows and it should pop up under SSH in Connection in the Settings.

Host wsl
  HostName localhost
  Port 2222
  User <username>
  IdentityFile ~/.ssh/id_ed25519
  IdentitiesOnly yes