14

I have been asked to do some debugging work with gnome-continuous, but as this only comes in qcow2 format for qemu and I do not want to install qemu at this time so this may be slightly problematic, though I have read here that one may be able to use qemu-img to convert a qcow2 image to a Virtual Box compatible one. I have tried install qemu-img with:

sudo apt-get install qemu-img

But it appears as though there isn't a package under that name currently in the repositories, so how do I install it and use it to convert the image? I am running Ubuntu GNOME 15.10 with GNOME 3.18.

muru
  • 193,181
  • 53
  • 473
  • 722

1 Answers1

26

The package you want is qemu-utils:

% apt-file search qemu-img
qemu-utils: /usr/bin/qemu-img
qemu-utils: /usr/share/man/man1/qemu-img.1.gz

So install qemu-utils:

sudo apt-get install qemu-utils

To convert a QCOW2 image to a VirtualBox VDI image:

qemu-img convert -O vdi test.qcow2 test.vdi

Or to convert to a VMDK image:

qemu-img convert -O vmdk test.qcow2 test.vmdk

Or to convert to a VHD image:

qemu-img convert -O vpc test.qcow2 test.vhd
kos
  • 35,535
  • 13
  • 101
  • 151
  • Can one also convert the raw image to the `OVF` file type? –  Apr 05 '16 at 16:59
  • @ParanoidPanda First of all ... a good and interesting question, because most users are working with vbox and also correct and useful answer, so +1 for both ... a suggestion : why not install qemu and check it out ? The conversion (there always can go something wrong) would be obsolete and KVM outperforms vbox, for your convenience there is a great GUI available ... sudo apt-get install qemu qemu-kvm virt-manager ... just give it a try, you will love it ! :) – cl-netbox Apr 06 '16 at 07:29
  • qemu = no vt-x, so it seems to me vurtualbox is the only real option. – Gavin Simpson Sep 30 '21 at 11:09