Running Ubuntu on Windows 10 with WSL2 (Windows 11 Update)

wsl logo
3 mn read

Originally published by Mauro Giusti on April 19, 2020

Are you torn between using Linux or Windows? With Windows Subsystem for Linux 2 (WSL2), you can have the best of both worlds! This guide will walk you through setting up Ubuntu on Windows 10 using WSL2, with an update for Windows 11 users.

Windows 11 Update (December 2021)

Setting up WSL2 on newer Windows versions, including Windows 11, is now much simpler. Just follow these steps:

  1. Open PowerShell as Administrator
  2. Run the command: wsl --install

This will enable the necessary settings and update the Linux kernel to the latest version.

To see available Linux distributions, use:

To install Ubuntu (the default), simply run:

For more details, visit the official Microsoft documentation on installing WSL

Setting Up WSL2 on Windows 10 (Original Guide)

Step 1: Ensure You Have the Right Windows 10 Version

You’ll need at least Windows 10 May 2020 Update (version 2004) to install WSL2.

To check your version:

  1. Press Windows+R
  2. Type winver.exe and run it

If you have an older version, update Windows 10 to the latest version.

Step 2: Install WSL2

  1. Open PowerShell as administrator
  2. Run the following commands:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
WSL2 Linux kernel update installer
  1. Reboot your PC
  2. Download and install the WSL2 Linux kernel update from https://aka.ms/wsl2kernel
WSL2 Linux kernel update
WSL2 Linux kernel update
  1. Set WSL2 as the default:
wsl --set-default-version 2

Step 3: Install Ubuntu on WSL2

  1. Open the Microsoft Store
  2. Search for “Linux”
  3. Choose your preferred Ubuntu version (e.g., Ubuntu 18.04 LTS)
  4. Click Install

  1. Once installed, launch Ubuntu from the Start menu
  2. Set up your username and password

Step 4: Verify WSL2 Installation

Open PowerShell and run:

If it shows version 1, upgrade to version 2(replace Ubuntu-18.04 with your ubuntu version):

wsl --set-version Ubuntu-18.04 2

Congratulations! You now have a full Ubuntu distribution running on your Windows PC using WSL2.

Leave a Reply

Your email address will not be published. Required fields are marked *

Reading is essential for those who seek to rise above the ordinary.

ABOUT US

The internet as we know is powerful. Its underlying technologies are transformative, but also, there’s a plethora of haphazard information out there.We are here to serve you as a reliable and credible source to gain consistent information

© 2024, cloudiafrica
Cloudi Africa