Featured - Install Windows Subsystem for Linux (WSL) in Windows 11

The Windows Subsystem for Linux (WSL) is a near life-changing tool for many developers. Released by Microsoft in 2016, it lets users run a GNU/Linux environment directly in Windows with no need for dual-booting or virtual machines. Today we’re going to show you how to enable the Windows Subsystem for Linux on Windows 11 so you can make use of this useful tool yourself.

What is WSL?

Advertisement

Before we start, let’s talk a little about what WSL is, what it lets you do, and the differences are between WSL and WSL2.

The Windows Subsystem for Linux is a compatibility layer that allows users to run Linux binary executables – granting access to Linux applications, utilities, and command-line tools. WSL, also known as WSL1, is not capable of running all types of Linux software. It is unable to run 32-bit binaries or ones that require specific Linux kernel services.

What is WSL2?

WSL 2 is an upgraded version of WSL1 that introduced a real Linux kernel. It maintains the ability to run ELF64 binaries while also providing full system call compatibility and increased file system performance. WSL 1 is a requirement for WSL2 and can be used independently of it.

When you do a WSL2 install on Windows 11, it will use a new streamlined process. First, it will enable WSL (WSL) and the Virtual Machine Platform as optional features. It’ll then download and install the latest Linux kernel, set WSL2 as the default, and download and install your specified Linux distribution.

There are two ways to enable WSL and install Linux on Windows 11 – through the command-line and the Microsoft Store. We’ll be showing you both today: 

How to Enable WSL and Install Ubuntu on Windows 11

We’ll first walk you through the terminal method to enable WSL in Windows 11. After all, it is targeted at developers, who should be familiar with the command line.

We’ll be showing you how to install Ubuntu on Windows 11 via WSL, but you can choose any supported distribution you like, such as Kali, OpenSUSE, or Debian:

  1. Right-click the Start button and choose “Windows Terminal (Admin)”

    Windows 11 - Open Elevated Windows Terminal

  2. Press the down arrow next to the new tab icon and click “Command Prompt”

    You can alternatively press “Ctrl + Shift + 2” on your keyboard.

    Windows 11 - Elevated Windows Terminal - Open Cmd Prompt

  3. Check what Windows 11 Linux distributions are available

    You can do so by running the following command:

    wsl --list --online

    You’ll get an output with “NAME” and “FRIENDLY NAME” columns. It’s the “NAME” you should use in the next step.

    Windows 11 - Elevated Windows Terminal - Cmd Prompt - Cmd for Linux Distribuitions

  4. Enable WSL and install Linux on Windows 11 in a single command

    Thanks to Microsoft’s streamlined process, you can install Ubuntu on Windows 11 (or other distros for that matter) with the following single command:

    wsl --install -d Ubuntu-20.04

    You should replace Ubuntu-20.04 with the NAME of whichever distro/distro version you’d like to install. Unless, of course, you want to install Ubuntu. The command wsl --list --onlinewill provide you with a list of all currently available Linux distributions.

    Windows will take a little while to enable Windows Subsystem for Linux, download the necessary distro, etc. You may have to restart at some point during this process. Wait for this process to complete, then continue to the next step.

    Windows 11 - Elevated Windows Terminal - Cmd Prompt - Linux Distribuitions - Cmd for Install Ubuntu 20.04LTS

  5. Enter your user details

    Once your distribution has finished installing, you’ll notice that WSL will open a command-line window in your chosen distribution – in our case called “winbuntu”.

    You’ll be prompted to enter a username and password. Once you enter them correctly you should see the message “Installation successful. You’ll then be able to enter your Ubuntu commands.

    Windows 11 - Elevated Windows Terminal - Cmd Prompt - Linux Distribuitions -Install Ubuntu 20.04LTS - Type Username & Pass

  6. How to run a Linux distro on Windows 11

    Once you’ve installed your distro and closed the window, you can open it again at any time by typing its name in the search bar of your Start menu. In our case, that means searching for “Ubuntu” and clicking the top result.

    Windows 11 - Open Ubuntu

  7. Use Linux on Windows 11 to run your commands

    You can now type any command you like after the $ and use the Linux terminal similarly to how you would in the actual distro.

    Windows 11 - Ubuntu

How to Enable WSL and Install Linux on Windows 11 via the Microsoft Store

A more user-friendly way to enable WSL + WSL2 and install Linux is through the Microsoft Store. You can complete the entire process automatically, without a single command.

  1. Open the Windows Terminal as (Admin)

    Windows 11 - Open Windows Terminal

  2. Run the DISM command to enable the Virtual Machine Platform optional component

    Run dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all in CMD or PowerShell.


    00 Windows 11 Terminal - DISM
  3. Open the Microsoft Store

    Press Start and search for “Microsoft Store”, then click the top result.


    Windows 11 - Open Microsoft Store
  4. Install the Windows Subsystem for Linux Preview App

    You can use this link to the Windows Subsystem for Linux Preview if it does not show up in search. What´s behind this app and a FAQ about it can be found here.

    00.2 Windows 11 - Microsoft Store - Windows Subsystem for Linux Preview App

  5. Search for a Linux distro in the Microsoft Store and press “Install”

    In your case, we’ll be installing Kali Linux on Windows.

    Windows 11 - Microsoft Store - Install Kali Linux

  6. Press “Open” once the distro has finished installing

    Windows 11 - Microsoft Store - Install Kali Linux - Open

  7. Enter your desired username and password in the command window and close it

    Windows 11 - Kali Linux - Login

  8. Open Linx on Windows 11 at any time by searching for your distro in the start menu

    Windows 11 - Open Kali Linux

  9. Type whatever commands you require and press “Enter”

    Windows 11 - Kali Linux

How to Enable Windows Subsystem for Linux on Windows 10

Windows 10 Subsystem for LinuxThat’s the gist of how to enable WSL on Windows 11 and use it to run Ubuntu, Kali, or other Linux distributions. If you’re still on Windows 10, however, the process may be a little different. You can follow our dedicated how to install the Windows Subsystem for Linux on Windows 10 guide for more info.

How to Enable and Use SSH Commands in Windows

How to Enable and Use Windows 10’s New Built-in SSH CommandsIf WSL and WSL2 isn’t enough for you, you may decide to rent a virtual private server (VPS) running Linux is your best bet. That way, you’ll get access to your own remote server running a full-fat version of Linux. If that’s the case, you’ll want to know how to enable and use SSH commands in Windows 11/Windows 10 so that you can connect to it.

Advertisement