Set up Kali Linux GUI using WSL
Step-by-step guide to installing and configuring Kali Linux GUI on Windows Subsystem for Linux (WSL) for penetration testing and security research.

Overview
Windows Subsystem for Linux (WSL) lets you run Linux natively on Windows 10 and 11. Running Kali Linux GUI through WSL gives you access to penetration testing tools and a full desktop environment without dual-booting or heavyweight virtual machines.
Prerequisites
- Windows 10 version 2004+ (Build 19041+) or Windows 11
- Administrator privileges
- At least 20GB free disk space
- Virtualization enabled in BIOS/UEFI
Step 1: Enable WSL & Install Kali Linux
Open PowerShell as Administrator and run:
wsl --install -d kali-linuxRestart your PC when prompted to finalize WSL2 installation.
Step 2: Initial Configuration
Launch Kali Linux from Start Menu, create UNIX user/password, and update packages:
sudo apt update && sudo apt upgrade -yStep 3: Install Desktop Environment (Xfce)
Install the lightweight Xfce desktop:
sudo apt install -y kali-desktop-xfceStep 4: Configure WSLg
Verify DISPLAY variable is active:
echo $DISPLAYIf blank, run wsl --update in PowerShell as Admin.
Step 5: Start Kali Desktop
Launch Xfce directly with:
startxfce4Alternatively, use Win-KeX:
sudo apt install -y kali-win-kex
kex --win -sStep 6: Install Security Tools
Install tool packages as needed:
# Standard metapackage
sudo apt install -y kali-linux-large
# Specific tool categories
sudo apt install -y kali-tools-web kali-tools-wireless kali-tools-forensicsTroubleshooting
- WSL kernel update needed: Run wsl --update in elevated PowerShell.
- Blank GUI window: Run wsl --shutdown and re-launch.
- Virtualization disabled: Enable Intel VT-x / AMD-V in motherboard BIOS.
Related Articles
Subscribe to the Newsletter
Get real-world IT troubleshooting guides, Azure VDI case studies, and sysadmin automation tips in your inbox.