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

Microsoft has been making it’s Windows Subsystem for Linux better over the time. And now with WSL 2 update, it is better than ever as it uses real Linux Kernel instead of Linux Kernel compatibility layer. Besides that, you can also run Linux apps in GUI mode with latest update. So, no need of Linux VMs. And for all of this, you just 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 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 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 pretty tricky, it is quite simple and straightforward. You just need to enable Windows Subsystem for Linux from Optional Windows Features and install any Linux distribution from 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 Windows + R keyboard shortcut. After that, type optionalfeatures and press Enter to launch 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 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 Microsoft Store and 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 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 in 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 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 UNIX User Account

If you have installed Ubuntu app from Microsoft Store, you can launch it from 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 rest of the update.

After that, 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 it’s password.

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

Step 4: Install Latest Update on your Linux Distro

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

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

Step 5: Check 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 wsl -l -v command in PowerShell or Windows Terminal to check the WSL version.

Check Wsl Version Using Powershell
Check 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 liked we did in Step 1 of previous section. After that, restart your PC.
  • Next, download and install 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 following commands to set 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 default WSL version and convert from WSL 1 to WSL 2
  • After that, you can use 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 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 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 really helpful for you. Now, you won’t have to switch to another PC for using Linux apps. Besides that, if you are using Windows Terminal, you can launch 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 down below. You may also subscribe to our newsletter to get 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.

Back to top button