Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Follow Contact

HF Rulez the UniverseHF Rulez the Universe
Doc
Pink LSZ Discord Bot v2 coming soon
Windows Windows 10 Win-Kex Kali Linux WSL

How to install Win-Kex (Kali Linux on Windows 10) with WSL

Posted 05-10-2021, 01:30 PM
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:
[Image: MOdm63s.gif]

Links to kali.org and Microsoft guides on Win-Kex and installing Windows Subsystem for Linux, in case anyone needs more information that I haven't included in my tutorial:
Kali.org WSL Documentation
Windows Subsystem for Linux Installation Guide for Windows 10


REQUIREMENTS:
Running Windows 10 version 2004 or higher
Windows Terminal: Get Windows Terminal




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:
Code
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:
    Code
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  2. Restart
  3. Open Powershell as administrator and run these commands:
    Code
    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: https://aka.ms/wsl2kernel
  6. Open Powershell as administrator (yet again) and enter the command:
    Code
    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:
    Code
    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)
  • Install win-kex using:
    Code
    kali@kali:~$ sudo apt update
    kali@kali:~$ sudo apt install -y kali-win-kex

[Image: 5SVnHGk.gif]

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 all the different commands and the syntax usage.




There are three different modes that Win-Kex supports:
  • Window Mode
    To start Win-Kex in Window mode with sound support, run:
    Code
    kex --win -s

  • Enhanced Session Mode
    To start Win-Kex in Enhanced Session Mode with sound support and arm workaround, run:
    Code
    kex --esm --ip -s

  • Seamless Mode
    To start Win-Kex in Seamless mode with sound support, run:
    Code
    kex --sl -s



Optional Steps:

If you'd like to, you can open up Windows Terminal, open up the settings for it, open up the settings JSON file, and add entries to it to start Win-Kex in your preferred mode.
[Image: V3wP1Wj.gif]

Some entries you can add to Windows Terminal:
  • Basic Win-KeX in window mode with sound:

    Code
    {
          "guid": "{55ca431a-3a87-5fb3-83cd-11ececc031d2}",
          "hidden": false,
          "name": "Win-KeX",
          "commandline": "wsl -d kali-linux kex --wtstart -s",
    },

  • Basic Win-KeX in seamless mode with sound:

    Code
    {
          "guid": "{55ca431a-3a87-5fb3-83cd-11ececc031d2}",
          "hidden": false,
          "name": "Win-KeX",
          "commandline": "wsl -d kali-linux kex --sl --wtstart -s",
    },

  • Basic Win-KeX in ESM mode with sound:

    Code
    {
          "guid": "{55ca431a-3a87-5fb3-83cd-11ecedc031d2}",
          "hidden": false,
          "name": "Win-KeX",
          "commandline": "wsl -d kali-linux kex --esm --wtstart -s",
    },



Anyway, that should be pretty much all you need to know to get Win-Kex installed and start checking it out.
Check out the links I provided earlier if you're having any issues or are wanting to do something not included in this tutorial, the kali.org documentation on Win-Kex in particular includes a lot of really helpful information.

Hope you found this guide helpful!