Repository navigation
Windows sandbox setup refresh fails for workspace on \\wsl.localhost UNC path #35380
Description
Summary
The Codex desktop app cannot start any sandboxed shell command when the saved workspace root is a WSL2 UNC path such as \\wsl.localhost\Debian\home\<user>\<repo>.
The failure happens during sandbox preparation, before the requested command starts:
windows sandbox: helper_unknown_error: setup refresh had errors
Environment
- Codex desktop app:
OpenAI.Codex 26.721.4979.0(Microsoft Store package) - Windows build:
26200 - WSL:
2.9.3.0 - WSL kernel:
6.18.35.2-1 - Distribution: Debian, WSL2
bubblewrap:0.11.0- Sandbox mode:
workspace-write - Shell host for the affected thread: PowerShell / Windows-native agent
Steps to reproduce
- Add/open a Git repository located under
\\wsl.localhost\Debian\home\<user>\<repo>in the Windows desktop app. - Start a task using the normal
workspace-writesandbox. - Run a read-only command such as
git status --shortwith that UNC path as the working directory. - The sandbox fails during
setup refreshbefore Git runs. - Retry from
C:\Windowswhile invokingwsl.exe -d Debian --cd /home/<user>/<repo> git status --shortinside the normal sandbox. The same setup-refresh error occurs, apparently because the thread still has the UNC workspace root registered.
Expected behavior
The Windows sandbox should either support the registered WSL UNC workspace root, route the operation through WSL, or provide a specific actionable error directing the user to switch the agent runtime to WSL.
Actual behavior
Every normal sandboxed shell invocation fails with helper_unknown_error: setup refresh had errors, including commands whose explicit working directory is on C:\.
Isolation / workaround
- Restarting both WSL (
wsl --shutdown) and the Codex app does not resolve the issue. wsl --updatereports that the latest WSL version is installed.- The same Git command succeeds with exit code 0 when
wsl.exeis executed outside the Windows sandbox. - The documented workaround is to switch Settings → agent → WSL and restart the app, or keep using explicit approved execution outside the Windows sandbox.
A separate line is sometimes printed after successful out-of-sandbox wsl.exe calls:
[0x...] ANOMALY: meaningless REX prefix used
It does not change the successful exit code and may be unrelated.
Activity
github-actions commentedon Jul 25, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
walter-seethaler commentedon Jul 29, 2026
I reproduced this issue and can add a few details about scope and recovery.
Environment:
10.0.26200.8894C:\...\<repo>directory\\wsl.localhost\Ubuntu-24.04\home\<user>\<repo>Before adding the WSL UNC folder, I ran the following five independent
shell_commandcalls, each explicitly usingsandbox_permissions: "use_default":Get-Date -Format oGet-LocationGet-Content -LiteralPath '.\AGENTS.md' -TotalCount 1git --versioncmd.exe /c verAll five commands completed without escalation and with exit code 0. The Windows sandbox worked normally, and Computer Use could inspect IntelliJ IDEA successfully.
After adding the WSL UNC folder, I repeated the same five commands with the same sandbox settings. All five failed before the requested command started with:
None of these commands accessed the UNC path. Merely registering it as an additional workspace root was sufficient to break the global sandbox refresh. Node REPL and Computer Use then also failed during sandbox startup with the same error.
Recovery behavior:
This directly corroborates the reported WSL UNC trigger and additionally indicates that the failing root configuration or derived sandbox state remains persisted for the existing project/task after the UNC root is removed. A newly created local-only project does not inherit the failure.
walter-seethaler commentedon Aug 25, 2026
Follow-up with direct Win32 API evidence and a current-source check.
I called
GetNamedSecurityInfoWdirectly through a read-only P/Invoke probe usingSE_FILE_OBJECTandDACL_SECURITY_INFORMATION. This bypasses PowerShellGet-Acland does not modify any ACL.Results on one Windows host:
C:\<local-workspace>)0— success\\wsl.localhost\Ubuntu-24.04\home1—ERROR_INVALID_FUNCTION\\wsl.localhost\Debian\home1—ERROR_INVALID_FUNCTION\\wsl.localhost\docker-desktop\tmp1—ERROR_INVALID_FUNCTION\\wsl$\Ubuntu-24.04\home1—ERROR_INVALID_FUNCTION\\wsl.localhost\Ubuntu-24.04\mnt\c\<local-workspace>5—ERROR_ACCESS_DENIEDEnvironment: Windows
10.0.26200.8973, WSL2.3.26.0, kernel5.15.167.4-1; Ubuntu 24.04.4 LTS and Debian 13 run as WSL2 distributions.This narrows the failure to the Windows ACL operation across the WSL UNC provider. It is not introduced by
Get-Acl, not specific to Ubuntu versus Debian, and not specific to the\\wsl.localhostalias. Native Linux paths exposed by the provider reject the DACL query with code 1; even an underlying NTFS path that succeeds throughC:\fails when addressed through the WSL UNC/DrvFs route.The current public source still appears to apply
ensure_allow_write_acesto configured write roots, aggregate any failure intorefresh_errors, hard-fail refresh withsetup refresh had errors, and map that untyped failure toHelperUnknownError:Repository search at that revision found no WSL-UNC, remote-drive, or
FILE_PERSISTENT_ACLSpreflight in this path. A safe fix likely needs either WSL-aware routing or an explicit unsupported-root classification before Windows DACL mutation; one incompatible root should also not poison unrelated local commands.TTvede commentedon Aug 28, 2026
Reproduced on a current Windows desktop build with the same WSL UNC trigger and broader impact across all local execution surfaces.
Environment:
Observed:
Impact:
The issue body mentions switching Settings > agent > WSL as a workaround. In app 26.825.3734.0 the current Settings navigation shows Configuration, Environments, Worktrees, Browser, and Computer use, but no Agent entry or discoverable Windows-to-WSL runtime selector. Please either expose/document the current location of this switch or make WSL UNC roots route through a WSL-native sandbox automatically.
This also reproduces the Browser/Chrome symptom tracked in #24101.
walter-seethaler commentedon Sep 1, 2026
Cross-issue scope and status update (2026-09-01):
I reviewed the open reports around WSL and UNC handling. They do not all demonstrate the same root cause, but they expose a broader support gap in Codex Desktop on Windows.
Direct Windows-native WSL-UNC sandbox family:
node_replfail during ACL setup on\\wsl.localhost.Related WSL Desktop integration problems, not confirmed duplicates: #18506, #23894, #24884, #29347, #32108, and #36850.
Broader UNC, SMB, mapped-drive, and virtual-filesystem problems, not necessarily the same cause: #10347, #12350, #19599, #25422, #27307, #35476, and #38347.
Switching the Agent environment to WSL is not an equivalent workaround for Windows-centric projects. It reverses the boundary: Windows files are then reached through
/mnt/c, while separate reports document incorrect path translation, CWD andCODEX_HOMEstate, file-preview links, and Browser/Chrome integration. A complete implementation needs to keep Windows roots on the Windows-native runtime and WSL roots on a WSL-native runtime, with explicit path translation at Desktop integration boundaries. At minimum, an unsupported root must be rejected with an actionable message instead of poisoning all unrelated local tools in the task.For weeks, this issue cluster has remained without an assigned maintainer, a milestone, a coordinated OpenAI response, or a linked fix. Codex Desktop accepts WSL-backed workspaces through their standard Windows UNC representation without warning, yet the Windows-native sandbox cannot use them and the suggested WSL mode is not an equivalent replacement for Windows workflows. Calling this supported without those qualifications is misleading.
It is deeply frustrating and disappointing to see rapid product and feature development while an entire cluster of bugs that disables core application functionality remains unresolved. New features have little value when fundamental workspace support remains broken and unattended.
rozsazoltan commentedon Sep 15, 2026
After Windows wakes from sleep, every application that relies on WSL becomes unusable for me for some reason, including VS Code and Codex. Restarting the applications alone does not fix it.
Until the underlying issue is found, this recovery sequence has worked reliably every time:
I'm not sure whether the interaction between Windows sleep and WSL depends on some specific system configuration.
What makes this particularly strange is that terminals and file managers continue to access WSL correctly and can execute commands inside it without any problems. Only Windows desktop applications seem to break after waking from sleep.
For me, this happens consistently, without exception, regardless of which WSL distribution or desktop application is involved.
akashskypatel commentedon Sep 23, 2026
Reproduced on Codex Desktop
26.917.8451.0.The active Windows workspace was:
while the sandbox writable roots still included a WSL UNC repo:
Desktop logs show:
The sandbox helper then fails specifically on the WSL root:
ACL operations on normal Windows paths in the same refresh succeed, but the WSL failures are aggregated and abort the entire refresh:
The deny-ACE pass also fails against both
\\?\UNC\wsl.localhost\...and ordinary\\wsl.localhost\..., so extended-path normalization does not avoid the problem.This confirms the issue is still present in
26.917.8451.0and that a registered WSL writable root can break otherwise unrelated Windows-local execution.Xain3 commentedon Sep 30, 2026
Additional reproduction on 30 September 2026 with Ubuntu and a Windows-native Codex agent (
workspace-writesandbox). Personal path segments below are redacted.Environment verified in the current Windows-local diagnostic chat:
10.0.26300.9457(reported bywsl.exe --version)codex-cli 0.159.27.6.626.928.219562.7.8.0; kernel:6.18.33.1-1; WSLg:1.0.73.2(verified withwsl.exe --version, which succeeds inside the sandbox)Two earlier chats had a registered workspace under:
Even a read-only command failed before starting:
Retrying the command with an explicit Windows-local working directory (
C:\Users\<user>) produced the same error while the chat retained the WSL workspace.The local
sandbox.2026-09-30.logdirectly confirms failed Windows permission operations on the WSL root and its.gitdirectory. Representative redacted entries:Control comparison: a new chat in a Windows-local folder under
C:\Users\<user>\Documents\Codex\...successfully ran commands, initialized Windows computer use, opened a browser, and typed/saved a test message in Notepad. Later sandbox refresh entries for Windows-local tests showerrors=[].A separate failure remains in that working Windows-local sandbox: launching
wsl.exereturnsWsl/Service/CreateInstance/E_ACCESSDENIED, whereas an identical harmless command succeeds outside the sandbox. I am reporting that separately on #21470; these are distinct observed failure modes, without asserting a shared root cause.