This tutorial will guide you through the process of installing Kali Linux with WSL2 on your Windows device, and setting up a graphical user interface (GUI) using Win-KeX. This setup provides a full Kali Linux experience with a complete desktop environment, right on your Windows machine.
First, you need to enable the Windows Subsystem for Linux (WSL) and the Virtual Machine Platform on your Windows device.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
After enabling these features, restart your computer to apply the changes.
Download and install the latest WSL2 kernel update package from the Microsoft website.
Download link: WSL2 Kernel Update
Set WSL2 as the default version by running the following command in PowerShell:
wsl --set-default-version 2
Open the Microsoft Store, search for "Kali Linux", and click "Get" to install it.
Alternatively, you can install it using PowerShell:
wsl --install -d kali-linux
Launch Kali Linux from the Start menu. The first time you run it, it will set up the file system and ask you to create a new user. Follow the prompts to complete the setup.
Once Kali Linux is set up, update and upgrade the system to ensure you have the latest packages:
sudo apt update && sudo apt upgrade -y
Win-KeX is a tool that provides a GUI for Kali Linux running under WSL2. Install Win-KeX using the following command:
sudo apt install -y kali-win-kex
After installing Win-KeX, you can launch it in Window mode or Enhanced Session mode:
Window Mode: Launches the GUI in a separate window.
kex --win -s
Enhanced Session Mode: Provides a full-screen desktop experience.
kex --esm
If you encounter issues, here are some common solutions:
By following these steps, you will have a full Kali Linux environment with a GUI on your Windows device, providing a seamless and powerful tool for penetration testing and security research. Enjoy your new setup and the vast capabilities it offers.
Start exploring and make the most out of your Kali Linux experience on Windows!