Proxmox Images
Whether it's metasploitable2, SIFT, or some other prepackaged image you're wanting to run from your Proxmox hypervisor, it's easy to get lost in the configuration process. Generally speaking through, you want to get your image into a qcow2 format and then moved onto the Proxmox host in a location where you keep your images. The default location is /var/lib/vz/images
. Here's a walkthrough of how to do it.
Converting to qcow2
The conversion process varies slightly depending on what you're given. If it's an .ova file, you'll need to first run:
tar -vxf filename.ova
qemu-img convert -f vmdk -O qcow2 ~/Downloads/sift-disk1.vmdk ~/sift.qcow2
Transferring to Proxmox Host
Now that you have the image in a format that works for Proxmox, you can transfer it over to the Proxmox host using whatever method works for you. I'll show the commands for scp using the standard password login through scp or using creds.
scp with password
scp ~/sift.qcow2 root@proxmox_ip:8006/var/lib/vz/images/
The command explained
scp
: we want to transfer a file to/from the machine we're on to/from another machine~/sift.qcow2
: this is the from location (in this case on our client computer)root@proxmox_ip:8006/var/lib/vz/images
: this is our to location (in this case, it's the proxmox IP address running on the native Proxmox port 8006 and going to theimages
directory) When you hit enter for this command, you'll be prompted for the Proxmox root password so long as you didn't change it to disallow password authentication.
scp with creds
scp -i id_rsa ~/sift.qcow2 root@proxmox_ip:8006/var/lib/vz/images/
The command explained
scp
: we want to transfer a file to/from the machine we're on to/from another machine-i id_rsa
: this assumes you have your computer's public ssh key in the authorized_keys file on the Proxmox host (this is a more secure way of logging in rather than using a password)~/sift.qcow2
: this is the from location (in this case on our client computer)root@proxmox_ip:8006/var/lib/vz/images
: this is our to location (in this case, it's the proxmox IP address running on the native Proxmox port 8006 and going to theimages
directory)
Creating Skeleton VM
From the Proxmox web interface, follow these steps to create a new VM skeleton:
- Log in to the Proxmox portal: Open your Proxmox web interface in a browser.
- Click on the "Create VM" button: This option is typically at the top-right of the interface.
- Enter the VM details:
- Skip the ISO Image step:
- Select the "Do not use any media" option since you will attach the disk image later.
-
Configure the VM hardware:
- System: Choose the firmware (BIOS or UEFI) appropriate for your image. If unsure, use the default.
- Hard Disk: Skip adding a hard disk here since you will import the disk image later.
- CPU: Allocate a reasonable number of cores (e.g., 2 cores for basic setups).
- Memory: Assign sufficient RAM based on your VM requirements (e.g., 4096 MB for SIFT).
- Network: Add a network device (e.g., VirtIO or E1000) as required.
- Finalize: Review your settings and click "Finish" to create the skeleton VM.
Importing, Attaching Image
From the Proxmox host's shell, you'll now need to associate the image with the VM you created.
qm importdisk 113 /var/lib/vz/images/sift.qcow2 local-lvm
Once this finishes successfully, you'll go back into the portal's view of the VM's settings. You'll notice in the Hardware tab there is now a hard disk that says Unused Disk 0 (or something similar). Double-click it, select the appropriate Bus/Device option and then click add.
How do I know which Bus/Device to select?
- Check the Documentation: Most prepackaged images specify their recommended Bus/Device type.
- Trial and Error: If documentation isn't clear, try adding the disk using a likely candidate (e.g., SCSI or VirtIO) and boot the VM. Adjust if the image fails to boot or the OS doesn't detect the disk.
- Inspect the OS: If you can mount the image or access the OS configuration, check what drivers are pre-installed (e.g., VirtIO drivers for Linux-based VMs).
Known:
- Metasploitable2: VirtIO
- SIFT Workstation: SCSI
- REMnux: SCSI
- Kali Linux: VirtIO
- Parrot Security OS: VirtIO
Setting the Boot Order
Ensure the VM knows to look for the hard disk when it boots:
- Go to the Options tab in the VM settings.
- Double-click Boot Order.
Start the VM
Fire up that puppy up.