codex - 💡(How to fix) Fix VS Code Remote SSH to Windows host without WSL fails: extension runs wsl.exe --status and crashes with ENOENT [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19844Fetched 2026-04-28 06:36:06
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Error Message

Example error: [execWindowsCommand] command exception args=--status command=wsl.exe errorCode=ENOENT errorMessage="spawnSync wsl.exe ENOENT"

Root Cause

This looks related to local environment / OS detection. Newer builds fail with wsl.exe ENOENT; older 26.406 builds are incompatible with the current UI because local-environments is not supported in the extension.

RAW_BUFFERClick to expand / collapse

What version of the IDE extension are you using?

Tested: - 26.422.30944 - 26.417.40842 - 26.415.20818 - 26.409.20454 - 26.406.31014 - 26.406.40811

What subscription do you have?

Plus

Which IDE are you using?

Visual Studio Code with Remote SSH

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

The Codex IDE extension cannot connect/use tools in a VS Code Remote SSH workspace where the remote host is Windows Server and WSL is not installed.

The extension appears to run wsl.exe --status during OS/local environment detection. Since WSL is not installed on the remote Windows host, wsl.exe does not exist and the extension fails before it can run basic commands.

Remote checks: where.exe wsl -> INFO: Could not find files for the given pattern(s). Test-Path C:\Windows\System32\wsl.exe -> False

Errors by version: 26.422.30944 -> spawnSync wsl.exe ENOENT 26.417.40842 -> spawnSync wsl.exe ENOENT 26.415.20818 -> spawnSync wsl.exe ENOENT 26.409.20454 -> spawnSync wsl.exe ENOENT 26.406.31014 -> local-environments is not supported in the extension 26.406.40811 -> local-environments is not supported in the extension

Example error: [execWindowsCommand] command exception args=--status command=wsl.exe errorCode=ENOENT errorMessage="spawnSync wsl.exe ENOENT"

What steps can reproduce the bug?

  1. Use VS Code Remote SSH to connect to a Windows Server host.
  2. Ensure WSL is not installed on the remote host:
    • where.exe wsl returns not found
    • Test-Path C:\Windows\System32\wsl.exe returns False
  3. Install/enable the Codex IDE extension on the SSH remote.
  4. Open a remote workspace folder.
  5. Start Codex and ask it to run a basic command such as hostname or pwd.

The extension fails during local environment/OS detection before the command can run.

What is the expected behavior?

On a Windows Remote SSH host, the Codex IDE extension should use native Windows/PowerShell and should not require WSL.

If WSL is not installed, the extension should ignore/fallback instead of crashing with spawnSync wsl.exe ENOENT.

Additional information

This looks related to local environment / OS detection. Newer builds fail with wsl.exe ENOENT; older 26.406 builds are incompatible with the current UI because local-environments is not supported in the extension.

I also see a similar issue in Codex app SSH connection to Windows hosts, where it appears to try Linux/sh instead of Windows/PowerShell.

extent analysis

TL;DR

The Codex IDE extension fails to connect or use tools in a VS Code Remote SSH workspace on a Windows Server host without WSL, due to its attempt to run wsl.exe during OS detection.

Guidance

  • The issue seems to stem from the extension's reliance on wsl.exe for OS detection, which is not present on the remote Windows host without WSL.
  • To verify the issue, check if wsl.exe is present on the remote host using where.exe wsl or Test-Path C:\Windows\System32\wsl.exe.
  • A potential workaround could be to modify the extension's OS detection logic to fallback to native Windows/PowerShell when wsl.exe is not found.
  • The extension's behavior is expected to use native Windows/PowerShell on a Windows Remote SSH host without WSL, instead of requiring WSL.

Example

No code snippet is provided as the issue seems to be related to the extension's internal logic and not a specific code block.

Notes

The issue might be related to the extension's compatibility with different Windows versions and WSL installations. The fact that older builds (26.406) show a different error message (local-environments is not supported in the extension) suggests that the extension's behavior has changed over time.

Recommendation

Apply workaround: Modify the extension's OS detection logic to handle the case where wsl.exe is not present, allowing it to fallback to native Windows/PowerShell. This would enable the extension to function correctly on Windows Server hosts without WSL.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix VS Code Remote SSH to Windows host without WSL fails: extension runs wsl.exe --status and crashes with ENOENT [1 participants]