How to convert disk images between formats?
VirtualBox does not support disk images with backing files, so they must be combined into a single file before setting up the virtual machine. To convert disk images, download and install QEMU, which should give you the tool qemu-img
(on Debian-derived distributions it is enough to apt install qemu-tools
).
To convert a disk image disk.qcow2
to VDI, navigate to the directory with the downloaded files and run
$ qemu-img convert -O vdi -p disk.qcow2 disk.vdi
to join the image with all required backing files into a single disk image in the VDI format. On Windows, you will probably have to use the full path to call qemu-img
:
> "C:\Program Files\qemu\qemu-img.exe" convert -O vdi -p disk.qcow2 disk.vdi
Resulting images can be used in VirtualBox as well as in GNS3 and other qemu-based programs.