Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Windows»How to Install Windows Subsystem for Linux (WSL2)

How to Install Windows Subsystem for Linux (WSL2)

Anup ThapaBy Anup ThapaNovember 26, 2022
install-wsl2

If you wanted to run Linux alongside Windows, the only option back in the day was to use a Virtual Machine. Sure, a dual-boot worked too, but it wasn’t quite what most users wanted.

In 2016, Microsoft introduced the Windows Subsystem for Linux (WSL) feature. This allowed users to run Linux tools natively on Windows, including the Linux terminal. 

WSL 2, released in 2020, improves on its predecessor and offers much better performance and compatibility. The installation process has also been tremendously simplified, as demonstrated in this article.

Table of Contents

  • How to Install Windows Subsystem (WSL2) for Linux?
    • Install WSL Command
    • Manual WSL Installation
  • Troubleshooting Installation Errors

How to Install Windows Subsystem (WSL2) for Linux?

First of all, if you’re interested in the differences between WSL1 and WSL2, the linked article covers things like their history and working mechanisms in detail. But the takeaway is that, barring a few exceptions, WSL2 is almost always the better option.

As for the prerequisites, there are 3 cases. In order to use the automated install method, Windows 10 version 2004 (Build 19041) or higher is the minimum requirement.

If performing a manual installation, the same requirement applies to ARM64 systems. For x64 systems, you need Version 1903 (Build 18362) or higher at the minimum.

Install WSL Command

wsl install command

Last year, Windows Insider preview builds introduced the ability to automate the entire installation process by just using the wsl.exe --install command. The command automates the following tasks:

  • Enabling the WSL and Virtual Machine Platform optional features
  • Installing the latest Linux kernel
  • Setting WSL 2 as the default
  • Installing the default Linux distro
  • Prompting a restart during the installation

In July 2021, this functionality was backported to older Windows versions as well, meaning all you need to do these days is execute the wsl --install command in an elevated command prompt window.

There are a couple of catches, though. First, this method only works on Windows version 2004 or higher, as mentioned earlier. For older builds that support WSL2, manual installation is necessary. 

Second, if no options are specified when using the command, it only installs the recommended features with the default distro (Ubuntu). Thus, we recommend getting familiar with some of the commands listed below: 

  • Use either of the following commands to check what Linux distros are available to install:
    wsl --list --online
    wsl -l -o
  • Use the commands from above and note the distro names. Then, use either of the following commands to install WSL with a specific distro:
    wsl --install --distribution <Distribution Name>
    wsl --install -d <Distro Name>
    wsl-install-d-debian
  • Use the following command if you want to add more distros after the initial installation:
    wsl -d <Distro Name>
  • Use the following command to update the WSL Linux kernel:
    wsl --update
  • Use this command if you need to rollback the kernel version:
    wsl --update rollback
  • Use this command to check general info regarding your WSL configuration:
    wsl --status 
  • Finally, use this command to close the WSL 2 VM and all open distros:
    wsl --shutdown

You might also be wondering what to do after you install WSL2. Well, it’s quite simple. First, you open the installed distro from the Start Menu. Next, you set up the admin account for this specific distro. This includes setting the username and password. 

We recommend updating and upgrading the packages at this point, but beyond, you’re free to do as you please. If you feel lost, the getting started with WSL documentation from Microsoft is worth checking.

Manual WSL Installation

As stated, certain earlier Windows builds will require manual installation. The process is a bit longer, but we’re doing the same things as in the prior section. Here are the necessary steps:

  1. To start, reboot your PC and press the BIOS key (Function keys or Del) when booting.
  2. In the Advanced, CPU or similar section, enable the hardware virtualization option. Look for keywords like AMD-V, SVM, VT-d, VT-x, etc.
    enable-svm-mode-bios
  3. Press the key shown on the screen to save the changes and exit (usually F10).
  4. In Windows, press Win + R, type powershell, and press CTRL + Shift + Enter.
  5. Execute the following commands to enable the required components:
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    enable-wsl-dism
  6. Now, download and install the Linux kernel update package. Depending on whether you’re using an x64-based system or an ARM64 machine, use the appropriate link. If you aren’t sure, the run command msinfo32 will be helpful.
    system-type-x64
  7. Now, enter the following command in PowerShell to set WSL 2 as the default version:
    wsl --set-default-version 2
    set-wsl-default-version-2
  8. Finally, go to the WSL Store in the Microsoft Store app. Choose your preferred distro here, and press Get.
    wsl-store-get-linux-distro
  9. At this point, the WSL 2 installation is complete. We recommend checking the prior section for reference on what to do after the installation.

Troubleshooting Installation Errors

We’ve listed some common errors that users encounter during the WSL 2 installation in this section. If you’re facing some problem that’s not covered here, we recommend checking the troubleshooting guide from Microsoft for a more extensive guide.

  • Error 0x8007019e: Make sure the WSL optional component is enabled.
  • Error 0x80370102 or 0x80070003: Make sure hardware virtualization is enabled from the BIOS
  • Error 0x80070003 installation failed: Ensure new programs are saved to your system drive. You can do this from Settings > System > Storage > More / Advanced Storage Settings > Change where new content is saved.
  • Error: WSL 2 requires a kernel update: Update the WSL Linux Kernel. We’ve covered how to do this in both the automatic and manual installation sections. Additionally, make sure the Virtual Machine Platform component is enabled. 
  • Error: No installed distributions: If you haven’t already done so, obviously install a distro first. If you get said error despite this, make sure the distro was installed on the same Windows account you’re currently using.
how-to
Anup Thapa
  • LinkedIn

Anup Thapa is a tech writer at TechNewsToday. He mostly writes informative articles, tutorials, and troubleshooting guides related to Windows systems, networking, and computer hardware. Anup has been writing professionally for almost 5 years, and tinkering with PCs for much longer. His love for all things tech started when he got his first PC over 15 years ago. It was a Pentium IV system running Windows XP on a single 256 MB stick. He spent his formative years glued to this PC, troubleshooting any hardware or software problems he encountered by himself. Professionally, Anup has had brief forays into a variety of fields like coding, hardware installation, writing, etc. In doing so, he's worked with people of different backgrounds and skill levels, from average joes to industry leaders and experts. This has given him not just a versatile skillset, but also a unique perspective for writing that enables him to concisely communicate complex information and solve his reader's problems efficiently. You can contact him at anup@technewstoday.com

Related Posts

how to delete win backup files

How to Delete Backup Files on Windows

January 29, 2023
how to reset password on hp laptop

How to Reset Password on HP Laptop

January 30, 2023
Reset BIOS password

4 Ways to Reset BIOS Password

January 28, 2023
how to make windows 11 look like windows 10

How to Make Windows 11 Look Like Windows 10

January 25, 2023
how to find hidden folder in laptop

How to Find Hidden Folder in Laptop

January 24, 2023
mouse not showing in chrome

Mouse Not Showing in Chrome? Here’s How to Fix It

January 25, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
how long does a cmos battery last

How Long Does a CMOS Battery Last

January 25, 2023
thunderbolt vs usb c

Thunderbolt Vs USB C: What’s the Difference

January 25, 2023
how to find hidden folder in laptop

How to Find Hidden Folder in Laptop

January 24, 2023
You may also like
how-to-connect-headphones-to-tv

5 Ways to Connect Headphones to TV

January 29, 2023
connect-airpods-to-samsung-tv

How to Connect AirPods to Samsung TV? (Step-by-Step Guide)

January 29, 2023
AIO Pump Not Working

AIO Pump Not Working? Here’s How to Fix It

January 29, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday.

Type above and press Enter to search. Press Esc to cancel.