How to Install Windows Subsystem for Linux in Windows 11

 Install Windows Subsystem for Linux in Windows 11
(Image credit: Tom's Hardware)

Microsoft first offered some degree of Linux compatibility by way of the Windows Subsystem for Linux (WSL) introduced with the Windows 10 Anniversary Update in 2016. That initial version of the utility wasn’t perfect, especially since it used a Linux-compatible kernel developed by Microsoft rather than the genuine article. WSL 2 changed that in June 2019 by incorporating the full Linux kernel right into Windows 10 via the operating system’s built-in Hyper-V hypervisor.

Installing WSL used to be a complicated process that involved manually enabling various services, downloading the utility, and installing it without much assistance from Windows. That changed with later releases of Windows 10, however, and Windows 11 continues to make it easy to start using a variety of Linux distributions in a lightweight virtual machine environment. Here’s how to start using the Windows Subsystem for Linux in Windows 10 and Windows 11.

How to install Windows Subsystem for Linux in Windows 11

1. Launch either PowerShell or Command Prompt as the system’s administrator. This is most easily accomplished by searching for “PowerShell” or “Command Prompt” from the Start menu. Whichever option you choose, don’t just launch the command line by hitting “Enter,” because Windows isn’t going to let you install WSL as a regular user. Instead you should click “Run as administrator” from the search results.

(Image credit: Tom's Hardware)

2. Enter the following command: 

wsl --install

Assuming you launched PowerShell (as shown in our example) or Command Prompt as an administrator, that command should automatically enable the services WSL relies on, download the utility, and install everything it needs to function without any further input. It also downloads and installs Ubuntu, a popular Linux distribution that can be found in everything from single-board computers to enterprise-class servers, by default.

(Image credit: Tom's Hardware)

3. Restart your PC. A notification should appear telling you that WSL has been installed and will be available to use after you restart your PC. You don’t have to restart your system right away, but if you don’t, WSL will remind you it needs to be restarted the next time you try to do anything with the utility. So restart as soon as is convenient. 

WSL will install itself after your reboot.

4. Enter a username and password when prompted by WSL. These will be your credentials for WSL only.

(Image credit: Tom's Hardware)

What to do if you’re told “The requested operation requires elevation”

If you enter “wsl --install” and see an error message like the one below, it’s because you aren’t running PowerShell or Command Prompt as an administrator, and you’ll need to do so if you want to install WSL. Refer to the first step for instructions on how to run the apps as an admin.

(Image credit: Tom's Hardware)

How to install Different Linux distributions in Windows 11

Ubuntu is the default Linux distribution installed alongside the Windows Subsystem for Linux, but it’s not the only “flavor” of Linux compatible with Microsoft’s feature. There are two ways to install alternative Linux distributions with their own default user interfaces, pre-installed utilities, and other features: via the command line and through the Microsoft Store.

Option 1: Command Line

The command line—meaning either Command Prompt or PowerShell—is the most convenient way to install some of the more popular Linux distributions available today. Microsoft doesn’t allow every distribution to be installed that way, likely because there are too many for the company to offer built-in support for, but there are several popular distributions available.

1. Enter the following command:

wsl --list --online

The “wsl” part of the command indicates that we’re using the Windows Subsystem for Linux, the “list” is a list of supported Linux distributions, and the “online” specifier indicates the distributions Microsoft offers rather than the ones we already have running on our PC. This command should return a list of distros that can be installed via the command line.

(Image credit: Tom's Hardware)

2. Enter the following command to install a new distro: 

wsl --install -d <Distro>

This command tells the Windows Subsystem for Linux to install one of the distributions listed via the previous command. At time of writing this includes everything from Debian, a distribution that prides itself on stability and provides the foundation on which distributions like Ubuntu are built, to hacker favorite Kali Linux from Offensive Security

(Image credit: Tom's Hardware)

Option 2: Microsoft Store

Anyone who isn’t quite comfortable with the command line yet can still install Linux distributions via the Microsoft Store. This requires a bit more fiddling than the command line, mostly because it involves a graphical user interface rather than a text-based system, but it should be a familiar process to anyone who’s installed software via a central distribution platform before.

1. Open the Microsoft Store. The app is automatically pinned to the Start menu and Taskbar on new installs of Windows 11, but if you’ve removed it from those default locations, it’s easy enough to launch by searching for “Store” from the Start menu.

(Image credit: Tom's Hardware)

2. Search for “Linux.” Linux distributions don’t have a dedicated section of the Microsoft Store at time of writing, but searching for “Linux” will reveal the distributions available via this point-and-click interface. There are several versions of Ubuntu available for download, for example, along with distributions such as openSUSE Leap. 

(Image credit: Tom's Hardware)

3. Click the distribution you’re interested in, then click “Install.” As long as you have created a Microsoft account, the Microsoft Store should handle the rest of the process. Once it’s complete you’ll have a new distribution to access via the Windows Subsystem for Linux—and one more opportunity to start learning how to use the command line.

(Image credit: Tom's Hardware)

How to use GUI-based Linux software in Windows 11

WSL originally provided access to Linux command line interfaces, which was probably okay for experienced users, but was unlikely to make the operating system more accessible to newcomers. (Not that it’s necessarily in Microsoft’s best interest to convince people that it’s better for them to use a free and open source operating system instead of Windows.) That’s changed, and now it’s possible to use Linux graphical user interface (GUI) apps in Windows.

1. Update WSL using the following command:

wsl --update

This will update Windows Subsystem for Linux so you can use GUI apps via the utility. Note that Microsoft only offers this feature via WSL 2; the first iteration of the utility is still restricted to non-graphics-based interfaces that are clearly separate from Windows itself.

(Image credit: Tom's Hardware)

2.  Restart wsl by typing

 wsl --shutdown

3. Install the appropriate driver for your GPU. Microsoft links to instructions for installing the GPU driver for WSL for Intel, AMD, and Nvidia GPUs. Follow those instructions to ensure your discrete graphics card—or the integrated GPU built into your CPU—is optimized for running graphics-based Linux software alongside Windows itself.

(Image credit: Tom's Hardware)

4. Install the software you want to use. Linux distributions offer various package managers that can be used to install software via the command line; some also offer central distribution platforms similar to the Microsoft Store where Linux apps can be found. It doesn’t matter which installation method you chose, but you must have something installed. Otherwise you’ll be limited to whatever the distribution has built-in.

5. Launch the app, then interact with it like any other Windows app. Microsoft designed WSL 2’s support for GUI apps to resemble the essential Windows experience. Once the software is launched (typically by entering a program-specific command in a terminal emulator) it can be interacted with using on-screen controls, pinned to the Start menu, added to the Taskbar, and otherwise treated like a typical Windows program.

Those are the first steps you need to use the Windows Subsystem for Linux. It might take a while to get used to command line-focused tools and Linux’s idiosyncrasies, but this feature makes it easier than ever to use Linux- and Windows-based software in harmony.

More Windows 11 Tutorials:

Nathaniel Mott
Freelance News & Features Writer

Nathaniel Mott is a freelance news and features writer for Tom's Hardware US, covering breaking news, security, and the silliest aspects of the tech industry.