How to Install Kali Linux Full with WSL2 on Windows Devices and Add a GUI Using Win-KeX

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.

Step 1: Enable WSL2 and Virtual Machine Platform

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.

Step 2: Install the Latest WSL2 Kernel Update

Download and install the latest WSL2 kernel update package from the Microsoft website.

Download link: WSL2 Kernel Update

Step 3: Set WSL2 as the Default Version

Set WSL2 as the default version by running the following command in PowerShell:

wsl --set-default-version 2

Step 4: Install Kali Linux from the Microsoft Store

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

Step 5: Set Up 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.

Step 6: Update and Upgrade Kali Linux

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

Step 7: Install Win-KeX

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

Step 8: Launch 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

Troubleshooting Tips

If you encounter issues, here are some common solutions:

Conclusion

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!