Skip to content

VS Code Codex extension sandbox makes writable devcontainer workspace appear read-only in Linux #14794

Description

@gpuzio

What version of the IDE extension are you using?

26.311.21342

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Linux 6.17.0-19-generic x86_64 x86_64

What issue are you seeing?

Summary

After reinstalling the Codex VS Code extension, workspace-write no longer allows writes to the workspace inside a Linux devcontainer.

The workspace is writable outside the Codex sandbox, and Docker reports it as a normal RW bind mount, but inside the Codex sandbox writes fail with Permission denied.

This looks like a sandbox/runtime issue in the extension rather than a repo or filesystem permission problem.

Environment

  • Codex VS Code extension: 26.311.21342
  • Linux
  • VS Code Remote Containers / devcontainer
  • Container user: root

Expected behavior

With workspace-write, Codex should be able to write to the workspace path.

Actual behavior

Inside Codex:

  • reading files in the workspace works
  • writing to the workspace fails with Permission denied
  • writing to /tmp works

Outside Codex sandbox:

  • writing to the same workspace path works normally

Minimal repro

Inside a Codex session:

touch /workspaces/project/.sandbox-write-test


### What steps can reproduce the bug?


1. Open a Linux devcontainer in VS Code with the Codex extension enabled.
2. Start a Codex session using the default sandbox mode (`workspace-write`).
3. In the Codex session, try to write a file into the workspace, for example:

touch /workspaces/project/.sandbox-write-test

4. Observe that the write fails with:

touch: cannot touch '/workspaces/project/.sandbox-write-test': Permission denied

5. In the same environment, try writing to `/tmp`:

touch /tmp/.sandbox-write-test

6. Observe that writing to `/tmp` works.
7. Outside the Codex sandbox but inside the same container, writing to the workspace also works normally.

### What is the expected behavior?

What is the expected behavior?

Codex with `workspace-write` should be able to write to the workspace directory inside the devcontainer.

Additional information

This started after reinstalling the Codex VS Code extension.

Environment:
- Codex VS Code extension: `26.311.21342`
- Linux
- VS Code Remote Containers / devcontainer
- container user: `root`

What I verified:
- Reading files from the workspace works inside Codex.
- Writing to `/tmp` works inside Codex.
- Writing to the workspace fails only inside Codex sandbox.
- Outside Codex sandbox, the workspace is writable normally.
- Docker shows the workspace as a normal RW bind mount.
- Outside Codex sandbox, mount info also shows the workspace as RW.

Important diagnostic detail:
Inside the Codex sandbox, the workspace appears to be mounted twice on the same target:
- one mount is `ro`
- one mount is `rw`

Also, `.git` appears as a separate `ro` mount.

Outside the Codex sandbox, this duplicate `ro` + `rw` mount view does not appear. That suggests the incorrect mount layout is being introduced by the Codex sandbox layer rather than by Docker or the repository itself.

Additional repro:
Running the following also fails:

codex sandbox linux touch /workspaces/project/.manual-sandbox-test

with:

bwrap: loopback: Failed to create NETLINK_ROUTE socket: Operation not permitted


### Additional information


Suspected cause:
This looks like a regression in the Codex VS Code extension sandbox/runtime for Linux devcontainers, where the sandbox constructs an incorrect mount namespace for the workspace and effectively treats a writable workspace as read-only.

Possibly related issues:
- #4390
- #5034
- #5041

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextensionIssues related to the VS Code extensionsandboxIssues related to permissions or sandboxing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions