Skip to content

Codex crashes on startup on Windows when WSL is enabled but no distro is installed #16169

Closed

Description

@1529119384

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

Latest version (installed from Microsoft Store)

What subscription do you have?

Individual (ChatGPT)

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Codex crashes immediately on startup with the following error:

An error has occurred
Codex crashed with the following error:

(code=3221225781, signal=null)
Most recent error: None

Environment:

  • Windows 10/11
  • Codex (latest version from Microsoft Store)
  • WSL feature is enabled
  • No WSL distributions installed (wsl -l -v shows none)

Steps to reproduce:

  1. Enable WSL Windows feature (without installing any distro)
  2. Launch Codex
  3. Codex crashes immediately

Expected behavior:
Codex should either fall back to native Windows execution (PowerShell) or show a clear error.

Actual behavior:
Codex crashes immediately with no actionable error message.

Additional context:
My codex-global-state.json does not contain any WSL-related settings:

{
"electron-main-window-bounds": {
"x": 744,
"y": 295,
"width": 800,
"height": 600,
"isMaximized": false
}
}

Workaround:
Manually forcing Windows mode fixes the issue:

{
"runCodexInWindowsSubsystemForLinux": false,
"integratedTerminalShell": "powershell"
}

Hypothesis:
Codex detects WSL availability but does not check whether a valid distro is installed, leading to a crash.

What steps can reproduce the bug?

  1. Enable the Windows Subsystem for Linux (WSL) feature
  2. Ensure no WSL distributions are installed (wsl -l -v shows none)
  3. Start Codex from the desktop or Start menu
  4. Codex crashes immediately with exit code 3221225781

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    appIssues related to the Codex desktop app
    on Mar 29, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    on Mar 29, 2026
  3. 1529119384 commented on Mar 29, 2026

    @1529119384
    Author
    Image
  4. 1529119384 commented on Mar 29, 2026

    @1529119384
    Author

    Resolution

    I was able to resolve this on Windows by repairing/reinstalling the Microsoft Visual C++ Redistributable packages.

    Although the crash initially looked related to WSL detection, the actual root cause on my machine was a broken/conflicting VC++ runtime installation. After reinstalling the VC++ redistributables, Codex started normally.

    What fixed it

    1. Uninstall existing Microsoft Visual C++ 2015-2022 Redistributable packages:

      • x64
      • x86
    2. Reboot Windows.

    3. Reinstall the latest official packages from Microsoft:

      • x64
      • x86
    4. Launch Codex again.

    Notes

    • In my case, the installer previously returned an error consistent with an existing/conflicting VC++ installation.
    • After repairing the VC++ runtime, Codex no longer crashed on startup.
    • So while WSL/no-distro state may still be worth investigating, the immediate startup crash with code=3221225781 on this machine was resolved by fixing the VC++ runtime.

    Suggested improvement for Codex

    It would still be helpful if Codex could:

    • detect missing/broken runtime dependencies more clearly,
    • avoid crashing with a generic code=3221225781,
    • and show a more actionable startup error message.
  5. quhy commented on Mar 30, 2026

    @quhy

    Thank you. I fixed the issue by following your method

  6. zichen526 commented on May 1, 2026

    @zichen526

    我重新安装了这两个插件还是不行

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 appbugSomething 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