Windows Codex App WSL mode requires danger-full-access because sandbox blocks WSL access

Open 💬 2 comments Opened May 28, 2026 by yfcube

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

26.519.81530

What subscription do you have?

Plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Environment:

  • Windows 11
  • Codex App on Windows
  • WSL 2 installed with 3 distros:
  • Ubuntu-20.04 default
  • Ubuntu-22.04
  • Ubuntu-22.04-clone

Problem:
Codex App cannot run in WSL mode unless sandbox_mode = "danger-full-access". The user must disable command sandbox entirely to use WSL mode.

What steps can reproduce the bug?

Reproduction:

  1. Set [windows] sandbox = "elevated"
  2. Restart Codex App
  3. In Codex shell, whoami returns ...\codexsandboxoffline
  4. wsl -l shows no installed distributions
  1. Set [windows] sandbox = "unelevated"
  2. Restart Codex App
  3. In Codex shell, whoami returns real user ...\<user_name>
  4. HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss contains distro entries
  5. But wsl -l fails with:

Wsl/EnumerateDistros/Service/E_ACCESSDENIED

  1. Only sandbox_mode = "danger-full-access" allows wsl -l and WSL agent to work.

What is the expected behavior?

Expected:
WSL agent mode should be able to access the current user's WSL distros without requiring danger-full-access.

Additional information

_No response_

View original on GitHub ↗

2 Comments

prashant2007-wq · 3 months ago

Hi maintainers,

I looked into this and searched the public openai/codex codebase for the WSL launcher path.

I could find Windows sandbox/app-server protocol references and generic Rust process spawning paths, but I could not find the Windows App host-side WSL bootstrap code that directly launches or enumerates WSL distributions through wsl.exe.

From the issue behavior, the problem seems to be in the Windows App layer before the agent enters WSL:

  • elevated sandbox runs as the sandbox user and cannot see the current user's WSL distros
  • unelevated sandbox uses the real user but WSL enumeration/start fails with E_ACCESSDENIED
  • danger-full-access works because the host-side wsl.exe launcher is not sandboxed

My proposed fix would be to special-case only the WSL agent bootstrap path so that the native Windows sandbox is not applied to the host-side wsl.exe launcher. Once the agent is running inside WSL, the Linux sandbox should apply as documented.

Before I open a PR, could you confirm whether the Windows App WSL bootstrap code is present in this repository? If yes, please point me to the right module/file. If that code lives outside the public repo, I can help with a smaller docs/diagnostic PR instead.

Nothinglessss · 7 days ago

fk your mom codex noob shit suck my dick!!!!