- see requirements: https://docs.microsoft.com/en-us/windows/wsl/install-win10#step-2---update-to-wsl-2
- WSL1 vs. WSL2: https://docs.microsoft.com/en-us/windows/wsl/compare-versions
- see old write up: https://www.kali.org/news/kali-linux-in-the-windows-app-store/
- run in powershell as admin:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
wsl --set-default-version 1
- search the windows store for kali and install, or:
Invoke-WebRequest -Uri https://aka.ms/wsl-kali-linux-new -OutFile Kali.appx -UseBasicParsing
Add-AppxPackage .\Kali.appx
- run
kali
, set the user and exit. - Verify that kali is installed on WSL 1:
kali #go through initial installation
wsl -l -v
- download WSL 2 latest kernel and install: https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel
- Install virtual machine platform, which allows WSL 2 virtual machines:
#if required, you must enable virtualization support in your machine's BIOS (you can access the UEFI BIOS on Windows 10 easily by running `shutdown -r -o`)
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -all
bcdedit /set hypervisorlaunchtype auto
reboot -r -o -f -t 0
#go into the UEFI BIOS. This will force a /full/ reboot and is required after changing the hypervisorlaunchtype.
- migrate the kali WSL distro from WSL 1 to WSL 2:
wsl --set-version kali-linux 2
wsl -l -v
- update kali:
sudo apt full-upgrade -y
sudo apt update
sudo apt full-upgrade -y
[ -f /var/run/reboot-required ] && sudo reboot -f
- install a desktop environment:
sudo apt install -y kali-win-kex
sudo apt install -y kali-defaults kali-root-login kali-linux-default
# continue through and pick reasonable answers (probably defaults)
#run win-kex in full mode (suggest that you use virtual desktops, so you can easily switch between a Windows 10 desktop and kali)
kex --win -s
#run win-kex in seamless mode, with the xfce task pane
kex --sl --s
Exiting the process (in this case kali
) will not kill the distribution.
- list running distros
wsl --list --running
- terminate kali
wsl -t kali-linux
- set a distribution as the default wsl
wsl -s kali-linux
- if there are problems, cycle through this to clean up processes
kex --win -s --wtstart
# hit ctrl-c to kill the process
# then type N