I like to use Windows Subsystem for Linux. It makes running Linux applications on Windows very easy and efficient. It runs natively, instead of emulated, and makes a workflow maintainable, including compiling Linux binaries for C and C++ applications using compilers such as GCC and Clang without needing to use simulator tools such as Cygwin and MinGW
I prefer the Ubuntu builds. It was the first Linux distribution to initially work with WSL.
With WSL 2.0 we have the ability to run graphical applications. We can use WSLg to run Windows containing individual applications within our regular interface.
However, Kali Linux’s distro has an alternative option, known as Kex. Kex allows us to have a full desktop workspace within the WSL environment with the XFCE desktop, as opposed to Ubuntu’s GNOME, which is not supported by Kex.
Since both Kali and Ubuntu are Debian-based distros, this means that the XFCE desktop and Kex can run functionally on either if installed correctly. My preference is to install Kex on Ubuntu.
These steps assume that WSL 2 is enabled and Ubuntu is installed from the Windows store and configured.
- Set up the Kali Keyring. This allows us to pull from Kali’s repository. The latest version can be installed in the Bash shell with this command:
- wget https://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2022.1_all.deb
- sudo dpkg -i kali-archive-keyring_2022.1_all.deb
- Add the Kali public archive key
- wget -q -O – https://archive.kali.org/archive-key.asc | sudo gpg –dearmor -o /usr/share/keyrings/kali-archive-keyring.gpg
- Ubuntu key for reference:
- sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 871920D1991BC93C
- Add the Kali repository to the /etc/apt/sources.list
- sudo nano /etc/apt/sources.list
- Add the following line to the bottom of the sources.
- deb http://http.kali.org/kali kali-rolling main non-free contrib
- Now run sudo apt update and sudo apt full -upgrade
- Now install Kex
- sudo apt install -y kali-win-kex desktop-base xfce4 xfce4-places-plugin xfce4-goodies
- Kex should launch correctly. There are small configuration changes to make
- In Windows Terminal, the configuration can be added
- wsl -d Ubuntu-22.04 kex –sl –wtstart -s
- For Ubuntu 22.04 on WSL. This would be the name of your distro on WSL. SL mode is integrated, vs Window mode.
- Set the new taskbar to autohide so it doesn’t cover the top of the screen in XFCE