Create a Kali Linux VM in Proxmox

In this module, we will look at the process of creating a Kali Linux VM using the command line in Proxmox
Create a Kali Linux VM in Proxmox
In: Proxmox, Attack, Home Lab
ℹ️
This page is part of the larger series of converting an old laptop into a bare metal home lab server. Click here to be taken back to the project home page.

Previous Step

Adding a Comprehensive Wazuh SIEM and Network Intrusion Detection System (NIDS) to the Proxmox Lab
In this module, we will take a look at the process setting up a comprehensive Wazuh SIEM, including a NIDS and some HIDS agents, in our Proxmox home lab.





Building Kali in the Shell

The point of this exercise is to use a pre-built Kali Linux VM from Offensive Security and demonstrate to you how you can:

  • Download a packaged VM using the command line
  • Extract a .QCOW2 virtual disk file
  • Create a VM on the command line
  • Import and attach the .QCOW2 disk to the VM
  • Set the disk as the primary boot method

Go to https://www.kali.org/get-kali/#kali-virtual-machines. Under QEMU, right-click the download icon:

Right-click and choose "Copy link address"

Choose copy link address. Right-click on your Proxmox node and choose shell.

Run some commands to create a Kali VM and import the disk file and use OffSec’s prebuilt Kali VM images in Proxmox

# This is a comment. You do not need to type this in your shell.
# Install the unar package -- a universal archive decompression tool
apt clean && apt update
apt install -y unar

# Initialize a variable to hold the URL copied in step 1
# Ensure the URL you're copying points to the .7z file
url="https://cdimage.kali.org/kali-2022.4/kali-linux-2022.4-qemu-amd64.7z"

# Get the filename from the URL for use later in the process
filename=$(echo $url | rev | awk -v FS='/' '{print $1}' | rev)

# Change to the /tmp directory
cd /tmp

# Make a directory for easy cleanup and move into it
mkdir kali-download && cd kali-download

# Download the VM image (may take a while)
wget $url

# Extract the contents of the .7z file
# This is a big file, be patient
unar $filename

# Initialize a variable containing the name of the QCOW2 disk file
qcow2file=$(find $PWD -name '*.qcow2')

# Create a VM placeholder for Kali.
qm create 106 --memory 8192 --balloon 4096 --cores 2 --name Kali --description 'Kali Linux from prebuilt images' --net0 model=virtio,bridge=vmbr1 --ostype l26 --autostart 1 --startup order=10,up=30,down=30

# Attach the disk .QCOW2 disk to the Kali VM. Wait for command to finish
# local-lvm is the default VM disk storage in my setup, yours may be different
qm importdisk 106 $qcow2file local-lvm --format qcow2

# Attach the disk
qm set 106 --scsi0 local-lvm:vm-106-disk-0

# Set the disk as the primary boot
qm set 106 --boot=order=scsi0

# Clean up
cd /tmp
rm -rf ./kali-download

You should now be able to log into the Proxmox web console and start the VM.





Next Step

Create an OWASP Juice Shop Container in Proxmox
In this module, we will look at creating a container in our Proxmox home lab to run OWASP Juice Shop to practice our web app pentest skills
More from 0xBEN
Table of Contents
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to 0xBEN.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.