How To Install WSL2 On Windows 11: A Step-by-Step Guide


Fix Windows errors with Fortect:
Fortect can repair common computer errors by scanning your entire system for damaged or missing OS files and replacing them with the original, working versions. Optimize your PC in 3 simple steps:

  1. Download and Install Fortect on your PC
  2. Use the PC Scan feature to look up any Windows issues (including drivers)
  3. Right-click on Repair, and fix it within a few minutes.

Besides that, it helps you clean up junk files, fix stability problems, and get rid of annoying programs and malware traces.

Windows Subsystem for Linux (WSL) allows you to run a Linux environment directly on Windows 11, without the need for a virtual machine or dual-booting. WSL 2 is the latest version, offering significant performance improvements over WSL 1 thanks to its use of a lightweight virtual machine. This guide provides a clear, step-by-step process for installing WSL2 on your Windows 11 machine, even if you’re a complete beginner.

By following these instructions, you’ll be able to easily set up a Linux distribution of your choice, opening up a world of development tools and environments without leaving the comfort of your Windows desktop. Let’s get started installing WSL2 on Windows 11.

How Do I Install WSL2 on Windows 11?

Step 1: Enable Virtual Machine Platform and Windows Subsystem for Linux Features

  1. Open the Start Menu and search for “Turn Windows features on or off”.
  2. Click on “Turn Windows features on or off” in the search results.
  3. In the “Windows Features” window, scroll down and check the boxes next to “Virtual Machine Platform” and “Windows Subsystem for Linux”.
  4. Click “OK”.
  5. Restart your computer when prompted.

Step 2: Download and Install the WSL2 Linux Kernel Update Package

  1. Open your web browser and go to the official Microsoft documentation page for WSL2 installation. Search for “WSL2 Linux kernel update package for x64 machines” on Bing or Google.
  2. Download the latest WSL2 Linux kernel update package.
  3. Run the downloaded installer.
  4. Follow the on-screen instructions to complete the installation.

Step 3: Set WSL 2 as the Default Version

  1. Open PowerShell as an administrator. Right-click the Start button and select “Windows Terminal (Admin)” or “PowerShell (Admin)”.
  2. Type the following command and press Enter: wsl --set-default-version 2

Step 4: Install a Linux Distribution from the Microsoft Store

  1. Open the Microsoft Store.
  2. Search for your preferred Linux distribution (e.g., Ubuntu, Debian, Kali Linux).
  3. Click on the distribution you want to install.
  4. Click “Install”.
  5. After the download is complete, click “Open”.

Step 5: Complete the Linux Distribution Installation

  1. A new console window will open, and the installation process for your chosen Linux distribution will begin.
  2. You will be prompted to create a user account and password for your Linux environment. Choose a username and a strong password.
  3. Once the installation is complete, you will be logged in to your Linux environment.

Tips for Using WSL2

  • File System Access: Your Windows files are accessible within the WSL2 environment under the /mnt/c directory (where c is your C: drive). Similarly, Linux files can be accessed from Windows via the network share \\wsl$\<distro_name>.
  • Running GUI Applications: WSL2 supports running graphical Linux applications with a little extra configuration. You’ll need to install an X server on Windows. Search for “Run Linux GUI apps on Windows with WSL” for tutorials.
  • Updating WSL2: Keep your WSL2 installation up-to-date by running sudo apt update && sudo apt upgrade (or the equivalent for your distribution) within your Linux environment.
  • Managing WSL2: Use the wsl command in PowerShell to manage your WSL2 distributions. For example, wsl --list --verbose will show you the installed distributions and their status.

Comparing WSL 1 and WSL 2

Feature WSL 1 WSL 2
Architecture Translation layer Lightweight virtual machine
File System I/O Slower Significantly faster
Full Linux Kernel No Yes
System Calls Not fully compatible Fully compatible
Use Cases Basic Linux tools and scripting Development, running Docker, resource-intensive Linux applications

Embracing Linux Power on Windows 11

Installing WSL2 opens up a new world of possibilities for developers and Linux enthusiasts on Windows 11. With just a few simple steps, you can have a fully functional Linux environment running alongside your favorite Windows applications.

FAQ

What is WSL2? WSL2 (Windows Subsystem for Linux 2) is a feature in Windows 11 that allows you to run a Linux environment directly on Windows without needing a virtual machine or dual-booting.

What are the advantages of WSL2 over WSL1? WSL2 offers significantly improved file system performance, a full Linux kernel, and better system call compatibility compared to WSL1.

Can I run graphical Linux applications in WSL2? Yes, you can run graphical Linux applications in WSL2 by installing an X server on Windows.

How do I access my Windows files from WSL2? Your Windows files are accessible within the WSL2 environment under the /mnt/c directory.

How do I update WSL2? You can update your Linux distribution within WSL2 using the package manager for your distribution (e.g., sudo apt update && sudo apt upgrade for Ubuntu).


Related reading

Readers help support MSpoweruser. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help MSPoweruser sustain the editorial team Read more

User forum

0 messages