How to Enable Linux on Windows 11 and 10 (WSL 2)

Microsoft has been making its Windows Subsystem for Linux better over time. And now with the WSL 2 update, it is better than ever as it uses a real Linux Kernel instead of a Linux Kernel compatibility layer. Besides that, you can also run Linux apps in GUI mode with the latest update. So, no need for Linux VMs. For all of this, you only need to enable Linux Bash Shell or WSL from Windows Features on your Windows 11 or Windows 10 PC.

If you are using Windows 11 or Windows 10 1903 and newer, you will automatically get the WSL 2 update. However, you will also need to enable Virtual Machine Platform from Windows Features to use WSL 2. But if you are running Windows 10 1809 or older version, you will have to manually install the WSL 2 update on your PC.

SEE ALSO: How to Install and Use Linux on Chromebook?

Enable Linux Bash Shell with WSL 2 Support on Windows 11 and Windows 10

While all of this might sound tricky, it is quite simple. You just need to enable Windows Subsystem for Linux from Optional Windows Features and install any Linux distribution from the Microsoft Store. Follow these steps.

Step 1: Enable Virtual Machine Platform and WSL from Windows Features

First of all, we need to enable Virtual Machine Platform and Windows Subsystem for Linux from Windows Features. To do that, open RUN by pressing the Windows + R keyboard shortcut. After that, type optionalfeatures and press Enter to launch the Optional Windows Features window.

Go To Run Type Optional Features And Press Enter To Launch Optional Windows Features
Go to RUN, type optionalfeatures and press Enter

Now, in Optional Windows Features, enable Virtual Machine Platform and Windows Subsystem for Linux and click OK.

Enable Virtual Machine Platform And Windows Subsystem For Linux From Optional Windows Features
Enable Virtual Machine Platform and Windows Subsystem for Linux

Your PC will ask you to restart after you enable the Linux bash shell with WSL 2 support and Virtual Machine Platform on your Windows 11 or Windows 10 PC. So, restart your PC to continue.

SEE ALSO: How to install Google Play Store in Windows 11 and run Android Apps?


Step 2: Install Linux Distribution (e.g. Ubuntu) from Microsoft Store

Now, after successfully restarting your PC, it’s time to install a Linux distribution on your Windows 11 or Windows 10 PC. So, go to the Microsoft Store, search for Ubuntu or Linux, and select a distribution to install. In this tutorial, we have installed Ubuntu, you can install any other distro of your choice.

Search And Install Ubuntu From Microsoft Store On Windows 11 Or Windows 10
Install Ubuntu from the Microsoft Store on Windows 11 or 10

After successfully installing the Linux distribution, you can launch it from Start by searching for it.


Alternate Method: Enable or Install WSL 2 Linux and Ubuntu Via Terminal or PowerShell (Windows 10 1903 or Newer)

Besides the GUI method, you can also install Linux Bash Shell with WSL 2 support directly from Windows Terminal or PowerShell if you are running Windows 10 1903 or newer or Windows 11.

To do that, open Terminal or PowerShell with Administrator rights on your Windows 11 or Windows 10 PC.

Launch Terminal With Administrator Rights In Windows 11
Launch Terminal with Administrator Rights on Windows 11

After that type wsl --install command to enable or install all components required for WSL 2 Linux support along with the default Ubuntu distro on your Windows 11 or Windows 10 PC.

Enable And Install Wsl 2 Components Via Windows Terminal In Windows 11
Enable and Install WSL 2 components via Windows Terminal in Windows 11

Restart your PC after that to make the features effective.

Restart Your Windows 11 Pc
Restart your Windows PC

Step 3: Launch Linux Bash Shell and Set the UNIX User Account

If you have installed the Ubuntu app from the Microsoft Store, you can launch it from the Microsoft Store itself or by searching on Start.

Search And Open Ubuntu Bash Terminal You Just Installed
Search and Open Ubuntu from Start

However, if you have installed the Windows Subsystem for Linux via Terminal or PowerShell, it will automatically launch Ubuntu Terminal after the restart and complete the rest of the update.

After that, the Ubuntu or Linux terminal will ask you to create a UNIX user for your Linux distro. This user can be different from your Windows user account. So, type a username for your account and set its password.

Setup Ubuntu Linux Bash Shell For The First Use Create Unix User
Setup Ubuntu Linux Bash Shell after the restart

Step 4: Install the Latest Update on your Linux Distro

Now, it’s time to get the latest updates for your Ubuntu distro. Just run the sudo apt update command to install the latest Ubuntu updates. You might be prompted for the password, enter the password you just set in the previous step.

Update Linux Packages Using Sudo Apt Update Command
Update Ubuntu using sudo apt update Command

Step 5: Check the WSL Version of your Linux Distro

You can always check the WSL version on which your Linux distribution (Ubuntu in our case) is running. So, type the wsl -l -v command in PowerShell or Windows Terminal to check the WSL version.

Check Wsl Version Using Powershell
Check the WSL version using Terminal or PowerShell

Upgrade from WSL 1 or WSL 2 (Windows 10 version 1903 or Earlier)

As mentioned earlier WSL 2 has several advantages over WSL 1, so, you might want to upgrade your WSL 1 Linux to WSL 2.

  • For upgrading to WSL 2, you also need to enable Virtual Machine Platform from Windows Features just like we did in Step 1 of the previous section. After that, restart your PC.
  • Next, download and install the following WSL 2 Update package on your Windows 10 PC. You might need to restart your PC after installing the update.
  • Now, open PowerShell as administrator on your PC and type the following commands to set the default WSL version to WSL 2 and convert or migrate existing WSL 1 Linux distributions to WSL 2. Converting WSL 1 distro to WSL 2 may take 5 to 10 minutes.
wsl --set-default-version 2
wsl --set-version Ubuntu 2
Set Default Wsl Version To Wsl 2 And Upgrade Linux Distro From Wsl 1 To Wsl 2
Set the default WSL version and convert from WSL 1 to WSL 2
  • After that, you can use the wsl -l -v command to check the version of Windows Subsystem for Linux on Windows 10 1903 or earlier.
Check Wsl Version Using Powershell Windows 10
Check the WSL version using PowerShell in Windows 10

SEE ALSO: How to Enable the New Alt+Tab Switcher in Windows 11 (Build 22526 and Newer)?

Enable Linux on Windows 11 or 10 and Enjoy the Best of Both Worlds

With a real Linux Kernel, WSL 2 is now almost 20 times faster than WSL 1. So, if you are a student or programmer, this is going to be helpful for you. Now, you won’t have to switch to another PC to use Linux apps. Besides that, if you are using Windows Terminal, you can launch an Ubuntu shell directly from there. Integration with Windows Terminal also makes Linux on Windows even a better alternative to Linux virtual machines.

Hope you liked this post. Feel free to share your thoughts and suggestions in the comment section below. You may also subscribe to our newsletter to get the latest updates directly into your inbox.

Editorial Staff

Hi there, we are the editorial staff at WINDOSPC (former HELLPC). We are a team of funny and technical people. Feel free to get in touch with us via Contact-Us page.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.