ArticlesLinuxOpen Source SoftwareTutorials

How to convert VMware vmdk disks to QCOW2 (for Proxmox, QEMU KVM)

Since Broadcom acquired VMware a few months ago, the license costs of VMware's main product vSphere (ESXi) have more than doubled. Lots of companies (and private individuals) are looking to migrate to a different solution. And there are open source alternatives!

QEMU/KVM is a great alternative to VMware

Proxmox, for example, is a Hypervisor software which relies on pure Open Source Software technology. For containers (lightweight VMs), the LXC project is used, for real Virtual Machine virtualization (needed for Windows for example), the QEMU KVM project is used.

Proxmox is an excellent and cost-effective alternative to VMware virtualization.
Proxmox is an excellent and cost-effective alternative to VMware virtualization.

But QEMU/KVM can also be used standalone. Debian and Ubuntu (and derivatives) offer the Virtual Machine Manager (virt-manager) as a GUI tool to manage QEMU VMs.

QEMU/KVM Virtual Machine Manager on Linux Mint
QEMU/KVM Virtual Machine Manager on Linux Mint

How to convert virtual disks from vmdk to qcow2

QEMU based virtual machines often use the qcow2 virtual disk format. VMware's virtual machines use the vmdk (virtual machine disk) format. QEMU KVMs can't run a VM with a vmdk disk, but a vmdk can be converted into the qcow2 format.

The magic happens with the qemu-img command, which is installed through the qemu-utils package. In the following example the vmdk of the VMware VM "vm1" is converted from vmdk into the qcow2 format:

ck@mint /vms/vm1 $ qemu-img convert -p -f vmdk -O qcow2 vm1.vmdk /vms/vm1.qcow2
(100.00/100%)

To explain the parameters used:

  • -p => Shows the progress of the conversion
  • -f => Defines the source format (from), which is vmdk in this case
  • -O => Defined the target format (Output), which is qcow2 in this case

Comparing the sizes of the virtual disk does not show a negative impact either, both formats are more or less the same size:

ck@mint /vms/vm1 $ du -h vm1.vmdk
20G	vm1.vmdk

ck@mint /vms $ du -h vm1.qcow2 
20G	vm1.qcow2

The newly created qcow2 virtual disk can now be used for a new (or existing) QEMU KVM.

Claudio Kuenzler
Claudio has been writing way over 1000 articles on his own blog since 2008 already. He is fascinated by technology, especially Open Source Software. As a Senior Systems Engineer he has seen and solved a lot of problems - and writes about them.

You may also like

Comments are closed.

More in:Articles