Windows sandbox: CreateProcessAsUserW failed: 5 - unfixable on Windows 11 Enterprise (Dell)
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.602.40724 • Released Jun 5, 2026
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Environment
- Codex version: 0.137.0-alpha.4
- OS: Windows 11 Enterprise 25H2 (Build 26200.8524)
- Hardware: Dell laptop
- Subscription: Pro (Monthly)
Error
windows sandbox: CreateProcessAsUserW failed: 5
windows sandbox: setup refresh failed with status exit code: 1
windows sandbox: CreateProcessWithLogonW failed: 1326
Local PowerShell cannot be launched by the Codex sandbox on
Windows 11 Enterprise (Dell hardware). Every attempt to run
any local shell command fails immediately with:
windows sandbox: CreateProcessAsUserW failed: 5
The sandbox runner fails before PowerShell even starts.
This makes it impossible to use any local execution features
in Codex including running commands, git operations, npm,
local dev server, or BrowserStack local testing.
The issue persists after exhaustive troubleshooting including
uninstalling McAfee, enabling Windows Sandbox, adjusting
security policies, recreating the CodexSandboxOffline account,
and clean reinstalling Codex multiple times.
Sandbox log error
setup error: helper_sid_resolve_failed: resolve SID for offline
user CodexSandboxOffline failed: LookupAccountNameW failed: 1332
What works
- GitHub connector works fine
- GitHub Actions runs successfully
- apply_patch works
- Everything except local shell execution
Request
Please provide either a fix or a supported way to run
Codex without the Windows sandbox on consumer Dell hardware.
What steps can reproduce the bug?
- Uninstalled McAfee completely using MCPR tool
- Ran as Administrator - did not fix
- Granted file permissions via icacls on entire Codex folder
- Added registry MitigationOptions for codex.exe, node.exe,
codex-command-runner.exe, codex-windows-sandbox-setup.exe
- Exported and edited security policy to add SeAssignPrimaryTokenPrivilege
for CodexSandboxOffline account SID
- Enabled Windows Sandbox feature (Containers-DisposableClientVM)
- Enabled VirtualMachinePlatform and HypervisorPlatform
- Disabled Memory Integrity (Core Isolation) in Windows Security
- Disabled vGPU sharing via registry (AllowVGPU = 0)
- Verified BIOS - Intel VT and VT for Direct I/O both ON
- Deleted and recreated CodexSandboxOffline account multiple times
- Deleted and regenerated .sandbox-secrets/sandbox_users.json
- Updated SeAssignPrimaryTokenPrivilege with correct SID after
each account recreation
- Clean reinstall of Codex multiple times
- Upgraded Windows from Home to Enterprise
- Switched Agent Environment from Windows Native to WSL
- Installed WSL2 with Ubuntu and PowerShell 7.6.2
- Multiple reboots throughout
What is the expected behavior?
Expected Behavior
When asking Codex to run a local PowerShell command (e.g.,
"test local PowerShell" or "show how the site looks on mobile"),
Codex should be able to launch a local PowerShell process through
its sandbox runner and return the command output.
Actual Behavior
Codex fails before PowerShell even starts. The sandbox runner
cannot create the process and returns:
windows sandbox: CreateProcessAsUserW failed: 5
No commands ever execute. The failure happens at the process
creation layer, not at the command level.
Impact
Unable to use any local shell execution features including:
- Running PowerShell commands
- Running npm, git, or other local tools
- Local dev server
- BrowserStack local testing
- Any file system operations via shell
All local execution has been rerouted through GitHub Actions
as a workaround, which works but is significantly slower.
Additional information
Additional Information
- This issue began when asking Codex "how does the site look
on mobile" - which triggered local BrowserStack testing
- The CodexSandboxOffline account was successfully created and
logged in (confirmed in Windows Security Event Log), but
CreateProcessAsUserW still failed with error 5
- Windows Sandbox app itself also fails independently with
"The connection to the Windows Sandbox environment was lost"
suggesting a deeper system-level conflict on Dell hardware
- Switching Agent Environment to WSL in Codex settings and
installing PowerShell in WSL is the current workaround
being tested
- Other users reporting same error on GitHub:
Issues #19189, #10090, #22428, #25436, #14211
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Can you replicate it on CLI ,,
or is it only the desktop app ---
reminder you can use Codex , using the VSCODE ide from their extention - if you are having issues with the Codex Desktop app
+1
+1 when trying to get the in-app browser to take a screenshot of the app.
Hi @a1bailbonds, i had this same issue, and I asked codex to investigate this itself, and after changing config.toml
FROM
[windows]
sandbox = "elevated"
TO
[windows]
sandbox = "unelevated"
In-app browser was fixed for me. Maybe it works for you as well
(I am using Version 26.611.61753 • Released 17 June 2026)
Can confirm this worked for me, but I also was missing the version of power shell that was used by codex. Might have been this that fixed or a combination of both.
Power shell 7.6.2, then set the path on the config.toml on the node.repl env.
Although I also solved it this way, I think there may be side effects from this setting, such as permissions, etc. It's not clear yet.
Is this still relevant - the widnows-app had a serious of big overhual
@willray88 @russ0133 @a1bailbonds
is this still happen (update codex to the latest version - using the , offcial openai windows internet page )