Skip to content

Windows + WSL: agent shell execution fails with os error 2 after desktop app update #49904

Closed

Description

@dpunish3r

What version of the Codex App are you using (From “About Codex” dialog)?

26.928.31416

What subscription do you have?

Pro

What platform is your computer?

Microsoft Windows NT 10.0.26300.0 x64

What issue are you seeing?

Summary

I was working normally in an existing WSL project using the latest available Windows desktop app version. After installing the September 30, 2026 update, agent shell execution stopped working in that same project, blocking further work.

Installing another available update on October 1 did not resolve the issue.

Environment

  • App version shown in About: 26.928.31416
  • Windows installed package version: 26.928.3736.0
  • Agent environment: Windows Subsystem for Linux
  • Integrated terminal shell: PowerShell
  • Project location: inside the WSL filesystem
  • Feedback ID: 01a0f609-2149-71d0-b186-326e50016889

Error

Even a minimal command such as pwd fails before execution:

exec_command failed: CreateProcess {
  message: "Rejected(\"Failed to create unified exec process: No such file or directory (os error 2)\")"
}

Checks already performed

  • Fully restarting the desktop app did not resolve the issue.

  • Creating a new chat did not resolve the issue.

  • Explicitly setting the shell to /bin/bash, the working directory to /tmp, and login: false produces the same error.

  • WSL and Bash work independently. Running the following command from an external Windows PowerShell session succeeds and prints the working directory:

    wsl.exe --exec /bin/bash -lc 'pwd'
    

Impact

The agent cannot execute even basic shell commands, preventing normal repository work through the desktop app.

Possibly related issues

These reports describe similar symptoms, but I have not confirmed that my failure has the same root cause.

What steps can reproduce the bug?

  1. Work in an existing WSL project using the Windows desktop app, running the latest available app version before the September 30 update. Agent shell commands work normally.
  2. Install the app update available on September 30, 2026.
  3. Continue working in the same project that was already open.
  4. Ask the agent to execute a command, even something as simple as pwd.
  5. Execution fails before the command starts with:
    "Failed to create unified exec process: No such file or directory (os error 2)"

