codex - 💡(How to fix) Fix Windows: Sandbox cannot spawn any process (all commands fail with exit code -1073741502) [2 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#20346Fetched 2026-05-01 05:43:51
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×5commented ×2

Codex cannot execute any commands in sandbox mode on Windows.

All commands fail immediately with exit code: -1073741502

Even the simplest commands do not work: whoami Get-Location cmd /c whoami

Root Cause

Codex cannot execute any commands in sandbox mode on Windows.

All commands fail immediately with exit code: -1073741502

Even the simplest commands do not work: whoami Get-Location cmd /c whoami

RAW_BUFFERClick to expand / collapse

What version of the IDE extension are you using?

26.422.71525

What subscription do you have?

ChatGPT Plus

Which IDE are you using?

VS Code (Remote-SSH)

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What issue are you seeing?

Description

Codex cannot execute any commands in sandbox mode on Windows.

All commands fail immediately with exit code: -1073741502

Even the simplest commands do not work: whoami Get-Location cmd /c whoami

Actual Behavior

All commands fail instantly with exit code -1073741502.

It appears that the sandbox cannot spawn any process at all.

Expected Behavior

Commands should execute normally inside the sandbox environment.

Additional Context

  • Commands run normally when executed manually in PowerShell
  • Commands also work when using escalated (non-sandbox) execution
  • The issue occurs consistently for all commands
  • Workspace is located on a non-system drive (F:)

Impact

Codex is unable to execute any commands in sandbox mode, making it unusable for workflows that rely on command execution on Windows.

What steps can reproduce the bug?

Steps to Reproduce

  1. Open VS Code with Codex extension

  2. Connect to a Windows environment (Remote-SSH or local)

  3. Open a workspace located on a non-system drive (e.g., F:)

  4. Ask Codex to execute a simple command in sandbox mode, such as: whoami or Get-location

  5. Observe that the command fails immediately

Result

  • Command fails with exit code: -1073741502
  • No output is produced

Expected Result

  • Command should execute successfully and return output

Additional Notes

The issue disappears when using escalated execution, which suggests the problem is specific to the sandbox environment on Windows.

What is the expected behavior?

Commands should execute successfully in sandbox mode on Windows.

Even basic commands such as:

whoami
Get-Location
cmd /c whoami

should return normal output without errors.

The sandbox should be able to spawn processes correctly and behave consistently with manual execution in PowerShell.

Additional information

Additional Information

  • OS: Windows 10 22H2 (build 19045, x64)
  • IDE: VS Code (Remote-SSH)
  • Workspace location: F:\ (non-system drive)

Observations

  • The issue occurs only in sandbox mode
  • Escalated execution works correctly
  • Commands run instantly when executed manually in PowerShell
  • The failure happens before command execution (process spawn failure)

Notes

This may be related to:

  • Windows sandbox process spawning issues
  • Permission / ACL handling on non-system drives
  • Known instability of sandbox on Windows environments

This issue makes Codex sandbox mode unusable on Windows unless escalated execution is used.

extent analysis

TL;DR

The issue can be potentially resolved by investigating Windows sandbox process spawning issues or permission/ACL handling on non-system drives, and considering escalated execution as a temporary workaround.

Guidance

  • Investigate Windows-specific issues with sandbox process spawning, as the problem seems isolated to the sandbox environment on Windows.
  • Review permission and ACL settings on the non-system drive (F:) where the workspace is located, as this might be contributing to the failure.
  • Consider using escalated execution as a temporary workaround, given that it works correctly.
  • Verify if the issue persists when the workspace is located on a system drive (e.g., C:), to isolate if the problem is drive-specific.

Example

No specific code snippet can be provided without further details on the Codex extension's internal workings or the exact commands being executed in the sandbox environment.

Notes

The solution may involve deeper investigation into Windows system settings, security policies, or the Codex extension's handling of sandbox environments on Windows. The issue's description suggests a potential problem with how processes are spawned within the sandbox or how permissions are handled, but without more specific technical details, a precise fix cannot be determined.

Recommendation

Apply the escalated execution workaround until the root cause of the sandbox mode issue on Windows is identified and addressed, as it allows for continued use of Codex for workflows that rely on command execution.

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