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
- Windows 11 (64-bit or ARM64).
- Hardware virtualization enabled in your computer’s BIOS/UEFI settings.
Step 1: Open Windows Terminal as Administrator
- Right-click the Start menu button.
- Select Terminal (Admin) or PowerShell (Admin).
- 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 --installThis 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.
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.
Install your chosen distribution: Run the install command with the
-dflag 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:
- A console window will open, prompting you to enter a new UNIX username.
- Type your preferred username and press Enter.
- Type a password and press Enter (note: characters will not appear on the screen while typing the password).
- 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.
For Ubuntu / Debian:
sudo apt update && sudo apt upgrade -yFor openSUSE:
sudo zypper refresh && sudo zypper update
Managing and Accessing Your Linux Environment
- Launch Linux: Open the Windows Terminal and select
your distribution from the dropdown menu, or type
wslin any command prompt. - Access Windows Files from Linux: Your Windows
drives are mounted under
/mnt/(e.g.,/mnt/c/). - Access Linux Files from Windows: Open File Explorer
and enter
\\wsl$in the address bar to view your installed Linux file systems.