DEV Community

Cover image for Deploy Kali Linux with GUI on the cloud
zuoshihua
zuoshihua

Posted on

Deploy Kali Linux with GUI on the cloud

Background

I recently helped organise a cyber security workshop for youngsters between 13 and 16. Some participants could not run virtual machines for various reasons.

Since the workshop required participants to have access to Kali Linux, I deployed Kali Linux with a Graphical User Interface (GUI) on Google Cloud Platform (GCP) for the participants. In this post, I'm going to show you how I did it.

P.S. Although I used GCP, these steps are applicable to other platforms e.g. DigitalOcean.

Hardware specs

Since Kali Linux will be running with a GUI, I recommend allocating slightly more hardware resources.

Hardware Specifications
Processor 2 cores
Memory 4 GB
Storage 40 GB

I recommend selecting Debian 10 as the operating system, since Kali Linux is built on top of Debian. Once it's running, connect via SSH.

Add the Kali Linux repository

First, update and upgrade.

$ sudo apt update && apt upgrade
Enter fullscreen mode Exit fullscreen mode

Add the "kali-rolling" repository to your sources.

$ echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" | sudo tee /etc/apt/sources.list
Enter fullscreen mode Exit fullscreen mode

Download the repository's key for the system to verify Kali Linux packages and add it with apt-key.

$ curl https://archive.kali.org/archive-key.asc | sudo apt-key add
Enter fullscreen mode Exit fullscreen mode

Update again. The new "kali-rolling" repository should be recognised.

$ sudo apt update
Enter fullscreen mode Exit fullscreen mode

Install all the things

The "kali-linux-default" package contains all the tools in a standard Kali Linux distribution.

$ sudo apt install kali-linux-default
Enter fullscreen mode Exit fullscreen mode

Once done, you need to install a desktop environment. The preferred desktop environment for Kali Linux is Xfce.

$ sudo apt install kali-desktop-xfce
Enter fullscreen mode Exit fullscreen mode

Finally, you need to install Xrdp. This will allow you to access and interact with the GUI via Remote Desktop Protocol (RDP).

$ sudo apt install xrdp
Enter fullscreen mode Exit fullscreen mode

⚠️ Note
Make sure you have set a password for your user account.

$ sudo passwd myuser # replace myuser with your account name

Enjoy!

If you're on Windows, use Remote Desktop Connection. If you're on Mac, download Microsoft Remote Desktop (available on the App Store).

cloud kali

Troubleshooting

It is normal to see a black screen initially. Wait for a few moments and the desktop should appear. If it is taking particularly long, consider changing the hosting region nearer to you.

If you encounter a "login failed for display 0", make sure you have set a password for your user account.

References

Top comments (2)

Collapse
 
igorganapolsky profile image
Igor Ganapolsky

Why do we need MS remote desktop for Kali Linux?

Collapse
 
likid77 profile image
Likid

Impressive! Thanks man, you're awesome!