Saturday 14 May 2016

Importing OVA container into Proxmox (Step-by-Step)

10:32 Posted by Jurgens Krause , , , 9 comments
OVAs are an industry standard, and many appliances are distributed as such. Unfortunately Proxmox does not yet support OVA importing in an easy, user friendly way.

After downloading the OVA you will need to get it on to your server. My preferred way is by using WinSCP, if you are using Linux or OSX, you can use command line scp to do the transfer.

  1. Start up WinSCP and select "SCP" as the file protocol.
  2. Enter the Host name, User name and Password for your Proxmox server.
  3. Click yes
  4. At the security key warning, click "Yes"
  1. In the right hand pane, navigate to /tmp 
  2. Drag and drop the file you want to upload into the tmp folder
Depending on your network and the file size, this step may take a while.

Once the file has been uploaded, connect to the Proxmox server using Putty or your favourite ssh client.

Change into the /tmp directory:
cd /tmp

Extract the OVA file:
tar -xvf *.ova

This should output a couple of files from the OVA container, it should include an OVF file, which is the VM Defenition file, and a VMDK file, which is the actual hard disk image. Again, this may take a while.

Convert the vmdk to a Proxmox compatible qcow2 file:
qemu-img convert -f vmdk RADIUSdesk-2016-4-0-disk1.vmdk  -O qcow2 qcowdisk.qcow2

Run the following command, substituting the correct ovf filename, to get the vm settings:
cat RADIUSdesk-2016-4-0.ovf | grep -e "Memory RAMSize" -e "CPU count" -e "Netw" -e "Disk"

Using the settings from the above command, set up a new VM using the Proxmox web interface, you can make a tiny hard drive, since we will overwrite it.

Run the following command to overwrite the newly created disk image with the one we converted earlier. Remember to substitute the correct filenames:
mv qcowdisk.qcow2 /var/lib/vz/images/115/vm-115-disk-1.qcow2

You can now start the new VM with the imported disk image.

Lastly, remove all the files we created in temp by using "rm filename" for each file.

Job done!!