July 30th, 2021

Install WSL with a single command now available in Windows 10 version 2004 and higher

Craig Loewen
Senior Product Manager

In the latest Windows Insider Preview builds, you can install everything you need to run WSL just by running wsl.exe --install. We’re excited to announce that this functionality is now officially backported to Windows 10 version 2004 and higher, which will make installing WSL on those builds much easier!

Using wsl --install

Image wslupdate

The process to set up WSL was previously too complicated, involving turning on multiple settings and installing multiple packages. We’ve simplified the process down to just one command, simply open a command prompt window with admin privileges and run wsl.exe --install. Once you hit enter, the process will automatically enable the WSL optional features required, install the Ubuntu distribution by default, and install the latest WSL Linux kernel version onto your machine. When it’s completed and you restart your machine, your distribution will start after you boot up again, completing the installation.

Additionally, you can find a list of Linux distributions available to install by entering the command wsl --list --online in PowerShell or Windows Command Prompt. To install a distribution other than, or in addition to, the Ubuntu default, use this command: wsl --install -d <DistroName>

Replace <DistroName> with the name of a Linux distribution found in the previous list command. This install command can be used for first time installation or for adding additional distributions after you already have WSL installed with the default Ubuntu distribution.

Additional commands

We’ve also included some additional commands to help you manage your WSL instances with this backport.

You can use wsl --update to manually update your WSL Linux kernel, and you can use wsl --update rollback to rollback to a previous WSL Linux kernel version.

Lastly, you can use wsl --status to see general information about your WSL configuration, such as default distro type, default distro, and kernel version.

Update your Windows 10 version to support these commands

You can get this backport just by updating Windows like normal. To manually do this open Windows Settings, go to ‘Updates and Security’ and hit ‘Check for Updates’.

Windows Settings check for updates

This update is part of KB5004296 and you can find full instructions on how to ensure you have it installed and its changes here. At the time of writing, when you click “Check for Updates” you might see an available optional update, ensure that it has the same number as KB5004296, install it, and you’ll get access to wsl --update.

Where to give us your feedback

As always, you can follow up with WSL team members, or with me on Twitter. If you’re experiencing technical issues please file them on the Microsoft/WSL Github repo. Learn more about WSL, including how to set up common development tools like Git, VS Code, Docker containers, databases, GPU acceleration for machine learning, and more, by visiting the WSL documentation. Happy coding!

Author

Craig Loewen
Senior Product Manager

2 comments

Discussion is closed. Login to edit/delete existing comments.

  • John Rocha · Edited

    A key step that’s missing — Ensuring the WSL feature is turned on for your system.
    1. Windows Start menu Search
    2. Turn Windows Features on or off.
    3. Validate “Windows Subsystem for Linux” is checked

    Then after that doing another Windows Update to pull in any “missing” WSL updates.

    Enabling the feature may require a restart.

    The WSL.EXE file is not present if this feature is not enabled.

    • ‪ ‪ · Edited

      You are completely wrong.
      After installing KB5004296, wsl.exe is present even if WSL is not enabled.