Installing Kali Linux on Windows using WSL (Windows Subsystem for Linux)

Fahmi J
3 min readJun 8, 2020

In this article, I’ll share about how to install Kali Linux on WSL. This tutorial would also work for other Linux distribution you want to install.

Get Kali Linux from Ms. Store

First, you’ll have to download and install the official Kali Linux distribution on Microsoft Store.

If you faced this error message upon installing it,

WSLRegisterDistribution failed with error: 0x8007019e

Then open up your PowerShell with administrator privileges and run the following command.

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

Alternatively, you can go to “Windows Features” using Windows search feature.

Then check the “Windows Subsystem for Linux”.

Once done, restart your machine.

Set Your Username and Password

Now open the installed Kali Linux from start menu.

Set your initial username and password.

For root access, type sudo su, then input your initial password.

With root shell, you can change the root account password, by typing passwd, and then enter the new password you want to set for the root account (for me, user iamf and root are using different password).

So this command uses iamf’s password.

iamf@MSI:~$ sudo su

While this command uses root’s password

iamf@MSI:~$ su -

Update the Packages

Even though this is Kali Linux, it’s lack of built-in tools. But, you can install any tools you need after updating the package list.

apt update

After that you can install the standard Kali tools like nmap, gobuster, but I recommend you not to use this for, like playing on HTB or THM, so stick with VM.

Closing

In my personal opinion, it suits for software development purposes, especially with the WSL2.

This might be a bit out of topic, but, if you need containerization like Docker, I would prefer not to use it on Windows by upgrading your WSL1 to WSL2. Docker on Windows with WSL2 integration consumes a huge amount of RAM also it (currently) has so many limitations on the networking side, trust me.

--

--

Fahmi J

Just curious to learn how things work, especially in digital world.