Skip to content

[Windows][WSL] Startup policy check skips CLI relocation and executes non-executable WindowsApps binary #60974

Open

Description

@zg-alexey

What version of the Codex App are you using?

  • Affected Microsoft Store/MSIX package: OpenAI.Codex 26.1106.6628.0 (x64).
  • Bundled Linux CLI: 0.167.0-alpha.4.1.
  • Previously working package: 26.1103.7773.0; its retained Linux runtime reports 0.167.0-alpha.3.2.
  • Versions above were obtained from the installed package and executable, since the affected app initially could not pass startup.

What subscription do you have?

Not included; the failure occurs before the CLI executable starts.

What platform is your computer?

  • Windows 10 x64, build 19045.7807.
  • WSL 3.0.5.0, Ubuntu 24.04.5 LTS, kernel 6.18.58.1-microsoft-standard-WSL2.
  • The Windows drive is mounted through DrvFS with metadata,umask=22,fmask=11.
  • Desktop setting: runCodexInWindowsSubsystemForLinux = true.

What issue are you seeing?

After updating, the desktop app is blocked by:

Organization settings could not be loaded

Native Windows mode works. With WSL selected, the startup log repeatedly reports:

Desktop startup policy read failed attempt=1 phase=policy-read reason=protocol retrying=false

The immediate failure is local executable launch, not an unsuccessful organization-settings network request. The preliminary startup check selects the packaged Linux executable directly from:

C:\Program Files\WindowsApps\OpenAI.Codex_26.1106.6628.0_x64__2p2nqsd0c76g0\app\resources\codex

WSL sees this file with mode 0444. Executing it returns:

exit status: 126
stdout: empty
stderr: bash: .../app/resources/codex: Permission denied

The desktop then attempts to parse the empty stdout as startup JSON and surfaces the generic organization-settings error.

What steps can reproduce the bug?

  1. On the environment above, use the affected Store/MSIX package with WSL selected and no CODEX_CLI_PATH override.
  2. Launch the desktop app.
  3. Observe the organization-settings dialog and phase=policy-read reason=protocol.
  4. Inspect and execute the installed Linux binary from a WSL shell:
src='/mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.1106.6628.0_x64__2p2nqsd0c76g0/app/resources/codex'
stat -c '%a %n' "$src"
"$src" app-server --print-startup-config
printf 'exit=%s\n' "$?"

On this installation, the mode is 444 and execution fails with exit 126.

Control test: copy the current package's codex and codex-code-mode-host into a user-owned directory, verify their SHA-256 hashes against the package, and grant executable permission. The copied CLI successfully completes the startup-settings check with exit 0 and valid JSON containing appServerVersion and configRequirements, using the same configuration and network setup.

Selecting this verified copy through CODEX_CLI_PATH also allows the actual desktop app to launch. Its log then records:

Codex CLI initialized
app_server_connection.state_changed ... initialized=true ... next=connected

The desktop UI was confirmed to open without the startup error.

What is the expected behavior?

The WSL startup-settings check should execute a verified, executable copy of the matching bundled Linux CLI. It should reuse the normal relocation/cache mechanism where execution from the protected package is unavailable.

A process that never starts should produce an actionable executable-launch error, including exit status and suitable stderr, rather than a generic organization/network error.

Additional information

Installed desktop-code diagnosis

Static inspection of the installed app.asar identifies the relevant path in:

  • .vite/build/early-bootstrap-133-d277c7adebbd24e5.js: preliminary policy check.
  • .vite/build/early-bootstrap-824-40bb0536d97ca2c2.js: startup command preparation and runtime resolution.

The following is equivalent pseudocode with descriptive variable names:

// Policy check creates a non-null startupCommand:
resolveTransport({
  ...options,
  startupCommand: { args: ["--print-startup-config", /* client info */] }
});

// WSL resolver:
includeRuntime = options.startupCommand == null;

// Bundled executable resolver:
windowsDestinationPath =
  includeRuntime === false
    ? null
    : join(windowsCodexHome, "bin", "wsl", executableName);

// Relocation runs only when a destination was supplied.
// Otherwise the original packaged file is returned if it exists.

