Run Kali Linux on OpenStack: Step-by-Step

We all know Kali as a popular Linux distribution used by security professionals and ethical hackers. It’s not hard to spin up Kali instance on OpenStack cloud platform, it can be done in minutes. OpenStack is a powerful and open source cloud platform that provides infrastructure and tools you need to manage and deploy virtual machines with ease.

This article has been created to provide a step-by-step guide to running Kali on OpenStack. We provide the entire process from downloading cloud image, preparing OpenStack, to launching a Kali Linux instance.

1. Prerequisites

Here is what’s required before you can run Kali Linux on OpenStack.

  • A functional OpenStack environment.
  • Pre-configure OpenStack CLI
  • Relevant privileges to upload images to glance / create VM instances

Confirm your OpenStack CLI is functional by checking images in Glance.

$ openstack image list
+--------------------------------------+--------------------+--------+
| ID                                   | Name               | Status |
+--------------------------------------+--------------------+--------+
| 0c21dce0-d342-42f3-91a1-9644ccc4d7bb | AlmaLinux-9        | active |
| 460abcd1-f5d3-46fd-8f07-a50e76a1b78c | Arch-Linux         | active |
| 76f0ddfe-8800-42b5-9b2e-5e20fce37882 | CentOS-Stream-9    | active |
| 6a240236-06c1-4b84-bb8c-5ed52f00865d | RHEL-9             | active |
| 10d19cb7-4dca-42f4-a624-606bc06527fe | Rocky-Linux-9      | active |
| ff09d268-9858-42bf-ae6d-2f2af0b64593 | SLES15-SP5         | active |
| 35ee8729-26b7-4e93-b045-71b13c574c73 | Ubuntu-24.04       | active |
| 48f58997-7610-495c-9895-c2ca413161f0 | freebsd-14.0-ufs   | active |
| 5c395d7c-b8c4-4956-9616-5f835bfd37ef | openbsd-7.5        | active |
+--------------------------------------+--------------------+--------+

If you don’t get an error message it should be working.

2. Download Kali Cloud Image

The Kali Linux team provides pre-build cloud image for OpenStack in a .qcow2 extension. A cloud image contains the core tools required to get the job done while being lightweight.

Visit the Kali Linux official downloads page and pull the latest available OpenStack image. You will see AMD64 and ARM64 images. You can copy link and download using CLI tools such as wget and curl or download using Torrent client.

wget https://kali.download/cloud-images/kali-2024.2/kali-linux-2024.2-cloud-genericcloud-amd64.tar.xz

After downloading, extract .xz file.

tar -xJf  kali-linux-2024.2-cloud-genericcloud-amd64.tar.xz

The name of file is disk.raw let’s change it.

mv disk.raw Kali-Linux-disk.raw

3. Upload Kali Linux Image to OpenStack

Using OpenStack CLI:

openstack image create \
--file Kali-Linux-disk.raw \
--disk-format qcow2 \
--container-format bare \
--public \
Kali-Linux

As it begins upload an output is printed out.

+------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Field            | Value                                                                                                                                          |
+------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| container_format | bare                                                                                                                                           |
| created_at       | 2024-07-10T10:35:02Z                                                                                                                           |
| disk_format      | qcow2                                                                                                                                          |
| file             | /v2/images/3235e850-151a-4015-b60d-f1082d51c2ec/file                                                                                           |
| id               | 3235e850-151a-4015-b60d-f1082d51c2ec                                                                                                           |
| min_disk         | 0                                                                                                                                              |
| min_ram          | 0                                                                                                                                              |
| name             | Kali-Linux                                                                                                                                     |
| owner            | 3dfc8a0aec3d409696daa2c825b85a3f                                                                                                               |
| properties       | os_hidden='False', owner_specified.openstack.md5='', owner_specified.openstack.object='images/Kali-Linux', owner_specified.openstack.sha256='' |
| protected        | False                                                                                                                                          |
| schema           | /v2/schemas/image                                                                                                                              |
| status           | queued                                                                                                                                         |
| tags             |                                                                                                                                                |
| updated_at       | 2024-07-10T10:35:02Z                                                                                                                           |
| visibility       | public                                                                                                                                         |
+------------------+------------------------------------------------------------------------------------------------------------------------------------------------+

