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.
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.
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.
sudo -e /etc/hosts
Sample /etc/hosts File
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:# [network]# generateHosts = false127.0.0.1 localhost127.0.1.1 OLD_HOST_NAME.localdomain OLD_HOST_NAME# The following lines are desirable for IPv6 capable hosts::1 ip6-localhost ip6-loopbackfe00::0 ip6-localnetff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allrouters
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.