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

a year ago   •   3 min read

By 0xBEN
Table of contents

This page is part of the larger series of converting an old laptop into a bare metal home lab server. Click the link to be taken back to the original post.

Proxmox VE 7: Converting a Laptop into a Bare Metal Server
In this post, we will take a look at an in-detail process of setting up a Proxmox home lab on a bare metal server.





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

Building Kali in the Shell

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:106/vm-106-disk-0.qcow2

# 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

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

Spread the word

Keep reading