Another update became available on October 1, but installing it did not resolve the issue.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    app
    on Oct 1, 2026
  2. added
    bug
    windows-os
    tool-calls
    on Oct 1, 2026
  3. peter-pertech commented on Oct 1, 2026

    @peter-pertech

    I can confirm the same issue with Codex Desktop 26.928.31416
    on Windows using Debian under WSL 2.

    Agent environment and integrated terminal shell are both set to WSL.
    Everything worked normally before I updated the app this morning
    (October 1, 2026). The issue started immediately after that update,
    without any changes to my config.toml.

    Agent commands fail with:
    “Failed to create unified exec process:
    No such file or directory (os error 2)”

    Checks performed:

    • Full Windows restart: no improvement.
    • New chat in the existing WSL project: same error.
    • Explicit /bin/bash: same error.
    • New chat with Full Access: same error.
    • External WSL commands work and can access the project directory.

    I did not change config.toml before the issue started.
    Full Access does not resolve it, so custom permissions do not
    appear to be the cause.

  4. vchinchevoy commented on Oct 1, 2026

    @vchinchevoy

    как временное решение.
    Мне удалось продолжить работу сказав кодексу:

    Все shell-команды, которые внутри sandbox падают с No such file or directory (os error 2), выполняй вне sandbox с повышенными разрешениями. Во всех таких случая пиши об этом сообщение. Если требуется подтверждение — запрашивай его.

  5. peter-pertech commented on Oct 1, 2026

    @peter-pertech

    This workaround works for me.

    Explicitly retrying with sandbox_permissions="require_escalated" allowed the agent to execute commands and access my WSL files again.

    Interestingly, a new chat with the Full Access profile still failed, while explicitly requesting execution outside the sandbox succeeded.

    The instruction I used:
    If a shell command fails inside the sandbox with ‘No such file or directory (os error 2)’, retry it with sandbox_permissions='require_escalated'. Briefly announce the retry and request approval through the tool if needed.

  6. dpunish3r commented on Oct 7, 2026

    @dpunish3r
    Author

    Still reproducible after several app updates.

    Current Windows desktop app: 26.1002.51308 (build 13417).
    Retested on October 7, 2026, with the agent running in WSL and normal sandbox permissions (workspace-write), without elevation.

    Running pwd with TTY enabled fails before the command starts:

    Failed to create unified exec process: Unable to spawn
    /mnt/c/Users/<user>/.codex/tmp/arg0/codex-arg0GDUIze/codex-linux-sandbox
    because it doesn't exist on the filesystem
    (ENOENT: No such file or directory).

  7. MisumiUika626 commented on Oct 11, 2026

    @MisumiUika626

    Confirming on October 11, 2026 that poroburu's active-helper-directory workaround in #25799 restored sandboxed shell execution in my current Desktop session. These diagnostics and the local recovery were performed with Codex assistance.

    Environment:

    • Desktop version reported by the app update tool: 26.1007.21434
    • Windows package version visible in the running plugin process path: 26.1007.2314.0
    • Bundled WSL runtime: codex-cli 0.162.0-alpha.17.2
    • Ubuntu 22.04.5 LTS, WSL2 kernel 6.18.33.2-microsoft-standard-WSL2
    • Workspace on the native WSL filesystem under /home/<user>/workspace

    Before recovery, a default sandboxed pwd && whoami && command -v bash failed before the shell started with Failed to create unified exec process: No such file or directory (os error 2). The same check succeeded with sandbox_permissions="require_escalated". Standalone Codex CLI also worked in the same workspace.

    The useful distinction was the helper directory actually referenced by the live WSL app-server, rather than any visible codex-arg0* directory:

    1. Inspecting the live app-server's executable and open file descriptors identified a reference to <desktop CODEX_HOME>/tmp/arg0/codex-arg0<active-id>/.lock.
    2. That directory was absent from the on-disk listing. A different directory contained all four Linux helper aliases, but default execution still failed.
    3. We recreated only the directory referenced by the live app-server and added apply_patch, applypatch, codex-execve-wrapper, and codex-linux-sandbox, pointing to the bundled executable identified through that process's /proc/<pid>/exe. We did not recreate or overwrite its lock file.
    4. Immediately afterward, the same check succeeded without escalation:
      /home/<user>/workspace
      <user>
      /usr/bin/bash
      
    5. A subsequent default-sandbox check also succeeded. Its process command line explicitly used codex-linux-sandbox from the reconstructed active directory.

    No project or Codex configuration files were changed; recovery modified only that temporary helper directory.

    This corroborates the previously reported missing active-helper-path failure condition on this build. A complete helper directory elsewhere in tmp/arg0 is not sufficient evidence that the live app-server's helper path is healthy. This is a reproduction and validation of the existing workaround, not an independently discovered fix.

    I have not identified which process removed the directory, established the complete root cause, or tested whether recovery survives an app restart. Node REPL/browser recovery was not tested.

  8. peter-pertech commented on Oct 14, 2026

    @peter-pertech

    Update on October 14, 2026: this issue still reproduces on my Windows + Debian WSL2 setup after updating the desktop app to 26.1007.71326.

    Local inspection confirmed that the running desktop-managed WSL app-server still uses codex-cli 0.162.0-alpha.17.2. Its open .lock file descriptor references a helper directory under the legacy tmp/arg0 path that is missing from disk. Sandboxed shell execution still fails with os error 2; explicitly retrying with sandbox_permissions="require_escalated" continues to work.

    There appears to be a relevant upstream fix:

    The change separates Windows and Linux helper directories, which appears to address the failure observed here. However, the runtime currently used by my updated desktop app does not yet contain it.

    Hopefully this will reach a desktop production update soon. Could a maintainer confirm which desktop version will bundle the fix?

  9. peter-pertech commented on Oct 16, 2026

    @peter-pertech

    Following up on my October 14 comment: the issue is now resolved on my Windows + Debian WSL2 setup after updating the desktop app to 26.1013.31256.

    Local verification confirmed:

    • The desktop-managed WSL runtime now reports codex-cli 0.163.0-alpha.10.2, which includes PR #53412, commit 16845bb.
    • The active helper directory now uses tmp/arg0-linux, and its codex-linux-sandbox symlink exists and resolves to the active runtime.
    • Repeated shell commands and file operations succeeded with normal sandbox permissions, without require_escalated. Tests included creating, reading, modifying, appending, renaming, copying and deleting files and directories under /tmp, plus workspace file access.
    • Tests remained successful after restarting the app and WSL together, and again after a full Windows reboot.

    No manual helper repair or bind-mount workaround was applied. The explicit escalation workaround I previously used is no longer needed.

    Thanks @jif-oai for the fix!

    One piece of feedback on discoverability: This issue prevented normal sandboxed execution in my setup. To find out whether a desktop update included the fix, I had to piece together information from several issues, the fix PR and CLI release tags. In the 0.163.0 release notes, #53412 appears in the full changelog but is not described in the Bug Fixes summary.

    A short resolution note on the affected issues, linking the fix and identifying a desktop version that includes it, would make it much easier for users to know when to update and retire their workarounds.

  10. dpunish3r commented on Oct 16, 2026

    @dpunish3r
    Author

    Confirmed working after updating to Windows desktop app version 26.1013.31256 (build 20586).

    Retested pwd with the agent running in WSL, using normal sandbox permissions (workspace-write), without elevation or any workaround. The command completed successfully with exit code 0. The previous codex-linux-sandbox ENOENT error no longer occurs.

    Thanks for fixing this!

  11. sbviltd commented on Oct 16, 2026

    @sbviltd

    Confirmed as above! Thank you!

  12. MisumiUika626 commented on Oct 19, 2026

    @MisumiUika626

    Confirmed working on Windows Codex Desktop 26.1013.4894.0 with WSL.

    Shell execution, Python execution, temporary file operations, and sandbox execution after a full desktop restart all succeeded without elevation. The previous os error 2 issue is no longer reproducible on my setup.

    Thanks to everyone involved in investigating and fixing this!

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

    appbugtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions