I converted a vmdk image file to qcow2 with qemu-img (on a ubuntu 14.04 server)

sudo qemu-img convert -f vmdk -O qcow2 Odoo-disk1.vmdk odoo-disk1.qcow2

now, the resulting qcow2 image is more then twice as big as the original.

$ ls -lh
-rwxrwxrwx 1 root root 3.3G Nov 20 14:46 Odoo-disk1.vmdk
-rwxrwxrwx 1 root root 7.4G Nov 21 14:35 odoo-disk1.qcow2

Not really sure what to think of this but I would be much more relaxed whether the files where similar in size. Is there any way to achieve that? I am not very experience with this matter, so any explanation why that just 'is like that' would also be helpful

I set up the VM using this qcow 2 image and after started it virsh list --all shows the machine as 'running'.


My guess is the vmdk is sparse or compressed. Qcow2 supports sparse images too.

You could try tweaking the -s (sparse size) argument to see if it's the sparseness.

You could also try mounting and defragging the new qcow2 image and re-converting to try and put all the empty space back to back and filling it with zeros as recommended here, so the sparseness parameter isn't an issue, if it's a filesystem that supports that sort of thing.

Just a couple of options

  • see comment above about compression .... I don't actually mind that the file I get is that big (7.3 GB). I was more worried that something went wrong. Not sure whether you suggestions about the sparsing is a little 'over the top' for my purpose here. Thanks anyway. The hint with compression kind of answered it for me
    – vrms
    Nov 21 '15 at 10:56

It is possible that your vmdk was compressed or that you did not create a qcow2 file at all. If you convert normally with qemu-img convert some.vmdk some.qcow2, you would get a raw file.

To convert from a vmdk file to a compressed qcow2 file, try:

qemu-img convert -O qcow2 -c some.vmdk some.qcow2
  • 1
    I made a qcow2 (-O qcow2). but the idea with the compression was a good one. comparing both files with qemu-img -info shoes "compressed: true" for the vmdl file.
    – vrms
    Nov 21 '15 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.