Kali on Windows: Adding the Desktop

In my last article (Kali on Windows) I showed you how to install the Windows Subsystem for Linux (WSL) on your Windows client, and then install an instance of Kali Linux in it so that you could have the functionality of Kali without the separation of a hypervisor… or worse, needing a second computer.

The problem with that installation was that at the end of the installation process it informs us that we have now installed ‘…a minimal installation of Kali Linux.’ Okay, so you enticed us with the allure of Kali, but when we arrived at our destination we are not quite receiving what we were expecting, right? I mean… there isn’t even a desktop!

In this article I am going to show you how to install that desktop… and the entire suite of tools on top of it. Let’s go!

*** NOTE *** You might find that your Linux instance has a strange IP addressing scheme from your environment. Before you proceed with any of this, make sure you can ping the Internet. try ping www.garvis.ca. If it does not work then you need to run the following commands before you proceed:

sudo rm /etc/resolv.conf

sudo nano /etc/resolv.conf

(This will create a new configuration file. enter the following text, then save the file)

[network]

generateResolvConf = false

nameserver 8.8.8.8

Try to ping the Internet again, and it should work.

Step 1: Install xRDP

There are two steps required to be able to use the Windows RDP (Remote Desktop Protocol) to access our Kali WSL environment. First we need to install an RDP program! To do so, perform the following steps from within your Kali Linux console:

sudo apt update && sudo apt –y upgrade

sudo apt install kali-desktop-xfce

sudo apt-get install xrdp

sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak

sudo sed -i ‘s/3389/3390/g’ /etc/xrdp/xrdp.ini

sudo sed -i ‘s/max_bpp=32/#max_bpp=32\nmax_bpp=128/g’ /etc/xrdp/xrdp.ini

sudo sed -i ‘s/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g’ /etc/xrdp/xrdp.ini

sudo /etc/init.d/xrdp restart

*** NOTE *** We are changing the default RDP from tcp/3389 to tcp/3390 on the chance that your local computer is already an RDP system. You can change the 3390 to whatever non-standard port you like… as long as you remember it.

You will notice that some of these will take some time… and you might need to press Y to continue Winking smile

(For those of you unfamiliar with the command, sed changes text within a file. If you prefer, you could simply edit the file using nano or vi.)

Step 2: Install the Kali GUI (Win-KeX)

Yes, it is nice to have the command line tools, but I know a lot of Windows enthusiasts will feel more comfortable in the GUI… even a Linux GUI. Win-KeX will give us that ability. We might be accused of putting the cart before the horse! We installed and configured xRDP for the remote desktop environment, but it will not work until we install the actual desktop. This one is pretty simple:

  • sudo apt update
  • sudo apt install –y kali-win-kex

Step 4: Connecting to xRDP

  1. From within your Windows client launch the Remote Desktop Connection (mstsc.exe).
  2. In the Computer box type localhost:3390 and click Connect.
  3. A warning will pop up that says The identity of the remote computer cannot be verified. Do you want to connect anyway? Click the checkbox (Don’t ask me again for connections to this computer) and click Yes.
image7_thumb

Log in with the username and password that you provided and voila! you should now see this screen in a Remote Desktop window:

image_thumb1

Bonus: Three more ways to connect!

There are three ways that you can connect to your Kali instance without the RDP console. They are:

Windows Mode

This will give you sound support:

  • From within the Kali WSL console: kex –win 0s
  • From the Windows command prompt: wsl -d kali-linux kex --win –s

Enhanced Session Mode

This will give sound support and ARM workaround:

  • From within the Kali WSL console: kex --esm --ip -s
  • From the Windows command prompt: wsl -d kali-linux kex --esm --ip –s

Seamless Mode

This will launch a Kali Linux panel on your Windows desktop, so your Kali applications will share the desktop with your Windows apps.

  • From within the Kali WSL console: kex --sl -s
  • From the Windows command prompt: wsl -d kali-linux kex --sl –s

Conclusion

We are actually not done yet… but this article is. In my next article I will show you how to install the full suite of Kali Linux tools to your Kali WSL environment. See you tomorrow!

 

Leave a comment