How to install Windows Subsystem for Linux 2 (WSL 2) on Windows 10

A month ago, at its Build 2019 developer conference, Microsoft announced Windows Subsystem for Linux 2, an updated version of its compatibility layer which ships with an actual Linux kernel, meaning full system call compatibility.

Last week, the software giant rolled out Windows 10 20H1 Build 18917 with Windows Subsystem for Linux 2 (WSL 2). Here’s how to install it.

SEE ALSO:

The first thing you need to do is make sure you’re running at least Windows 10 20H1 Build 18917. Type Winver into the search box and hit enter.

Assuming you have Build 18917, or newer, you now need to install the optional feature. To do this, right-click the Start button and select Windows PowerShell (Admin).

Enter this command:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

When asked, reboot your PC.

The next stage is to install a Linux distro to run on it. There are a number of these available in the Microsoft Store -- Ubuntu, Suse Linux Enterprise Server 12, Debian, and Kali Linux. We’ll choose Ubuntu, but it’s up to you. Once downloaded, install it through the Start menu.

Re-open Windows PowerShell as an Administrator, and enable the Virtual Machine Platform using this command:

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Reboot your PC again.

The last step is to configure the installed distro -- Ubuntu in our case.

Open Windows PowerShell and type:

wsl -l -v

This will list all of the available distros on your PC.

To set your distro, type this command:

wsl --set-version Distro 2

Replace 'Distro' with the actual distro name. Which is 'Ubuntu' for us (so, wsl --set-version Ubuntu 2).

Next, set that distro as the default by typing:

wsl --set-default-version 2

That’s it, you’re now ready to start using WSL 2.

10 Responses to How to install Windows Subsystem for Linux 2 (WSL 2) on Windows 10

© 1998-2024 BetaNews, Inc. All Rights Reserved. Privacy Policy - Cookie Policy.