Windows Subsystem for Linux (WSL) was introduced on Windows 10 as a way to natively run a Linux bash terminal within the Windows environment. As covered in a similar post for Windows 10, it’s primarily intended for hobbyists and developers and not for production workloads. On Windows 11, the installation remains straightforward, however, a quick update may be necessary as WSL has evolved behind the scenes to WSL 2, which supports a proper Linux kernel using Hyper-V technology.
Partner Link: Doogi is making remote work feel a little less remote, and they’re expanding beta access for technology early adopters. Learn more and sign up today!
Installing the Windows Subsystem for Linux on Windows 11
- Click the Start button in the taskbar and type (then select) Turn Windows Features on or off.
- In the Windows Features dialog, scroll to the bottom and check the box next to Windows Subsystem for Linux.
- Click OK.
WSL will be installed and may require a reboot. After installing the subsystem, you can then install a Linux distribution.
Installing a Linux Distribution
Here’s where the Windows 11 guide starts to differ from the previous version of Windows. The Microsoft Store used to host a nicely curated selection of Linux distros under a group titled “Run Linux on Windows”. Now, a non-curated list is dumped to the screen, which requires more consideration from users.
- Click the Windows button in the taskbar and type (then select) Microsoft Store.
- Once loaded, search for Linux WSL.
- Note that not all results will be WSL Linux distributions
Select a distribution and click Get. See the example for the Debian distro below. After installation, you’ll be able to launch it from the store or the Start menu (e.g. you could just click Start and type Debian to see the launchable app. You can also type debian to run it from cmd or PowerShell.
If an error is displayed about requiring an update to the WSL 2 kernel (see example below), complete the following steps to resolve the issue.
To resolve an outdated WSL 2:
- Navigate to Microsoft’s WSL2 update page at https://aka.ms/wsl2kernel
- Click the link to download WSL2 Linux kernel update package for x64 machines.
- Run the downloaded file (wsl_update_x64.msi)
The updater looks like this:
Running Linux from within Command Prompt allows you to perform native Linux commands from within the same cmd window. When started from the start menu, it will load into its own Linux terminal window, which may feel like a slightly more native experience.
Although this feature is relatively new in the grand scheme of things, it would be nice if Microsoft would roll the required WSL 2 update into all modern versions of Windows, or at least into the Microsoft store when installing a Linux distro like Debian. It’s also unfortunate that they dropped the curated Linux distro list in the Microsoft Store, but it’s understandable as Linux itself is still considered competition for their bread and butter Windows operating system.
On a positive note, the distribution installation is tiny and incredibly quick. The download for Debian was less than 90MB. This is because the distro is bare-bones. In a flavor like Debian, you’ll want to run sudo apt-get update at the very least so you can install basic Linux apps you will likely want to run.