Windows app hard-codes /usr/bin/bash, preventing WSL agent from running on NixOS

Open
#34,456 0 comments 0 reactions 0 assignees View on GitHub

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

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

app bug windows-os
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?
  1. Install a NixOS WSL2 distribution.
  2. Install bash and codex normally through the NixOS configuration.
  3. Confirm that bash and codex are on PATH, but /usr/bin/bash is absent.
  4. In the Windows Codex app, select WSL as the agent environment and choose the NixOS distribution.
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.