Consequently, the preliminary policy check skips relocation and selects WindowsApps/.../resources/codex. The later, ordinary app-server path still enables relocation, but cannot be reached until that check passes. The candidate-file check verifies existence/file type, not Linux executability.

The prior working version's log shows it launching a relocated runtime under:

%USERPROFILE%\.codex\bin\wsl\7076a964b43922ce\codex

That retained executable has mode 0744. For the current package, the descriptor-derived normal WSL CLI directory is dda21de2dbbd1cc1; it was absent before the workaround allowed startup to proceed.

Distinction from encrypted-resource copy failures

This is related to #36777 and #38696, but the observed mechanism here differs from ERROR_ENCRYPTION_FAILED:

  • The current packaged Linux CLI has Windows attribute Archive, not Encrypted.
  • Copying the current packaged binaries succeeds and their hashes match.
  • The failing preliminary path explicitly bypasses copying and attempts direct execution.

#56197 also contains reports of phase=policy-read reason=protocol, but this reproduction has empty stdout and exit 126, rather than shell text contaminating JSON.

PR #55300 introduced --print-startup-config. It is relevant context for the one-shot command; it does not by itself establish where the desktop relocation regression was introduced.

Verified local workaround and suggested fix

A user-level launcher now looks up the currently registered app package, verifies and stages its Linux binaries into an executable WSL cache, then executes that matching CLI. The desktop starts successfully through this launcher. It does not change WindowsApps files/permissions or bypass the policy check.

