Bubblewrap sandbox fails inside container for commands on bind-mounted host paths
What version of Codex CLI is running?
v0.115.0
What subscription do you have?
Plus
Which model were you using?
gpt-5.4 medium
What platform is your computer?
Linux 5.15.0-76-generic x86_64 x86_64
What terminal emulator and version are you using (if applicable)?
_No response_
What issue are you seeing?
On a shared filesystem without sudo, I run Codex CLI inside an Apptainer container (1.4.1) to restrict Codex read access to the host.
Since Codex 0.115.0, reading a file from a bind-mounted path into the container fails before file access with a bubblewrap error.
This does not occur with Codex 0.114.0, so it appears related to the Linux sandbox change in 0.115.0, where bubblewrap became the default on Linux (#13996, @viyatb-oai).
What steps can reproduce the bug?
- Start an Apptainer container with a bind-mounted host directory.
- Start Codex CLI inside the container.
- Ask Codex to read a file in the bind-mounted directory.
- Observe that the command fails before file access with:
bwrap: Can't bind mount /oldroot/ on /newroot/: Unable to mount source on destination: Invalid argument
Running the same read through Codex CLI’s ! shell escape succeeds.
What is the expected behavior?
_No response_
Additional information
A native way to restrict Codex CLI filesystem read access, as discussed in #2847, would provide a workaround by allowing Codex to run directly on the host without relying on nested container sandboxing for read isolation.
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Can confirm that this is happening at my end too. codex-cli 0.115.0
I'm hitting the same issue with
0.115.0This is an issue for linux users:
<img width="549" height="127" alt="Image" src="https://github.com/user-attachments/assets/200ca155-f194-4bc7-85a8-526d3c31b6da" />
@loicgasser This should be fixed in Codex 0.117.0 by https://github.com/openai/codex/pull/15693, which fixes compatibility with older system bubblewrap versions that do not support --argv0.
Please update to 0.117.0 and let us know if you're still seeing this.
@viyatb-oai: The problem still exists: in
v0.122.0, it's possible to run Codex CLI in a container with the legacy landlock, but not with the bwrap sandbox (then, bind-mounts to the host don't work). However, the legacy landlock will be discontinued soon. Why was the issue closed?+1 on the above , bwrap doesn't seem to work when the root is overlayfs backed
with errors like. Adding explicit sandbox mounts and permissions like below works but it is still tedious to add the paths I care about.