Kali Linux (Windows Subsystem for Linux)
The Windows Subsystem for Linux (WSL) is a compatibility layer developed by Microsoft that allows you to run a Linux environment directly on Windows without the need for a virtual machine or dual-boot setup. This guide will show you how I set up my Kali WSL.
Requirements
- Windows 11/Windows 10 v2004+
Enabling Windows Subsystem for Linux (WSL)
Read Microsoft Learn's documentation for more detailed and up-to-date information.
Run the Windows Command Prompt or PowerShell as administrator and run the following command:
If you have to install WSL manually, you have to run the following commands instead:
After a system restart, you’ll have to download and install the Linux kernel update package.
Installing and Setting Up Kali Linux WSL
Open a Windows Command Prompt or PowerShell, and run the following command to install Kali Linux WSL:
It is recommended that you install from the Microsoft Store instead.
It will start downloading the distribution and after a few minutes you will be asked for a new UNIX username and password. When you finished setting up the your new Kali Linux credentials, update the system.
Edit the /etc/wsl.conf
file according to your needs. You can see the documentation here: Advanced settings configuration in WSL | Microsoft Learn
After changing the hostname via wsl.conf
, you now have to update the hosts
file. Open it and change all occurences of the old hostname with the new hostname you’ve chosen.
Sample
/etc/hosts
File
I recommend that you use my custom ZSH configuration for more convenience. After that, we’ll have to install some dependencies of the packages that we’ll download and install.
It is also a good time to create directories that you’ll use often:
Download software that are not available on the Kali repositories or are not up-to-date:
I also recommend that you install my custom Neovim configuration if you’re using Neovim for software development.