How to install Kali Linux using Windows Subsystem for Linux (WSL) on Server 2019. Enable WSL feature using PowerShell. Install Kali Linux using an Appx Package
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
# create folders mkdir C:\Install\KaliLinux cd C:\Install\KaliLinux # Download Kali Linux Appx Bundle Invoke-WebRequest -Uri "https://aka.ms/wsl-kali-linux" -OutFile "Kali.appx" -UseBasicParsing
# rename appx to zip and extract Rename-Item Kali.Appx Kali.zip Expand-Archive Kali.zip .\Temp # rename DistroLauncher to zip and extract Rename-Item .\Temp\DistroLauncher-Appx_1.1.4.0_x64.appx DistroLauncher.zip Expand-Archive .\Temp\DistroLauncher.zip C:\Install\KaliLinux\Live
The Live folder contains the extracted Kali linux executable
Start-Process -FilePath C:\Install\KaliLinux\Live\kali.exe
Kali Linux will start, you'll be asked to enter a username and password
Create a desktop shortcut "Kali WSL"
C:\Install\KaliLinux\Live\kali.exe
The first thing you will do with a new Linux machine is install updates. In this case, we get the following errors when running sudo apt update && sudo apt upgrade
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://kali.download/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository
W: Some index files failed to download. They have been ignored, or old ones used instead.
This error can be fixed by installing the Kali archive keys manually using the Debian .deb package file
cd ~ # download keyring wget http://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2022.1_all.deb # install keyring sudo dpkg -i kali-archive-keyring_2022.1_all.deb # remove file rm kali-archive-keyring_2022.1_all.deb
sudo apt update && sudo apt upgrade
If you're having problems running sudo with Kali running on WSL, take a look at this troubleshooting article..
SOLVED: sudo: account validation failure, is your account locked? sudo: 3 incorrect password attempts
Please give this article a rating (by clicking the stars) or leave a comment below!
Reference:
by Author
WSL - Windows Server Installation Guide
https://learn.microsoft.com/en-us/windows/wsl/install-on-server
Comments