microsoft / microsoft/WSL

Wrong usage of `wsl --install` does not give a helpful error message

Open
#7,072 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

Windows Build Number

10.0.21390.2025

Repro Steps

Type in any of the following commands:

wsl --install when wsl is already installed

wsl --install ubuntu

or any other misuse of wsl --install

Expected Behavior

I expect WSL to indicate that I made a syntax error.

In the specific case of wsl --install and wsl --install <distro>, more specific error messages could be printed such as WSL is already installed! Use "wsl --install -d <dist>" to install a new distribution. and Syntax error! Did you mean to run "wsl --install --distribution {the distro they typed in}"?.

Actual Behavior

WSL prints the --help output without any indication that there was a syntax error. I seriously thought that --install was just broken when I tried wsl --install ubuntu.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing wsl --install when WSL is already installed and wsl --install ubuntu, then trace the WSL CLI argument handling for --install. Done means misuse produces a syntax-specific error instead of only the --help output, including guidance for the distribution form.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.