how-to, how to, microsoft, windows, microsoft

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.

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

how-to, how to, microsoft, windows, microsoft

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
    wsl – install -d
    how-to, how to, microsoft, windows, microsoft
  • Use the following command if you want to add more distros after the initial installation:
    wsl -d
  • 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.
    how-to, how to, microsoft, windows, microsoft
  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
    how-to, how to, microsoft, windows, microsoft
  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.
    how-to, how to, microsoft, windows, microsoft
  7. Now, enter the following command in PowerShell to set WSL 2 as the default version:
    wsl – set-default-version 2
    how-to, how to, microsoft, windows, microsoft
  8. Finally, go to the WSL Store in the Microsoft Store app. Choose your preferred distro here, and press Get.
    how-to, how to, microsoft, windows, microsoft
  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.

TECH NEWS RELATED

AYA NEO Pocket Air is an Android gaming handheld with OLED display

Android is now fully ready to be utilized in a gaming handheld console. We have already seen a couple of new Android handhelds from big companies last year. And now more companies are launching their handhelds. The one we are talking about today is the AYA NEO Pocket Air. This ...

View more: AYA NEO Pocket Air is an Android gaming handheld with OLED display

Jaguars vs Chiefs live stream: how to watch the NFL playoff game online

(Image: © Getty Images / David Eulitt) Swipe to scroll horizontally Jaguars vs Chiefs live stream Kick-off: Saturday, January 21, 4.30pm ET / 1.30pm PT / 9.30pm GMT TV channel: NBC Live stream: Peacock TV (US) | DAZN (CA) | Sky (UK) | 7Plus (AU) Use ExpressVPN to watch ...

View more: Jaguars vs Chiefs live stream: how to watch the NFL playoff game online

Word can’t do this because a dialog box is open

Microsoft Word is the best word editor available for users. While it is almost perfect, many users report a problem with the application where they encounter the error Word can’t do this because a dialog box is open. The error occurs while creating a new Word document or opening an ...

View more: Word can’t do this because a dialog box is open

A Twisted New Body Dysmorphia Romantic Film Looks Gruesomely Unique

Some movie trailers do their best to push all the information you might need before the premiere to let you properly gauge your interest. Other trailers don’t care about all that and only want to show you a series of odd sequences you cannot piece together, but know you’ll ...

View more: A Twisted New Body Dysmorphia Romantic Film Looks Gruesomely Unique

How to Disable Screenshot Thumbnail Previews on Mac

Modern versions of macOS feature a floating thumbnail preview for screenshots that allows users to quickly apply edits to their screenshots before they save them. If you find this interface too obtrusive, or simply prefer to edit your screenshots later using the Preview app, Here is how you can ...

View more: How to Disable Screenshot Thumbnail Previews on Mac

LG’s smart projector is the square cousin of Samsung’s cool The Freestyle

This Tiny MSI PC is Packed With Power

MSI Following the example set by the Mac Mini, many Windows-powered compact PCs have popped up recently with solid hardware. If none have quite caught your eye, though, maybe this PC by MSI will. MSI has just released a new tiny PC called the Cubi 5 12M, and it’s ...

View more: This Tiny MSI PC is Packed With Power

Logitech’s New Colorful Keyboards and Mice Look Great

Logitech Logitech makes some of the best keyboards and best mice around, and you might be familiar with the company’s RGB-packed gaming products. These new peripherals are really packed with color, but we’re not really talking about lights. Logitech has announced a range of new colors for a bunch ...

View more: Logitech’s New Colorful Keyboards and Mice Look Great

10 Best Solutions To Fix DNS Errors In Windows

[7 Fixes] Windows Photos App Slow To Open Issue In Windows

“Part of the Journey Is the End;” Marvel’s Avengers Seems to be Shutting Down

How To Find Your Laptop IP Address

8 Fixes: Microsoft Windows Security Not Opening

9 Best Ways To Retrieve A Downloaded Movie On Your Laptop

How To Snip Screen On Your Laptop?

How To Connect AirPods To A Laptop?

Satechi Thunderbolt 4 Slim Hub review: A sleek and portable laptop hub

Wi-Fi routers are being hit by a dangerous new Android malware with extra DNS hacks

7 Best Ways To Fix DistributedCOM Error In Windows

12 Easy Fixes For Webcam Not Working In Windows

OTHER TECH NEWS

Top Car News Car News