Windows app hard-codes /usr/bin/bash, preventing WSL agent from running on NixOS
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- linux, shell
- Domain
- cli, operating-systems
Research direction
Start by reproducing the WSL launch command shown in the issue on a NixOS distribution, then locate the Windows app's WSL launcher and inspect how it selects Bash and classifies exit code 127. Done means the app can start Codex in NixOS without requiring a /usr/bin/bash compatibility symlink.
Written by the indexing model from the issue text.
Description
What version of the Codex App are you using?
26.715.7063.0 (Windows x64)
The Codex CLI installed inside NixOS is codex-cli 0.144.4.
What platform is your computer?
Windows with WSL2, using NixOS:
NixOS 26.11.20260718.61b7c44 (Zokor)
What issue are you seeing?
The Windows Codex app cannot start the agent in the NixOS WSL distribution because its WSL launcher hard-codes /usr/bin/bash.
NixOS intentionally does not use the conventional FHS location /usr/bin/bash. Bash is installed and works normally at:
$SHELL=/run/current-system/sw/bin/bash
/bin/bash
/sbin/bash
/run/current-system/sw/bin/bash
The installed Codex app bundle constructs its WSL command in this form:
wsl.exe -d <distribution> -- /usr/bin/bash -lc <command>
It then classifies exit code 127 containing /usr/bin/bash: not found as an unsupported WSL shell. Consequently the Settings flow reports that Codex cannot run in the current WSL distribution even though Bash and the Codex CLI are both installed and functional.
What steps can reproduce the bug?
- Install a NixOS WSL2 distribution.
- Install
bashandcodexnormally through the NixOS configuration. - Confirm that
bashandcodexare onPATH, but/usr/bin/bashis absent. - In the Windows Codex app, select WSL as the agent environment and choose the NixOS distribution.
- Restart the app.
The hard-coded launch fails:
wsl.exe -d NixOS -- /usr/bin/bash -lc 'codex --version'
# bash: line 1: /usr/bin/bash: No such file or directory
Using NixOS's valid Bash path succeeds:
wsl.exe -d NixOS -- /bin/bash -lc 'codex --version'
# codex-cli 0.144.4
What is the expected behavior?
The WSL launcher should not require Bash at the FHS-specific path /usr/bin/bash.
It should resolve bash from the WSL distribution's PATH, use the user's configured login shell, or otherwise discover a supported shell before launching Codex. NixOS WSL should be accepted when Bash and Codex are available.
Workaround
Creating the following compatibility symlink makes the current app launcher work:
/usr/bin/bash -> /bin/bash
This confirms that the hard-coded path is the only blocker in this reproduction.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·