An upstream fix could preserve WSL CLI relocation/reuse for the preliminary startup check while continuing to skip unnecessary runtime initialization. A regression test should cover a readable but non-executable packaged Linux binary and verify that both the preliminary check and normal WSL app-server startup succeed with the matching relocated runtime.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    app-serverIssues involving app server protocol or interfaces
    on Nov 12, 2026
  2. piterskiy commented on Nov 12, 2026

    @piterskiy

    I'm seeing the same failure on the same build.

    Environment

    • Codex Desktop (Microsoft Store, OpenAI.Codex) 26.1106.6628.0 x64
    • Windows 10 Pro 22H2, OS build 19045.7725

    Behavior

    • With [desktop] runCodexInWindowsSubsystemForLinux = false the app starts normally.
    • With WSL enabled, it shows "Organization settings could not be loaded" and the app is blocked.

    Ruled out

    • CODEX_CLI_PATH is not set (empty at both User and Machine level).
    • Commenting out the top-level notify entry in config.toml (the Computer Use hook) did not change anything.
  3. Ayoro commented on Nov 12, 2026

    @Ayoro

    Confirmed independently on another installation of the same Store/MSIX package, OpenAI.Codex 26.1106.6628.0 (x64), with bundled Linux CLI 0.167.0-alpha.4.1 and Ubuntu 24.04 on WSL2.

    This completely blocked WSL-mode startup. The Chinese dialog says “无法加载组织设置” and suggests checking the network/proxy/firewall or signing out, which sent troubleshooting in the wrong direction.

    Observed evidence:

    • Desktop log: Desktop startup policy read failed attempt=1 phase=policy-read reason=protocol retrying=false.
    • Running the packaged app/resources/codex through WSL fails with Permission denied, exit code 126, and empty stdout.
    • Copying the current package's exact binary to a user-owned directory makes the startup check succeed: exit 0, valid JSON with appServerVersion: "0.167.0-alpha.4.1" and configRequirements.requirements.
    • The original and copied binary have identical SHA-256: c3dea068c8794f1764051c1fd182ff0524352bbddf2f2638e72386b9b7b74368.
    • Windows and WSL could both reach the relevant service host; no proxy changes or reauthentication were needed.
    • Inspection of the installed desktop code corroborates the report: a non-null startupCommand results in includeRuntime=false, then windowsDestinationPath=null, so the preliminary policy check skips relocation. Empty stdout is subsequently categorized as a protocol error.

    End-to-end workaround confirmed: stage the matching codex and codex-code-mode-host in a user-owned directory, set a process-local CODEX_CLI_PATH override, and launch the desktop in WSL mode. Logs show spawnCommand=wsl.exe with the staged executable, followed by initialized=true ... next=connected. The affected user then confirmed their actual desktop session opened successfully.

    One additional workaround pitfall: directly launching WindowsApps/.../app/ChatGPT.exe via Windows Process.Start failed with Win32 error 5 (Access denied) on this machine. The package's registered execution alias, %LOCALAPPDATA%\Microsoft\WindowsApps\chatgpt-desktop.exe, worked with UseShellExecute=false and the child-process environment override. This was a separate issue in our temporary launcher, not an additional claim about the original startup failure.

    Please retain executable relocation for the preliminary WSL policy check and report local launch failures accurately instead of implying an organization/network/authentication problem. A packaged-app regression test covering a readable but non-executable Linux binary would catch this. No WindowsApps permissions, organization policies, or installed package contents were changed in our workaround.

  4. arniksup commented on Nov 12, 2026

    @arniksup

    Independent confirmation: same regression on Windows + Ubuntu 24.04 WSL2, workaround successful

    @zg-alexey @Ayoro thanks for your help!

    I can confirm the same issue on another Windows installation. The workaround described here successfully restored Codex Desktop without reinstalling the application, resetting configuration, or clearing authentication data.

    Environment

    • Codex Desktop MSIX: OpenAI.Codex 26.1106.6628.0 (x64)
    • Agent execution environment: WSL2, Ubuntu 24.04
    • Previously working Desktop package: 26.1103.4239.0
    • Date: November 12, 2026

    Observed failure

    After a computer restart, Codex Desktop stopped launching and displayed:

    Organization settings could not be loaded.

    The Desktop logs repeatedly reported:

    Desktop startup policy read failed
    attempt=1
    phase=policy-read
    reason=protocol
    retrying=false
    

    Root-cause verification

    I tested the Linux executable bundled with the current MSIX package:

    src='/mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.1106.6628.0_x64__2p2nqsd0c76g0/app/resources/codex'
    
    stat -c 'mode=%a file=%n' "$src"
    "$src" app-server --print-startup-config
    
    rc=$?
    echo "exit_code=$rc"

    Actual result:

    mode=444
    
    bash: .../app/resources/codex: Permission denied
    
    exit_code=126
    

    This exactly matches the executable-permission and startup policy failure described in the original report.

    Successful workaround

    1. Copied codex and codex-code-mode-host from the current MSIX package to a user-owned directory under .codex/bin/wsl/.
    2. Granted executable permissions with chmod 755.
    3. Verified that the copied executable matched the original using cmp.
    4. Executed the copied CLI's app-server --print-startup-config successfully.
    5. Set CODEX_CLI_PATH to the copied executable for the launching process.
    6. Launched Codex Desktop through the registered chatgpt-desktop.exe execution alias.

    Result: Codex Desktop started successfully in WSL mode.

    No modifications to the protected WindowsApps directory were necessary. Existing projects, configuration, and authentication data were preserved.

    This independently confirms that the regression affects MSIX 26.1106.6628.0 and that staging the matching Linux binaries in an executable user-owned directory is an effective workaround.

    Thanks to @zg-alexey for the detailed root-cause investigation and @Ayoro for the additional confirmation and launcher workaround details. Your findings saved me a lot of unnecessary troubleshooting!

    Looking forward to an upstream fix that preserves the WSL executable relocation mechanism during the preliminary startup policy check.

  5. archon810 commented on Nov 12, 2026

    @archon810

    OpenAI keeps breaking this. Do they not have any tests? This is ridiculous.

  6. archon810 commented on Nov 12, 2026

    @archon810

    Confirmed on another setup, with the workaround working end to end.

    Environment

    • Codex Desktop MSIX 26.1106.6628.0 (x64), bundled Linux CLI 0.167.0-alpha.4.1
    • Windows 10 Pro 19045
    • WSL2 openSUSE Leap 15.6 (not Ubuntu, so this isn't distro-specific)
    • /mnt/c mounted as plain DrvFS without metadata. The packaged binary still shows up as 444 there, while files copied to my profile show as executable.
    • [desktop] runCodexInWindowsSubsystemForLinux = true

    Same failure

    • Desktop log: Desktop startup policy read failed attempt=1 phase=policy-read reason=protocol retrying=false
    • stat on .../OpenAI.Codex_26.1106.6628.0_x64__2p2nqsd0c76g0/app/resources/codex returns 444. Running it returns Permission denied, exit 126.
    • Packaged codex SHA-256 is C3DEA068C8794F1764051C1FD182FF0524352BBDDF2F2638E72386B9B7B74368, matching @Ayoro's.

    Workaround (no changes to WindowsApps)

    1. Copy codex and codex-code-mode-host from app\resources\ to %USERPROFILE%\.codex\bin\wsl\manual-26.1106.6628.0\, then chmod 755. Verify the SHA-256 hashes match.
    2. codex app-server --print-startup-config from that copy returns exit 0 and {"appServerVersion":"0.167.0-alpha.4.1","configRequirements":{...,"requirements":null}}.
    3. Launch through the chatgpt-desktop.exe execution alias, with CODEX_CLI_PATH set for that process only. Use the Windows path to the staged file. The app wraps it in wsl.exe itself; the log shows runtimeSource=override and spawnCommand=wsl.exe.

    Launcher I use from a desktop shortcut. It skips the override when the installed version no longer matches, so it won't pin a stale CLI after the fix ships:

    $ErrorActionPreference = 'Stop'
    $stagedVersion = '26.1106.6628.0'
    $stagedCli = Join-Path $PSScriptRoot 'codex'
    $installed = (& powershell.exe -NoProfile -Command "(Get-AppxPackage -Name 'OpenAI.Codex').Version" | Out-String).Trim()
    if ($installed -and $installed -ne $stagedVersion) {
        Write-Warning "Codex is now $installed; launching without the override."
        Start-Process "$env:LOCALAPPDATA\Microsoft\WindowsApps\chatgpt-desktop.exe"; return
    }
    $psi = New-Object System.Diagnostics.ProcessStartInfo
    $psi.FileName = "$env:LOCALAPPDATA\Microsoft\WindowsApps\chatgpt-desktop.exe"
    $psi.UseShellExecute = $false
    $psi.EnvironmentVariables['CODEX_CLI_PATH'] = $stagedCli
    [void][System.Diagnostics.Process]::Start($psi)

    Result: initialize_handshake_result ... outcome=success, initialized=true ... next=connected, and existing WSL projects loaded normally.

    +1 to fixing the preliminary policy check so it keeps WSL relocation. The real error (exit 126 / EACCES) should also show up in the dialog instead of the generic organization/network message. That message sent me down the proxy and firewall path first.

  7. mpwillia401 commented on Nov 13, 2026

    @mpwillia401

    Additional reproduction: Oracle Linux 9.5 / WSL2 — startup-policy CLI override ignored

    I independently reproduced this issue with:

    • Windows 10 Pro, build 19045.6466
    • WSL 3.0.5.0, Oracle Linux 9.5 (WSL2)
    • Codex desktop/MSIX 26.1106.6628.0
    • Bundled Linux Codex CLI 0.167.0-alpha.4.1

    Observed behavior

    When [desktop] runCodexInWindowsSubsystemForLinux = true, the application displays “Organization settings could not be loaded.” Its startup log reports:

    Desktop startup policy read failed attempt=1 phase=policy-read reason=protocol retrying=false
    

    Process Monitor evidence

    The desktop launches WSL for startup-policy initialization with an absolute --cd pointing into app/resources, then runs the packaged Linux CLI from:

    C:\Program Files\WindowsApps\OpenAI.Codex_26.1106.6628.0_x64__2p2nqsd0c76g0\app\resources\codex
    

    The directory itself is accessible from WSL (wsl.exe ... --cd <resources> --exec /usr/bin/pwd succeeds). However, this bundled codex appears in Oracle Linux as -r--r--r-- (mode 0444), and executing it gives Permission denied, exit code 126.

    Working-copy verification

    I copied both codex and codex-code-mode-host to a Linux-native directory, /home/opc/.codex/bin/wsl/chatgpt-desktop-test/, verified SHA-256 hashes matching the original binaries, and set mode 0755 on both copies. The copied CLI reports codex-cli 0.167.0-alpha.4.1 and successfully completes app-server --print-startup-config with exit code 0.

    Override verification

    I then launched the desktop through its Windows registered execution alias with a process-scoped:

    CODEX_CLI_PATH=/home/opc/.codex/bin/wsl/chatgpt-desktop-test/codex
    

    A second Process Monitor capture confirmed this variable was present in the launched ChatGPT process environment. Nonetheless, the failing WSL startup-policy command still explicitly invokes the non-executable WindowsApps copy rather than the working CLI override. WSL-mode startup remains blocked; Windows Native mode works.

    Suggested fix

    Stage the bundled Linux CLI in an executable WSL location before the preliminary startup-policy read, or honor the CLI override in that initialization path. Ideally surface the underlying executable permission error instead of the generic organization-settings error.

    This report concerns only openai/codex; no changes to other repositories are required.

  8. mitkodotcom commented on Nov 13, 2026

    @mitkodotcom

    Confirmed regression in Codex Desktop 26.1111.2228.0 — WSL workaround successful

    I can confirm that the issue persists in the newer Microsoft Store/MSIX version 26.1111.2228.0 on Windows 10.

    Observed behavior:

    • Codex Desktop was previously working in WSL mode.
    • After a Windows crash and subsequent application restart, startup failed with "Organization settings could not be loaded."
    • Desktop logs reported:
    Desktop startup policy read failed attempt=1 phase=policy-read reason=protocol retrying=false
    
    • CODEX_CLI_PATH was unset at Process, User, and Machine scopes.
    • Restarting CodexSandboxService.OpenAI.Codex did not help.
    • Switching runCodexInWindowsSubsystemForLinux to false allowed Desktop to start normally.

    Root-cause verification:

    The bundled Linux executable at:

    /mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.1111.2228.0_x64__2p2nqsd0c76g0/app/resources/codex
    

    has permissions 0444 under WSL. Attempting to execute it returns Permission denied.

    Successful workaround:

    1. Copied the matching codex and codex-code-mode-host binaries from the installed MSIX package into a user-owned directory.
    2. Verified matching SHA-256 hashes and applied executable permissions (chmod 755).
    3. Re-enabled WSL mode.
    4. Launched Codex Desktop with a process-scoped CODEX_CLI_PATH pointing to the copied executable.

    Codex Desktop started successfully. The active WSL process table confirmed:

    /mnt/c/Users/.../.codex/bin/wsl/manual-26.1111.2228.0/codex -c features.code_mode_host=true app-server ...
    

    This independently confirms that the regression remains present in 26.1111.2228.0, and that the executable-relocation workaround is effective with this version.

    No reinstall, configuration reset, or changes to the protected WindowsApps directory were needed.

  9. piggei commented on Nov 13, 2026

    @piggei

    Confirmed on Windows 10 + WSL2 — bundled Linux binary lacks execute permissions

    I can confirm this issue on Codex Desktop 26.1106.6628.0, running on Windows 10 with WSL2 (Ubuntu 22.04).

    After several recurring startup failures, I performed an extensive investigation using PowerShell, WSL, and Microsoft Sysinternals Process Monitor.

    The findings strongly indicate a packaging/launcher regression rather than a WSL configuration or authentication problem.

    Environment

    • Codex Desktop: 26.1106.6628.0
    • Windows: Windows 10, build 19045
    • WSL: 3.0.3.0
    • Distribution: Ubuntu 22.04, WSL2
    • Bundled Codex CLI: 0.167.0-alpha.4.1
    • WSL backend: runCodexInWindowsSubsystemForLinux = true

    1. Startup failure

    Codex Desktop fails to start with the organization settings error.

    The desktop logs consistently report:

    Desktop startup policy read failed
    attempt=1 phase=policy-read reason=protocol retrying=false
    

    Disabling the WSL backend allows Desktop to start, but this is not an acceptable long-term solution for workflows that depend on native Linux repositories, tools, and build environments.

    2. Actual launcher command captured

    Using Process Monitor, I confirmed that Desktop attempts to execute the bundled Linux binary directly from the WindowsApps installation directory:

    C:\Program Files\WindowsApps\
    OpenAI.Codex_26.1106.6628.0_x64__2p2nqsd0c76g0\
    app\resources\codex
    

    The launcher uses wsl.exe -d Ubuntu-22.04 --cd ... --exec /usr/bin/bash -lc ... and invokes this binary with:

    -c features.code_mode_host=true
    app-server
    --analytics-default-enabled
    --print-startup-config
    --startup-client-info ...
    

    3. Bundled binary is not executable from WSL

    The bundled binary is readable, but WSL reports:

    Permissions=444
    Executable ExitCode: 1
    

    Attempting to execute it directly produces:

    execvpe(...) failed: Permission denied
    

    The binary has the following properties:

    Size: 324786760 bytes
    SHA256:
    c3dea068c8794f1764051c1fd182ff0524352bbddf2f2638e72386b9b7b74368
    

    4. Identical binary works after copying to Linux

    I copied the exact same binary to the native Ubuntu filesystem and assigned executable permissions.

    The SHA256 hashes matched.

    The copied binary then worked correctly:

    codex-cli 0.167.0-alpha.4.1
    AppServerVersion: 0.167.0-alpha.4.1
    ConfigRequirements: OK
    ExitCode: 0
    

    This strongly supports the conclusion that the executable permissions or launch location are responsible for the failure.

    5. Other components were independently verified

    The following checks succeeded:

    • WSL startup and filesystem access.
    • Bash initialization without unexpected stdout.
    • ChatGPT authentication inside WSL.
    • Configuration requirements retrieval.
    • JSON-RPC initialize.
    • JSON-RPC configRequirements/read.
    • Windows-to-WSL stdio communication.
    • Execution of the cached Linux CLI.

    The backend itself is operational when launched from an executable location.

    6. Workarounds attempted

    I also tried:

    • Restarting WSL completely using wsl --shutdown.
    • Repairing the Windows application.
    • Switching the Desktop backend from WSL to Windows and back.
    • Preparing executable copies of both codex and codex-code-mode-host.
    • Launching Desktop with a process-local CODEX_CLI_PATH override.

    None restored WSL-backed Desktop startup.

    The application repair left the bundled binary with permissions 444.

    The CODEX_CLI_PATH attempt did not resolve the preliminary policy-read failure. I have not conclusively verified whether the override was inherited and honored by that specific startup phase.

    7. Impact

    This is particularly disruptive for developers who use Codex Desktop as their primary interface to repositories hosted inside WSL.

    I routinely work across multiple Git repositories, branches, and worktrees, with Linux-native tooling and GitHub integration.

    Switching to the Windows backend is only a partial workaround and does not provide equivalent Linux execution behavior.

    The recurring startup regressions have also required substantial troubleshooting time, interrupting ongoing development work.

    Requested fix

    Could the Desktop launcher ensure that the bundled Linux executable is staged in an executable location before the initial policy/configuration read?

    Alternatively, could the WSL bootstrap consistently honor a supported CLI path override, including during the preliminary --print-startup-config phase?

    It would also be helpful if the startup error reported the underlying Permission denied failure rather than the generic organization-settings message.

    The key finding is reproducible: the bundled binary fails with permissions 444, while a SHA256-identical copy with executable permissions runs successfully.

    I can provide additional Process Monitor traces and diagnostic output if useful.

  10. Kun-xui commented on Nov 14, 2026

    @Kun-xui

    Independent confirmation + an alternative fix that does not need CODEX_CLI_PATH

    Confirmed the same mechanism on Windows 10 19045 x64 / WSL2 Ubuntu with both 26.1106.6628.0 and 26.1111.2228.0, on a default DrvFS mount (without the metadata option). The packaged ELFs ship read-only (Archive attribute, TrustedInstaller-owned), so DrvFS derives mode 444, and even root cannot execute a file that has no execute bit at all:

    $ ls -l "/mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.1111.2228.0_x64__2p2nqsd0c76g0/app/resources/"
    -r--r--r-- ... codex
    -rwxr-xr-x ... codex.exe              <- the .exe keeps +x, the ELF does not
    -r--r--r-- ... codex-code-mode-host
    

    Workaround B: make the packaged ELFs executable in place (no copy, no env var)

    Since DrvFS without metadata derives the mode from the read-only attribute, clearing that attribute is enough — the policy check then executes the packaged binary successfully and the stock configuration works again:

    :: elevated prompt; reapply after every Store package update (new package folder each time)
    takeown /F "C:\Program Files\WindowsApps\OpenAI.Codex_<VERSION>_x64__2p2nqsd0c76g0\app\resources\codex"
    icacls  "C:\Program Files\WindowsApps\OpenAI.Codex_<VERSION>_x64__2p2nqsd0c76g0\app\resources\codex" /grant *S-1-5-32-544:F
    attrib -r "C:\Program Files\WindowsApps\OpenAI.Codex_<VERSION>_x64__2p2nqsd0c76g0\app\resources\codex"
    
    :: repeat the same three commands for codex-code-mode-host

    Result: mode flips to 555 (r-xr-xr-x), .../resources/codex --version executes under WSL, and the app starts in WSL mode with runCodexInWindowsSubsystemForLinux = true — zero policy read failed lines, app-server connects through wsl.exe normally. Verified end-to-end on 26.1111.2228.0. File content is untouched, so MSIX integrity/validation is unaffected; only the owner and the read-only attribute change.

    Caveat: this variant only helps on default mounts where the mode is derived from the read-only attribute. On mounts with metadata plus an exec-masking fmask (like the reporter's umask=22,fmask=11), the CODEX_CLI_PATH workaround from the issue body is the right one — the two approaches are complementary.

    Why the failure looks intermittent across the linked issues

    The early-bootstrap distro lookup runs concurrently with the policy check. When WSL is cold, wsl.exe --status can take seconds (we observed a 3 s timeout in the desktop log), the lookup returns nothing and the policy check falls back to the Windows binary — which succeeds. Once WSL is warm the lookup returns instantly, the check takes the broken WSL path and every launch fails. This matches the "worked right after the update / broke after a reboot / rollback fixed it" patterns reported in #61024, #61088 and #61214, and explains why rolling back only appears to help.

    On the fix

    +1 to reusing the relocation cache for the policy check — includeRuntime should not depend on startupCommand == null; the relocated copy is content-hashed and already chmod'd 0777, and the ordinary app-server path proves that route works. Independently, surfacing the child exit status/stderr instead of the generic organization-settings dialog would save people a lot of proxy-debugging time — the current dialog sends users hunting for network problems that do not exist.

  11. Spuzy24 commented on Nov 17, 2026

    @Spuzy24

    Still reproducing on 26.1111.2228.0 (checked 2026-11-17), independently root-caused to the same code path

    Environment

    • Codex Desktop, Microsoft Store/MSIX OpenAI.Codex 26.1111.2228.0 (x64); bundled Linux CLI 0.169.0-alpha.11.1
    • Windows 10 Pro 22H2, build 19045.6456
    • WSL 3.0.5.0, kernel 6.18.58.1-microsoft-standard-WSL2, Ubuntu 24.04.4 LTS (default distro, systemd enabled)
    • /mnt/c is the default DrvFS mount (no metadata option)
    • Desktop setting: runCodexInWindowsSubsystemForLinux = true; CODEX_CLI_PATH not set

    Timeline

    • WSL mode worked on the previous package until the Store update on 2026-11-15. The last healthy desktop log line is at 17:01 UTC. The first launch of 26.1111.2228.0 at 17:02 UTC already failed, and every launch since then has failed:
      Desktop startup policy read failed attempt=1 phase=policy-read reason=protocol retrying=false
      
    • With runCodexInWindowsSubsystemForLinux = false the app starts normally. Switching it back to true brings the dialog back every time.

    What I measured (read-only, from WSL)

    1. The packaged Linux binary is not executable from WSL:
      $ stat -c '%a' '/mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.1111.2228.0_x64__2p2nqsd0c76g0/app/resources/codex'
      444
      $ '/mnt/c/Program Files/WindowsApps/OpenAI.Codex_26.1111.2228.0_x64__2p2nqsd0c76g0/app/resources/codex' app-server --print-startup-config ...
      Permission denied   (exit 126, stdout empty)
      
    2. The same binary is fine when it runs from a user-owned path. A byte-identical copy (cmp equal; the VS Code extension ships the same 0.169.0-alpha.11.1) answers the exact startup command with exit 0 and valid JSON:
      {"appServerVersion":"0.169.0-alpha.11.1","configRequirements":{"supportsIndependentSpeedModes":true,"requirements":null}}
      
      The standalone CLIs 0.169.0 and 0.167.1 answer the same way. The result is also the same with the flags the desktop app adds (-c features.code_mode_host=true -c features.windows_sandbox_service=true) and with CODEX_HOME pointed at the Windows .codex folder.
    3. These were ruled out:
      • Shell startup output: wsl.exe -d Ubuntu-24.04 -- bash -lic 'echo MARK' prints only MARK.
      • Network: chatgpt.com answers HTTP 200 from both Windows and WSL.
      • Config contents: the startup command loads the same config without errors.
    4. The relocation cache was never refreshed. %USERPROFILE%\.codex\bin\wsl\ still contains only the copy from the previous package (7076a964b43922ce/codex → codex-cli 0.167.0-alpha.3.2, dated 2026-11-09). No new hash folder was created for 26.1111.2228.0, because the failing check comes before the normal app-server path that would relocate the binary.

    The code path is unchanged in 26.1111.2228.0
    The installed app.asar of this build still has the logic described in the issue body:

    • The policy read passes a startupCommand (--print-startup-config, --startup-client-info), which sets includeRuntime = (startupCommand == null) = false.
    • windowsDestinationPath becomes null when includeRuntime === false, so relocation is skipped and the original …\WindowsApps\…\resources\codex path is returned.
    • The startup reader runs JSON.parse on the empty stdout, throws reason: "protocol", and shows the generic organization-settings dialog.

    Impact
    For WSL-based development, Windows mode is not a real workaround. WSL mode is what makes the VS Code extension sessions inside WSL show up in the desktop app, and what lets the mobile app connect to those sessions remotely. While this bug is open, the desktop app is only usable in a mode that doesn't serve that use case.

    Two UX points that made this harder to diagnose

    • The dialog blames the network, proxy or IT administrator, but the real cause was a local exit 126. Showing the child's exit status and stderr (or at least "the Codex runtime could not be started") would save users from hunting network problems that don't exist.
    • Sign out only reruns the same check in sign-out mode (--startup-sign-out) through the same broken launch path. The dialog comes back immediately, so the button looks like it does nothing.

    +1 to the fix proposed above: let the preliminary startup check reuse the WSL relocation cache instead of making it depend on startupCommand == null. A regression test with a readable but non-executable packaged Linux binary would also catch this. WSL-mode startup has now broken twice in about a month (see #54478, fixed around 2026-10-31).

  12. piggei commented on Nov 20, 2026

    @piggei

    Follow-up: issue persists in 26.1111.9664.0 — Windows execute permission already present

    Following up on my previous report, I can confirm that the issue still occurs with Codex Desktop 26.1111.9664.0 on Windows 10 and WSL2 (Ubuntu 22.04).

    I also investigated the proposed workaround involving the Windows Read-only attribute. My findings differ from that case.

    Both bundled Linux executables have only the Archive attribute, with no Read-only flag:

    attrib codex                 -> A
    attrib codex-code-mode-host  -> A
    

    Both files are owned by NT AUTHORITY\SYSTEM, and their inherited Windows ACLs already include execute permission for BUILTIN\Users:

    BUILTIN\Users:(I)(Rc,S,RD,REA,X,RA)
    BUILTIN\Users:(I)(R)
    NT SERVICE\TrustedInstaller:(I)(F)
    NT AUTHORITY\SYSTEM:(I)(F)
    

    My account belongs to BUILTIN\Users, and both files can be read successfully from Windows.

    However, WSL still reports:

    Permissions=444
    Executable ExitCode: 1
    execvpe(...) failed: Permission denied
    

    The current bundled codex executable is 294,427,960 bytes.

    The Windows drive is mounted through DrvFs/9p without explicit Unix metadata support.

    This suggests that the problem is not necessarily caused by the Windows Read-only attribute or a missing Windows execute ACE. There may be an issue with how executable permissions are exposed through DrvFs for these packaged files.

    I have deliberately avoided changing ownership or ACLs inside WindowsApps, since the required Windows execute permissions are already present.

    Could the Desktop WSL bootstrap stage the bundled Linux executables in an executable location before the initial policy read, rather than invoking them directly from WindowsApps?

    This would avoid relying on the Unix permissions exposed by DrvFs and should provide a more robust solution across Windows configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions