Installing Win-Kex (Kali Linux on Windows 10) with WSL

I have been wanting to do a little tutorial on something for a while now and I thought a tutorial on how to setup Win-Kex (aka Kali Linux on Windows 10 with a graphical user interface) could be one that some members might find interesting.

You’ll find using Win-Kex useful if, for a simple example, you’d like to natively run Kali Linux on top of Windows 10 without having to use Virtualbox.

I enjoyed using WSL in general when I was doing programming with Python and not wanting to deal with Windows 10 (python is a pain to program with on Windows 10 compared to programming with it on Linux).

If you’re still a bit confused as to what Win-Kex is, this short screen recording I took might help:

Links to and Microsoft guide on Win-Kex and installing Windows Subsystem for Linux, in case anyone needs more information that I haven’t included in my tutorial: WSL | Kali Linux Documentation

Let’s start

The first thing you’ll need is to install WSL 2.

One way you can install WSL, is by using the Simplified Installation for Windows Insiders. If you’ve joined the Windows Insider Program, all you have to do is enter the command:

wsl --install

Yep, it’s apparently that easy if you are in the Windows Insider Program.

If you haven’t joined the Windows Insider Program, like I haven’t, then no problem, just a few more steps you’ll have to take.

  1. Open Windows Powershell as an administrator and run this command:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  2. Restart

  3. Open Powershell as administrator and run these commands:

    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  4. Restart

  5. Download and install the WSL 2 Linux Kernel:

  6. Open Powershell as administrator (yet again) and enter the command:

    wsl --set-default-version 2
  7. Install Kali Linux from the Microsoft Store (or from this link: Get Kali Linux)

    –To upgrade an existing WSL 1 Kali Linux installation, run:

    wsl --set-version kali-linux 2
  8. Run Kali and finish the initial setup

Now, you need to install Win-Kex (open up Kali Linux in Windows Terminal to do this, don’t enter the following commands in Powershell):

After installing Win-Kex, you can use the kex command to start up Win-Kex, end Win-Kex sessions, and numerous other things.

If you’re wondering what those other things are, just type kex --help and you’ll get a list of all the different commands and the syntax usage.

Anyway, that should be pretty much all you need to know to get Win-Kex installed and start checking it out.

Hope you found this guide helpful!