How to Install Linux on Windows 10 Using the Windows Subsystem for Linux (WSL)

How to Install Linux on Windows 10 Using the Windows Subsystem for Linux (WSL)

I watch just about every video David Bombal creates and as I was going through his channel I ran across this:

Kali Linux GUI on Windows 10 (WSL 2)

In the video David walks viewers through the process of installing Kali Linux on a Windows 10 computer. I had never heard of installing Linux on a Windows machine without setting up a dual-boot system or running it on a VM using a solution such as VirtualBox. Using WSL 2 (Windows Subsystem for Linux) you can have Linux on your Windows 10 machine running almost as if it were an app. It is amazing!

Watch the video and you’ll see the process of getting everything set up is not difficult at all.

For those who would rather read through the steps instead of watching a video, I compiled the information I learned from David’s video into the following steps.

1. Check Your Windows 10 Version Number

You need to have at least version 2004 for Windows 10 installed to do this.

1. To check your version, search from your taskbar for winver and open the winver app.

2. Look at the version number displayed. Be sure it’s at least Version 2004.

If you don’t have at least version 2004, search from your taskbar and open Windows Update Settings. Install the necessary updates.

2. Enable the Windows Subsystem for Linux (WSL)

1. Search for and open Powershell. Be sure to choose the Run as Administrator option.

2. You then need to enable WSL by cutting and pasting this command into PowerShell:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

3. After you’ve pasted that command into PowerShell, hit Enter.

3. Enable the Virtual Machine Feature

1. In PowerShell cut and paste the following code into it and hit Enter:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

After this operation completes successfully, you will need to restart your computer to complete the WSL install and the WSL 2 update.

4. Confirm the Features are Enabled

1. From search in your taskbar, search for Turn Windows Features On or Off

2. Once the Windows Features box appears, scroll down and confirm the checkbox next to Virtual Machine Platform is checked and confirm the checkbox next to Windows Subsystem for Linux is checked.

5. Next, Set WSL 2 As Your Default Version

1. In PowerShell copy and paste the following command and hit Enter:

wsl --set-default-version 2

2. If you see this message after running the command…

WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel

… it means you need to install the MSI Linux kernel update package. To do this, go to: https://aka.ms/wsl2kernel and follow the instructions for downloading and installing the latest WSL2 Linux Kernel package. This takes just a few steps.

3. Once you’ve updated the Linux kernel, copy and paste the following command into PowerShell again and hit Enter:

wsl --set-default-version 2

4. Then from the PowerShell prompt type this command:

wsl -l -v

You will likely see this message:

Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Microsoft Store: https://aka.ms/wslstore

That simply means everything has gone as it should and you just need to install Linux now.

6. Install the Linux Distribution You Want to Use from the Microsoft Store

1. Go to the Microsoft Store by clicking the icon in your taskbar or going to this URL with your browser: https://aka.ms/wslstore

2. In the search bar in Microsoft Store search for Linux and you will see the Linux distributions that are available.

3. Choose the distribution you want to use and install it. This is just a matter of clicking Get and then Install from the distribution page.

4. Once that step is completed, click Launch from the distribution page in the Microsoft Store.

7. Set up the Distribution of Linux You Chose

When you first launch a newly installed Linux distribution, a console window will open and your files will begin to de-compress and be stored on your PC. This may take a few minutes.

Once that is complete, you can create your Linux user account and password. This does not need to match your Windows username and password.

If you run into any difficulties, be sure and check the troubleshooting information on this page: https://docs.microsoft.com/en-us/windows/wsl/install-win10