Skip to content

WSL sandbox blocked by missing arg0 launcher, then missing bubblewrap (verified recovery) #50347

Open

Description

@Adam-Ososki

Summary

Codex Desktop on Windows, configured to run the agent and integrated terminal in WSL, could not execute even pwd. Restarting the app changed the missing helper-directory suffix but reproduced the same failure.

This appears related to #49731 and #49789. This report adds a second independently verified blocker: after restoring the Linux sandbox launcher, the bundled backend panicked because neither a bundled nor system bwrap existed.

Submitted at the affected user's request. Personal names, project paths, credentials, and session transcripts are omitted.

Verified environment

  • Windows package OpenAI.Codex: 26.928.2636.0 (Get-AppxPackage).
  • Desktop-bundled WSL backend: codex-cli 0.159.2.
  • Ubuntu 24.04.2 LTS; WSL distribution Ubuntu.
  • Kernel: 6.18.33.2-microsoft-standard-WSL2.
  • Project stored on the Linux filesystem.
  • Desktop's CODEX_HOME is Windows-backed: /mnt/c/Users/<user>/.codex.
  • Installed WSL backend directory contained codex and codex-code-mode-host, with no codex-resources/bwrap.
  • Initially no system bubblewrap package or /usr/bin/bwrap.

Reproduction and observations

  1. Open a WSL project with the agent configured for WSL.
  2. Normal exec_command, with and without a PTY and with explicit /bin/sh or /bin/bash, fails before the shell starts.
  3. Without PTY:
    Failed to create unified exec process: No such file or directory (os error 2)
  4. With PTY:
    Unable to spawn /mnt/c/Users/<user>/.codex/tmp/arg0/codex-arg0<id>/codex-linux-sandbox because it doesn't exist on the filesystem (ENOENT: No such file or directory)
  5. The live WSL agent retains fd 3 referencing the missing helper directory's .lock. The visible shared arg0 directory contains a different directory with only .lock, apply_patch.bat and applypatch.bat.
  6. Full app close/reopen creates a new missing Linux helper path and reproduces the failure.
  7. Individually approved execution outside the sandbox succeeds, confirming that the Linux shell and project exist. This alone does not establish sandbox recovery.

The deleting process was not traced locally. Windows cleanup attribution is supported by evidence in #49731, but remains unproven for this particular installation.

Verified local recovery

  1. Bind-mounted a user-owned Linux filesystem directory over only the WSL view of CODEX_HOME/tmp/arg0, isolating it from the Windows-visible directory.
  2. Recreated the current session's missing helper symlinks to the same installed WSL Codex executable.
  3. Retrying normal sandboxed execution reached the launcher, but then failed with:
    bubblewrap is unavailable: no system bwrap was found on PATH and no bundled codex-resources/bwrap binary was found next to the Codex executable
  4. Installed Ubuntu's signed bubblewrap package 0.9.0-1ubuntu0.3.
  5. Normal exec_command then succeeded without require_escalated: pwd, repository file listing, reading a file, and a temporary workspace write.
  6. A test write outside the workspace was denied with Read-only file system, confirming sandbox enforcement remains active.
  7. Verified Windows and WSL see different launcher-directory contents after the bind mount.
  8. Added a backed-up fstab entry; systemd reports the generated mount unit loaded and active. Persistence across a subsequent WSL restart has not yet been tested.

No sandbox policy was disabled, no credentials or session databases were changed, and no project source files were changed. This is a locally verified workaround, not an upstream fix.

Request

Please address shared Windows/WSL helper-directory cleanup, detect/recover missing live-agent helpers, and ensure the Desktop WSL backend provides or checks its bubblewrap dependency. A working bash and WSL configuration currently still produce opaque pre-execution failures.

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    on Oct 2, 2026
  2. enjibby commented on Oct 6, 2026

    @enjibby

    Additional reproduction and verified local recovery on 6 October 2026, submitted at the affected user's request.

    Environment:

    • Windows desktop package OpenAI.Codex 26.930.4958.0.
    • Desktop-bundled WSL backend codex-cli 0.160.0.
    • Ubuntu 24.04.1 LTS, WSL2 kernel 6.18.33.2-microsoft-standard-WSL2, Linux architecture aarch64.
    • Linux-native project; desktop CODEX_HOME is /mnt/c/Users/<windows-user>/.codex.
    • System /usr/bin/bwrap already installed, version 0.9.0.

    Before recovery:

    • Normal exec_command with true, explicit /bin/bash or /bin/sh, and either the project directory or /tmp, failed before shell startup with Failed to create unified exec process: No such file or directory (os error 2).
    • Individually approved execution outside the sandbox succeeded. Direct Bubblewrap execution in the same project succeeded.
    • Fully restarting the desktop app changed the code-mode host's random tmp/arg0/codex-arg0<id> PATH entry, but that directory was again absent. The shared visible arg0 root contained a different directory with only .lock, apply_patch.bat, and applypatch.bat.
    • We did not trace the deleting process, so Windows cleanup remains a suspected cause rather than a locally proven attribution.

    Verified recovery:

    1. Backed up the original Windows launcher files and /etc/fstab. Active Windows .lock files could not be read and were excluded from the backup.
    2. Bind-mounted a user-owned native Linux arg0 directory over only the WSL view of CODEX_HOME/tmp/arg0. Windows and WSL then showed different directory contents.
    3. Recreated the active session's four helper symlinks to the same installed WSL backend, with a temporary Linux lock holder that exits when that backend process ends.
    4. Normal sandboxed commands then passed: project pwd, README read, temporary workspace file creation/read/removal.
    5. Creating a temporary file under two existing user-writable directories outside the permitted roots failed with EROFS (errno 30), confirming filesystem sandbox enforcement remained active.
    6. Added a uniquely marked fstab entry using bind,nofail,x-systemd.requires-mounts-for=/mnt/c; configuration validation passed and the generated systemd mount unit is loaded and active. A full WSL restart has not yet been tested.

    No sandbox policy was disabled. No dependency installation was needed here. A separate Node initialization error remains and is being reported on #42924.

    Please fix helper lifecycle isolation/recovery for Windows and WSL processes sharing a Codex home, including detecting an absent cached launcher before process creation. A manual runtime mount should not be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions