How to Install and Update Windows Subsystem for Linux 2 (Premium)

Though this process will be streamlined in the future, installing the Windows Subsystem for Linux (WSL) 2 today requires multiple steps. Here are the steps I’ve used, multiple times, to make sure this goes as efficiently as possible.

Note: These instructions are an excerpt from the Windows 10 Field Guide, which is now being updated for Windows 10 version 2004/20H2. They will be included in a coming update to the book.

Enable hardware virtualization

To get started, you will first ensure that your PC’s hardware virtualization features are enabled in its firmware settings. You can access the interface by navigating to Settings (WINKEY + I) > Update & Security > Recovery and then clicking the Restart now button under “Advanced startup.” When the Windows Recovery Environment appears—it’s a blue screen with the title “Choose an option”—navigate to Troubleshoot > Advanced options > UEFI Firmware Settings > Restart. Your PC will reboot again display its firmware settings interface.

What you see here varies by PC, but you’re looking to enable any available options under a “Virtualization” heading.

Note: On the PC I used to take screenshots for the book, I navigated to Security > Virtualization and enabled the only two options, “Intel (R) Virtualization Technology” and “Intel (R) VT-d Feature.”

Tip: If you’re unsure how to find these or similar options on your PC, consult with your PC maker or use Google search.

Enable optional Windows features

With that done, you can reboot into Windows again. Then, open the Start menu, type feature, and then select “Turn Windows features on or off” from the Start search results. The Windows Features control panel appears.

Scroll down to the bottom of the list and select (enable) the following two features:

  • Virtual Machine Platform
  • Windows Subsystem for Linux

Then, click OK and, when prompted, select the Restart now button to reboot your PC so that the new features can be completely installed.

When that’s done, it’s time to update the Linux kernel used by WSL. In the future, Windows will do so automatically via Windows Update. Temporarily, however, you will probably need to update the kernel manually. To find out whether this is so, open Windows PowerShell (or the Command shell) and type the following command:

wsl --set-default-version 2

If Windows PowerShell responds with “WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel,” then you need to update the kernel manually. So navigate to https://aka.ms/wsl2kernel using Microsoft Edge or another web browser and download the latest WSL Linux kernel package and install it. No reboot is necessary.

Now, when you run the PowerShell command noted above, it will work, and it will simply respond with “For information on key differences with WSL 2 please visit https://aka.ms/wsl2”.

Install a Linux distribution

That’s good, but you’re not done yet. Before you can use WSL, you will need to choose and install a Linux distribution. Curiously, you do this via the Microsoft Store, but you can navigate directly to the correct location in the Store by clicking this link: aka.ms/wslstore.

Here, you can choose between several available Linux distributions.

Note: We will assume Ubuntu here, but each distribution should work similarly.

Select Ubuntu. Then, on the Ubuntu product page, select the Get (or Install) button. Ubuntu will install like any other Store app, and when it’s done, you can select the pop-up notification or the Ubuntu icon in the Start menu to complete the configuration of this new environment. When you do, the Ubuntu terminal window appears.

Configure a user account in Linux

Once the Ubuntu distribution is configured, you’ll be asked to create a username and password. This is specific to Ubuntu and is unrelated to the username and password you use with Windows.

Tip: The Ubuntu account is an administrator-class account, but it behaves differently from your Windows account in one important way: Once it’s configured, you will sign-in to Ubuntu with this new user name automatically every time you launch Ubuntu. That is, you won’t need to type your username and password each time.

Update Linux packages

Once you’ve created your account, Ubuntu will welcome you and suggest that you check for updates. This is reasonable advice, so type the following:

sudo apt update

You’ll be prompted for your password—sudo is the Linux command that elevates the next command you type to have administrative privileges—and you’ll most likely see that at least several packages need to be upgraded.

To upgrade everything, type the following:

sudo apt upgrade

This process may take a few minutes, especially if there are many packages to upgrade. But Ubuntu will display a textual progress bar at the bottom to keep you up to date as it upgrades.

When that’s all done, I recommend running the previous two commands once more in order. You may find, as I have, that there are still a few more updates to do.

But that should do it. Ubuntu will be fully up-to-date and when it needs more updates or upgrades in the future, it will prompt you when you open the Ubuntu terminal window.

Gain unlimited access to Premium articles.

With technology shaping our everyday lives, how could we not dig deeper?

Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.

Tagged with

Share post

Thurrott