Kali Linux on Windows in 5min (WSL 2 GUI)

3 min read 7 months ago
Published on Aug 06, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial will guide you through installing Kali Linux on Windows 10 using the Windows Subsystem for Linux (WSL) 2. This setup allows you to run a full Linux kernel on Windows, complete with a graphical user interface (GUI). You'll get Kali Linux up and running in under five minutes, allowing you to explore its powerful tools for penetration testing and security auditing.

Step 1: Verify Windows Version

Before installing WSL 2, ensure your Windows 10 version is compatible.

  • Press the Windows key.
  • Type winver and hit Enter.
  • Check that your version is 2004 or higher.

If your version is outdated, update your Windows:

  • Open the Start menu.
  • Type update and hit Enter.
  • Click on "Check for updates" and install any available updates.

Step 2: Install WSL 2

You’ll need to enable WSL and the Virtual Machine Platform using PowerShell.

  1. Open PowerShell as an administrator:
    • Type PowerShell in the Start menu.
    • Right-click and select "Run as administrator."
  2. Run the following commands one by one:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    
    • Restart your computer when prompted.
  3. After restarting, reopen PowerShell as an administrator and enter:
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    
  4. Run this command next:
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    
  5. Restart your computer again.

Step 3: Download the WSL 2 Kernel Update

  1. Open your web browser and navigate to the kernel update link: Download WSL 2 Kernel.
  2. Download and run the installer, following the prompts to complete the installation.

Step 4: Set WSL 2 as Default

  1. Open PowerShell as an administrator.
  2. Set WSL 2 as the default version with this command:
    wsl --set-default-version 2
    

Step 5: Install Kali Linux

  1. Open the Microsoft Store from the Start menu.
  2. Search for "Kali Linux" and click on it.
  3. Click "Install" to download and install Kali Linux.

Step 6: Launch Kali Linux

  1. Once installed, find Kali Linux in the Start menu.
  2. Launch the application and set up a username and password when prompted.

Step 7: Install GUI for Kali Linux

To enable a graphical user interface, follow these steps:

  1. Update and upgrade your Kali installation:
    sudo apt update && sudo apt upgrade -y
    
  2. Install the XFCE desktop environment:
    sudo apt install kali-desktop-xfce -y
    
  3. Install XRDP, which allows remote desktop connections:
    sudo apt install xrdp -y
    
  4. Start the XRDP service:
    sudo service xrdp start
    

Step 8: Connect to GUI

  1. Find your Kali IP address:
    ip address
    
  2. Open the Remote Desktop Connection application from the Start menu.
  3. Enter the IP address you found and click "Connect."
  4. Log in with the username and password you set up earlier.

Conclusion

Congratulations! You have successfully installed Kali Linux on your Windows 10 machine using WSL 2, complete with a functional GUI. You can now explore the various tools available in Kali for network security and penetration testing. For further exploration, consider installing additional tools or following tutorials specific to Kali Linux applications.