Virtualbox hypervisor and qcow2 virtual disks

It's possible to attach a qcow2 virtual disk in a guest virtual machine, but only if it's a compatibility format (level) minor then 1.1.

It's possible to check with the command:

qemu-img info vdisk.qcow2

Let's see the output:

image: vdisk.qcow2
file format: qcow2
virtual size: 50G (53687091200 bytes)
disk size: 47G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

If you want to use that file in a Virtualbox hypervisor it's necessary to convert qcow2 file in a previous compatibility level. You have to digit:

qemu-img convert -f qcow2 -O qcow2 -o compat=0.10 vdisk.qcow2 new_file.qcow2

At the end, check converted file:

# qemu-img info new_file.qcow2

Image: new_file.qcow2
file format: qcow2
virtual size: 50G (53687091200 bytes)
disk size: 47G
cluster_size: 65536
Format specific information:
    compat: 0.10
    refcount bits: 16