Codex Desktop for Windows starts WSL/Ubuntu even when Windows-native mode is selected
What version of the Codex App are you using (From “About Codex” dialog)?
26.616.10790.0
What subscription do you have?
plus
What platform is your computer?
Microsoft Windows NT 10.0.22621.0 x64
What issue are you seeing?
Codex Desktop starts WSL2 and launches my Ubuntu-24.04 distro during startup even though Windows-native mode is selected and runCodexInWindowsSubsystemForLinux = false.
After running wsl --shutdown and confirming that all distros are stopped, launching Codex causes WSL-related processes such as vmwp.exe, vmmemWSL, wslhost.exe, and WSLg to start. Ubuntu-24.04 then changes from Stopped to Running.
I expected Codex to remain fully Windows-native unless I explicitly open a WSL project, use a WSL terminal, or run a WSL-related command.
What steps can reproduce the bug?
- Open Codex Desktop and select the Windows-native environment.
- Confirm that the Codex configuration contains:
[desktop]
runCodexInWindowsSubsystemForLinux = false
- Close all Codex Desktop windows.
- Open PowerShell and run:
wsl --shutdown
wsl --list --verbose
- Confirm that all WSL distros, including Ubuntu-24.04, are shown as Stopped.
- Launch Codex Desktop.
- Run the following command again:
wsl --list --verbose
- Observe that Ubuntu-24.04 has changed from Stopped to Running.
- Optionally, monitor processes during startup. WSL-related processes such as vmwp.exe, vmmemWSL, wslhost.exe, and WSLg-related msrdc.exe processes appear shortly after Codex starts.
What is the expected behavior?
Codex Desktop should remain fully Windows-native when Windows-native mode is selected and runCodexInWindowsSubsystemForLinux = false.
Launching Codex should not start WSL2, Ubuntu-24.04, WSLg, or related WSL processes unless I explicitly open a WSL project, select a WSL terminal, access a WSL path, or run a WSL-related command.
Additional information
After running wsl --shutdown, I confirmed that both docker-desktop and Ubuntu-24.04 were stopped before launching Codex.
Observed startup timeline:
T+00s Codex.exe starts
T+02s codex.exe app-server --analytics-default-enabled starts
T+06s vmwp.exe starts
T+06s vmmemWSL starts
T+08s wslhost.exe starts
T+15s msrdc.exe /wslg /silent ... starts
T+17s Windows-native node_repl.exe starts under the Codex app-server
After startup, docker-desktop remains stopped, but Ubuntu-24.04 changes to Running.
I did not capture a persistent wsl.exe process, so the trigger may be a short-lived helper process or a WSL API call.
This issue is reproducible. I can provide redacted diagnostic logs if needed. Local usernames, device names, paths, conversation IDs, installation IDs, and private workspace details have been removed.
2 Comments
I can reproduce this on a newer Codex Desktop build, and I was able to isolate the command that starts WSL.
Environment
26.730.8199.00.147.0-alpha.1.226200, x64docker-desktop(WSL2)AutoStart: falsecom.docker.service: stopped/manualDocker-specific manifestation
When
docker-desktopis the default WSL distro, launching Codex starts it even though Docker Desktop itself is not launched and no containers are running. Task Manager then showsVmmemWSL.Hyper-V Compute event logs confirm that the WSL VM is created and Docker's internal VHD is mounted:
Inside
docker-desktop, only the WSL init process remains; there is no Docker workload.Isolated reproduction
Starting from a clean baseline:
Both distros are stopped and
VmmemWSLis absent.These metadata-only commands do not start WSL:
The following home-directory probe does start the default distro:
Observed result with
docker-desktopas the default distro:Despite the command failing,
docker-desktopremains running andVmmemWSLremains resident untilwsl --shutdown.The installed Codex Desktop bundle contains a
readCodexHomePathFromWslEnv/resolveCodexHomeFromWslpath that invokes this barewsl.execommand without-d <distro>. This appears to be the short-lived trigger that is easy to miss in process monitoring.Repeated timing correlation
Across the last seven days, I found nine Codex-launch / Docker-WSL-start pairs. Docker's WSL VM was created 14.9–56.6 seconds after Codex launched:
Docker Desktop's own host logs had no corresponding launches during the current incident, which further separates this from Docker autostart.
Expected behavior / suggested direction
In Windows-native mode, Codex should not execute a command inside the default WSL distro merely to resolve WSL-side
CODEX_HOME.If WSL home resolution is required, the implementation should first select an eligible user distro, exclude utility distros such as
docker-desktop, and invoke WSL with an explicit-d <distro>. A failed optional probe should not leave an unrelated distro running.This looks like the same root issue as the Ubuntu report, with
docker-desktopexposing an additional failure mode because it is an internal utility distro and does not providebash.Additional source evidence (sanitized)
I checked the current public
openai/codexrepository at commitf141dc77f05b91aa758b3f27178329ced79d87a1.Public repository boundary
codex appimplementation only checks whether the Store package is installed and opens acodex://threads/new?...URL (or the installer):windows.rslines 10–29 and lines 33–73.codex-cli, the responses proxy, and the TypeScript SDK; it does not include the Electron desktop shell:pnpm-workspace.yamllines 1–4.A full tracked-file search at that commit found no
wsl.exe,readCodexHomePathFromWslEnv, oreligible distro listimplementation. Therefore the WSL launcher involved here is not present in the public repository snapshot; the public repo alone cannot show this particular call site.Direct code evidence from the shipped Windows Desktop build
Codex Desktop
26.730.8199.0ships the relevant production JavaScript insideresources/app.asar. The archive-relative bundle.vite/build/worker.jscontains the following minimal excerpts. Whitespace was added; nonessential options and error handling were elided, while identifiers, argument arrays, and string literals are unchanged:This establishes the parameter bug directly:
wsl.exewithout-d <distro>.-d e.distro, but the home probe does not use it.docker-desktop, it is started before the probe fails because that utility distro has no Bash. WSL then remains resident asVmmemWSL.The issue is therefore in the Windows Desktop shell's WSL-side Codex-home discovery path, not Docker Desktop autostart and not the public Rust app-server.