Skip to content

Instantly share code, notes, and snippets.

@swarupmtb
Last active February 23, 2025 10:13
Show Gist options
  • Save swarupmtb/5918e2b8e71158933a03e3238dfd2354 to your computer and use it in GitHub Desktop.
Save swarupmtb/5918e2b8e71158933a03e3238dfd2354 to your computer and use it in GitHub Desktop.
Kali Linux on Windows 11

Step 1: Enable WSL and Virtual Machine Platform

  1. Open PowerShell as Administrator and run the following commands:
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  2. Restart your computer.

Step 2: Set WSL2 as the Default Version

  1. Open PowerShell as Administrator and run:
    wsl --set-default-version 2

Step 3: Install the Windows Terminal (Optional)

  1. Download Windows Terminal from the Microsoft Store for an enhanced terminal experience.

Step 4: Install Kali Linux

  1. Open the Microsoft Store, search for "Kali Linux," and install it.
  2. Alternatively, install via PowerShell:
    wsl --install -d kali-linux

Step 5: Initialize Kali Linux

  1. Once installed, launch Kali Linux from the Start Menu or Windows Terminal.
  2. Upon first launch, it will take some time to set up the file system.
  3. Set a username and password when prompted.

Step 6: Update and Upgrade Kali Linux

  1. Update the package manager and upgrade the distribution:
    sudo apt update && sudo apt upgrade -y

Step 7: Install Additional Tools (Optional)

To install additional penetration testing tools, use the kali-tools metapackages:

  1. For a full installation:
    sudo apt install kali-linux-large
  2. For specific tools:
    sudo apt install <tool-name>

Step 8: Verify WSL2 Configuration

  1. Check the WSL version:
    wsl --list --verbose
    Ensure kali-linux is set to version 2.

Additional Notes

  • To access graphical applications, you can install an X server like VcXsrv or use WSLg (Windows Subsystem for Linux GUI).
  • If you need to run services like Apache or SSH, start them manually in Kali:
    sudo service apache2 start
    sudo service ssh start

Enjoy using Kali Linux on Windows 11 with WSL2!

@swarupsro
Copy link

swarupsro commented Dec 31, 2024

For GUI Mode

sudo apt install kali-win-kex

Enable/Disable

kex --win
kex --stop

@swarupsro
Copy link

@swarupsro
Copy link

kali-tweaks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment