How to Install Linux with WSL on Windows 11

Installing Linux on Windows 11 has become a seamless process thanks to the Windows Subsystem for Linux (WSL). This guide provides a straightforward walkthrough on enabling WSL 2, installing the default Ubuntu distribution or choosing alternatives such as Debian, Kali, or openSUSE, and completing the initial environment configuration directly from the Windows Terminal.

Prerequisites


Step 1: Open Windows Terminal as Administrator

  1. Right-click the Start menu button.
  2. Select Terminal (Admin) or PowerShell (Admin).
  3. Click Yes if prompted by User Account Control (UAC).

Step 2: Install the Default Linux Distribution (Ubuntu)

By default, Microsoft configures WSL to install Ubuntu.

To perform the standard installation, enter the following command:

wsl --install

This command enables the required Windows optional features (Virtual Machine Platform and Windows Subsystem for Linux), downloads the latest Linux kernel, and installs Ubuntu.


Step 3: Install Alternative Linux Distributions (Optional)

If you prefer a distribution other than Ubuntu, you can view and install other available options.

  1. View available distributions:

    wsl --list --online

    (or wsl -l -o)

    This will display a list of supported distributions, such as Debian, Kali-Linux, openSUSE-Tumbleweed, and Ubuntu variants.

  2. Install your chosen distribution: Run the install command with the -d flag followed by the exact name of the distribution:

    wsl --install -d <DistributionName>

    Example for Debian:

    wsl --install -d Debian

Step 4: Restart Your Computer

If this is the first time you are enabling WSL on your system, you must restart your computer to apply the changes.

After restarting, the installation will automatically continue in a new console window.


Step 5: Complete Initial User Setup

Once the distribution finishes downloading and unpacking:

  1. A console window will open, prompting you to enter a new UNIX username.
  2. Type your preferred username and press Enter.
  3. Type a password and press Enter (note: characters will not appear on the screen while typing the password).
  4. Re-enter the password to confirm.

Step 6: Update the Linux System

After setting up your credentials, update your package lists and installed packages to ensure your Linux environment is secure and up to date.


Managing and Accessing Your Linux Environment