microsoft / microsoft/vscode

VS Code launches `wsl.exe -l -q` in a visible console window on systems without WSL installed

Open
#326,576 2 comments 0 reactions 1 assignee Claimed by @anthonykim1 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes/No

VS Code Version
Version: 1.129.1
Commit: 8a7abeba6e03ea3af87bfbce9a1b7e48fed567b8
OS Version
Windows 11 x64
Steps to Reproduce
Install VS Code on Windows.
Do not install Windows Subsystem for Linux (WSL).
Launch VS Code.
A console window running wsl.exe appears.
The same console window may also appear later while using VS Code.
Actual Behavior

VS Code launches the following command:

cmd.exe /d /s /c "wsl.exe -l -q"

which executes:

wsl.exe -l -q

On systems where WSL is not installed, this opens a visible console window displaying the Windows WSL installation prompt:

Continue by installing Windows Subsystem for Linux...
Press any key to install Windows Subsystem for Linux.
This prompt will time out in 60 seconds.

The console window interrupts normal work.

I have observed this behavior for at least the past 2–3 years across multiple VS Code updates.

Expected Behavior

VS Code should detect whether WSL is available without displaying a visible interactive console window.

If WSL is not installed, the detection should fail silently.

Investigation

I investigated this using Microsoft Process Monitor.

The process tree is:

Code.exe
└── cmd.exe /d /s /c "wsl.exe -l -q"
└── wsl.exe -l -q

The command executed is exactly:

wsl.exe -l -q

I verified that this behavior is not caused by:

Remote - WSL extension (not installed)
Any extension (code --disable-extensions still reproduces)
User settings
Workspace settings
A new clean VS Code profile (code --profile Test still reproduces)

Running the same command manually:

wsl -l -q

produces the same interactive installation prompt.

This suggests that VS Code is probing for WSL by executing wsl.exe -l -q, but on systems where WSL is not installed, the current Windows implementation opens an interactive console window instead of returning silently.

Additional Information

I am not requesting that VS Code stop checking for WSL.

The issue is that the current detection method results in an unwanted interactive console window on systems where WSL is not installed.

I have attached Process Monitor screenshots showing:

Code.exe launching cmd.exe
cmd.exe executing wsl.exe -l -q
The command line used to start wsl.exe

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.