How to install WSL2 on Windows 10: – A Linux User’s Guide

WSL 2 is a Microsoft gift for Windows 10 developers that thrives well in the Linux development environment. If you have used and loved the Windows Subsystem for Linux 1, you will appreciate the architectural and operational transformation that comes with it. And if you have decided to learn how to install Linux WSL 2, you seem to be as eager as many other developers around the world to check the performance efficiency, fast boot times, Windows / Linux seamless interaction, and other perks.

Linux logo

Another nice thing about WSL 2 is that it comes with a full Linux kernel. In addition, you do not need to design or control any virtual machine to accelerate the platform. It uses an ultra-lightweight VM that runs behind the scenes, allowing you to focus on your main Linux development workflows.

If you’re ready to start exploring WSL 2 on Windows 10, here’s how to get the setup right:

Implement WSL on Windows 10

WSL is an optional feature in Windows, and is usually disabled by default. So no matter what version of WSL you are installing, you need to enable Windows Subsystem for Linux before proceeding.

Follow these steps to get started:

  1. Type “powershell” into the Windows command prompt and press enter
  2. Right click on it Windows PowerShell in the search result and click on it Run as administrator to launch the app
  3. Type this command: dism.exe / online / enable-feature / featurename: Microsoft-Windows-Subsystem-Linux / all / norestart

Your PC will no longer need to be restarted since you are setting it up for WSL 2 instead of WSL 1. But at least for now, your computer is ready to install WSL 1 distros after reboot. -start.

Follow these steps to install WSL 2 on Windows 10

Check your PC System Specs

WSL 2 is built for super-fast workflows, which is why it keeps a lot of love from Linux developers who still use Windows 10. But older versions of Windows (more lower than build 18362) supports the basic WSL 2 architecture, much less the VM experience.

Microsoft provides pre-requisites for installing WSL 2 as follows:

  • You must be on a Windows 10 PC
  • X64 PCs must be running on Windows 10 version 1903 or higher, and must build 18362 or higher
  • ARM64 PCs must have Windows 10 2004 or later, with build 19041 or later

You can still upgrade to Windows 10 version 2004 or even update October 2020 if your current version is not compatible with WSL 2. Be sure to check Windows Update Assistant to get the latest 2-compatible WSL OS build.

Activate the WSL 2 VM

Just like WSL, the Virtual Device Platform is turned off by default in Windows 10, so you need to turn it on before installing WSL 2. The game-changing virtualization technology is one of the reasons that WSL 2 performs significantly better than its predecessor.

To implement the lightweight utility VM that works so well on a real Linux kernel, follow these steps:

  1. Open the PowerShell app. Make sure you launch it as admin as you did the first time.
  2. Enter and run this command: dism.exe / online / enable-feature / featurename: VirtualMachinePlatform / all / norestart
  3. Restart your PC in preparation for the Linux kernel update

Download and install the latest Kernel WSL 2 update

WSL2 runs a full Linux kernel with the help of one of the most advanced VM technologies. So, now you need to download and install the latest Linux kernel update. Here are the steps:

  1. Get the latest Linux kernel update for your PC. You can download the package manually here if you are using an x64 PC. ARM64 users can download the files here.
  2. Double-click the executable file to install the Linux kernel update on your Windows 10 PC. Agree to all enhanced permission requests to proceed with installation.

Congratulations! You now have WSL 2 installed on your PC, and you are ready to install your favorite Linux distros. But WSL 1, which is already installed on your device, is the default platform for running the distros.

So before you download any new Linux distros, you need to set WSL 2 as the default version on Windows 10.

How to set WSL 2 as the default Platform

Here are the steps to set WSL 2 as the default platform when adding new Linux distros:

  1. Launch PowerShell
  2. Run this command: wsl –set-default-version 2

Now you are ready to add Linux distros to your new WSL2 installation.

Download and Install Linux Distributions

You probably have your favorite Linux distro in mind right now. Choices depend on many factors, from your capability levels and operating environments to essential hardware resources. Follow these steps to download and install your favorite Linux WSL 2 distro:

  1. Proceed to the Microsoft Store Microsoft Store
  2. Choose a solution from the distro list that includes Ubuntu, Kali Linux, Debian GNU / Linux, and more
  3. On the distro page, click Get to download and install it on your Windows 10 PC

Windows 10 will take a few minutes to install a new Linux distro to use. But once the distro integrates with the OS, it only takes a few seconds to launch.

Concluding remarks

If you want to speed up the rich Linux ecosystem and developer resources along with the excellent tools you have in Windows 10, WSL 2 will never disappoint. Hopefully, you can now install and configure WSL 2 on your PC to start building robust software solutions.

The post How to install WSL2 on Windows 10: – Linux User Guide first appeared on TechtricksNg.

Leave a Comment

×