How to convert a qemu file to QCOW2 for export on a Proxmox host

Brief

If you have a Proxmox host and you want to export a VM, you have the option of converting to a QCOW2 file. This article is an outline of the procedure.

On the Proxmox Server

We created a temporary working directory called /root/vm.import

You also need the unique ID in Proxmox as you have to interrogate it’s disk setup.

cd /root/vm.import/
qm config 105

This will produce output of the disk configuration, which we’ll use in the next command. In the output look for scsi0:

scsi0: raid1:vm-105-disk-1,size=20G

Then

pvesm path raid1:vm-105-disk-1

Then

qemu-img convert -O qcow2 -f raw /dev/raid1/vm-105-disk-1 ./hostname.domain.com.qcow2

On your Workstation (in this case, Linux Mint)

Now grab that file using SCP. Note the extra ‘.’ at the end.

cd ~/Downloads
scp root@proxmox-server:/root/vm.import/hostname.domain.com.qcow2 .

See also

Reference

 

Share this article

Leave a Reply

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

Scroll to Top