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.
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.
Now, in Optional Windows Features, enable Virtual Machine Platform and Windows Subsystem for Linux and click OK.
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.
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.
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.
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.
Restart your PC after that to make the features effective.
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.
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.
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.
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.
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
- After that, you can use
wsl -l -vcommand to check the version of Windows Subsystem for Linux on Windows 10 1903 or earlier.
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.