codex - 💡(How to fix) Fix --add-dir of /dev directories doesn't seem to work for the sandbox [1 comments, 2 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#18204Fetched 2026-04-17 08:31:23
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1unlabeled ×1

Root Cause

I'm guessing that this needs a "--dev-bind" in bubblewrap because bubblewrap maps a "fake" /dev into the sandbox.

Code Example

$ bwrap --ro-bind / / --dev /dev /bin/ls /dev/dri
ls: cannot access '/dev/dri': No such file or directory

---

$ bwrap --ro-bind / / --dev /dev --dev-bind /dev/dri /dev/dri /bin/ls /dev/dri
by-path  card0  card1  renderD128  renderD129
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.121.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.4

What platform is your computer?

Linux 6.19.6-arch1-1 x86_64 unknown

What terminal emulator and version are you using (if applicable)?

konsole 25.12.3

What issue are you seeing?

I'm trying to make the model be able to test-run my graphics application For that I need access to /dev/dri as that contains the HW files, but mapping those into the sandbox doesn't seem to work.

What steps can reproduce the bug?

Run codex --add-dir /dev --add-dir /dev/dri and ask the model to "ls /dev/dri" (or similar commands, like "strace vulkaninfo" if you have relevant GPUs).

What is the expected behavior?

The model can access /dev/dri to execute graphics applications.

Additional information

I'm guessing that this needs a "--dev-bind" in bubblewrap because bubblewrap maps a "fake" /dev into the sandbox.

e.g. looking at "codex-rs/linux-sandbox/src/bwrap.rs", you might get something like

$ bwrap --ro-bind / / --dev /dev /bin/ls /dev/dri
ls: cannot access '/dev/dri': No such file or directory

while

$ bwrap --ro-bind / / --dev /dev --dev-bind /dev/dri /dev/dri /bin/ls /dev/dri
by-path  card0  card1  renderD128  renderD129

extent analysis

TL;DR

The issue can likely be resolved by using the --dev-bind option with bubblewrap to map the /dev/dri directory into the sandbox.

Guidance

  • The problem seems to be related to the sandboxing mechanism used by Codex CLI, which prevents access to /dev/dri by default.
  • To verify the issue, run the command codex --add-dir /dev --add-dir /dev/dri and ask the model to execute a command that requires access to /dev/dri, such as ls /dev/dri or strace vulkaninfo.
  • The --dev-bind option can be used with bubblewrap to map the /dev/dri directory into the sandbox, as shown in the example: bwrap --ro-bind / / --dev /dev --dev-bind /dev/dri /dev/dri /bin/ls /dev/dri.
  • To mitigate the issue, you can try modifying the codex-rs/linux-sandbox/src/bwrap.rs file to include the --dev-bind option when running the sandbox.

Example

bwrap --ro-bind / / --dev /dev --dev-bind /dev/dri /dev/dri /bin/ls /dev/dri

This command maps the /dev/dri directory into the sandbox and executes the ls command to list the contents of /dev/dri.

Notes

The solution assumes that the --dev-bind option is supported by the version of bubblewrap used by Codex CLI. If this option is not available, alternative solutions may need to be explored.

Recommendation

Apply workaround: use the --dev-bind option with bubblewrap to map the /dev/dri directory into the sandbox, as this seems to be the most direct solution to the issue.

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 --add-dir of /dev directories doesn't seem to work for the sandbox [1 comments, 2 participants]