To confirm success in image upload list using the commands below.

openstack image list

Using Horizon Dashboard:

  1. Go to Project > Compute > Images.
  2. Click on Create Image.
  3. Input required details to upload an image:
    • Name: Kali Linux
    • Image Source: File
    • Format: QCOW2
    • Select the Kali Linux file you downloaded.

4. Launch Kali Linux Instance

With the image uploaded we can launch a VM instance on OpenStack from Kali Linux cloud image.

Launch Kali Linux using OpenStack CLI:

Run the commands below to launch instance a VM instance.

openstack server create --flavor <FLAVOR_NAME> \
--image "Kali-Linux" \
--network <NETWORK_NAME> \
--security-group <SECURITY_GROUP> \
--key-name <KEY_NAME> \
Kali-Linux-Instance

List values to use with the commands:

# Get Flavors in OpenStack
openstack flavor list

# Get Networks configured in OpenStack
openstack network list

# Get Security Groups defined in OpenStack
openstack security group list

# Get Keypairs uploaded to OpenStack
openstack keypair list

Launch instance using Horizon Dashboard

An alternative method to creating a Kali Linux instance on OpenStack is from web UI.

  1. Go to Project > Compute > Instances.
  2. Click on Launch Instance.
  3. Provide instance details:
    • Instance Name: e.g Kali-Linux
    • Flavor: Choose a flavor based suiting your usage needs
    • Source: Choose Kali Linux image uploaded.
  4. Configure additional instance settings like networks, security groups, and key pairs.
  5. Then finally Launch Instance.

5. Access the Kali Linux Instance

Once the instance is launched and running, run the following commands to obtain its IP address.

$ openstack server list
+--------------------------------------+-----------------------+--------+-----------------------+---------------+--------------------+
| ID                                   | Name                  | Status | Networks              | Image         | Flavor             |
+--------------------------------------+-----------------------+--------+-----------------------+---------------+--------------------+
| 6b8d4359-6bcd-4a72-8bb8-368eb5c7bd37 | kali                  | ACTIVE | public=192.168.20.229 | Kali-Linux    | linux-basic-vps    |
+--------------------------------------+-----------------------+--------+-----------------------+---------------+--------------------+

Use SSH to connect to the instance – the default username is kali.

ssh kali@ServerIP

If your SSH private key path is not default ~/.ssh/id_rsa, use -i to specify its location.

ssh -i <private_key_path> kali@<instance_ip_address>

You will be greeted with the following message.

Linux kali 6.8.11-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.8.11-1kali2 (2024-05-30) x86_64

The programs included with the Kali GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

┏━(Message from Kali developers)
┃
┃ This is a minimal installation of Kali Linux, you likely
┃ want to install supplementary tools. Learn how:
┃ ⇒ https://www.kali.org/docs/troubleshooting/common-minimum-setup/
┃
┃ This is a cloud installation of Kali Linux. Learn more about
┃ the specificities of the various cloud images:
┃ ⇒ https://www.kali.org/docs/troubleshooting/common-cloud-setup/
┃
┗━(Run: “touch ~/.hushlogin” to hide this message)
┌──(kali㉿kali)-[~]
└─$

Update package list and upgrade all installed packages.

sudo apt update && sudo apt upgrade -y

Conclusion

In this post we’ve provided steps that will help you run Kali Linux in an OpenStack Cloud environment. With this setup procedure, you can enjoy the flexibility of a Cloud Environment and cool security features of Kali Linux.

CloudSpinx Great 24/7 Support

We have Engineers available 24/7 with expertise in OpenStack, Virtualization, Linux Integrations, Automations, and other aspects of IT. Reach our to us anytime and we are more than ready to discuss your specific business needs and provide you with tailored solution / premium support.

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Let’s clarify the differences between merge requests (commonly called pull requests in GitHub), releases, release candidates (RCs), tags, and branches […]

Kind (which in full means “Kubernetes IN Docker”), is a command line tool that enables you to run Kubernetes clusters […]

Are you looking for an easy way to migrate packages from one cPanel server to a new cPanel server? In […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.