-
First we need to have qemu installed on the system, for most of Linux systems, we can install “qemu-utils” for Windows we can download QEMU disk image utility from here
-
Other related questions
How to open raw disk from VMware
How to open qcow2 disk from VMware
How to open vdi disk from VMware
How to open raw disk from Hyper-V
How to open qcow2 disk from Hyper-V
How to open vdi disk from Hyper-V
How to open raw disk from VirtualBox
How to open qcow2 disk from VirtualBox
How to open vhdx disk from VirtualBox
How to open vmdk disk from VirtualBox
How to open vdi disk from kvm, Xen
How to open vmdk disk from kvm, Xen
How to open vhdx disk from kvm, Xen
How to open vmdk disk from kvm, Xen
- For all those questions, we can just convert the exiting virtual disk/disk image to the correct format by following the guide, then attach to the correct format to the software
Image format Argument for -f and -O options QCOW2 (KVM, Xen) qcow2 RAW raw VMDK (VMware) vmdk VHD (Hyper-V) vpc VHDX (Hyper-V) vhdx VDI (VirtualBox) vdi
- qemu-img command supported formats
qemu-img convert -f raw -O qcow2 /data/source.raw /data/output.qcow2 -p
–f: Source file format (Can be omitted, the command will recognize the format automatically)
-O: Output format
-p: Show the progress bar (Optional)
qemu-img convert -f raw -O qcow2 /data/source.img /data/output.qcow2 -p
qemu-img convert -O raw /data/source.qcow2 /data/output.raw
qemu-img convert -O raw /data/source.vmdk /data/output.raw
qemu-img convert -O raw /data/source.vpc /data/output.raw
qemu-img convert -O raw /data/source.vhdx /data/output.raw
qemu-img convert -O raw /data/source.vdi /data/output.raw
qemu-img convert -O qcow2 /data/source.raw /data/output.qcow2
qemu-img convert -O qcow2 /data/source.vmdk /data/output.qcow2
qemu-img convert -O qcow2 /data/source.vpc /data/output.qcow2
qemu-img convert -O qcow2 /data/source.vhdx /data/output.qcow2
qemu-img convert -O qcow2 /data/source.vdi /data/output.qcow2
qemu-img convert -O vmdk /data/source.qcow2 /data/output.vmdk
qemu-img convert -O vmdk /data/source.raw /data/output.vmdk
qemu-img convert -O vmdk /data/source.vpc /data/output.vmdk
qemu-img convert -O vmdk /data/source.vhdx /data/output.vmdk
qemu-img convert -O vmdk /data/source.vdi /data/output.vmdk
qemu-img convert -O vpc /data/source.qcow2 /data/output.vpc
qemu-img convert -O vpc /data/source.raw /data/output.vpc
qemu-img convert -O vpc /data/source.vmdk /data/output.vpc
qemu-img convert -O vpc /data/source.vhdx /data/output.vpc
qemu-img convert -O vpc /data/source.vdi /data/output.vpc
qemu-img convert -O vhdx /data/source.qcow2 /data/output.vhdx
qemu-img convert -O vhdx /data/source.raw /data/output.vhdx
qemu-img convert -O vhdx /data/source.vmdk /data/output.vhdx
qemu-img convert -O vhdx /data/source.vpc /data/output.vhdx
qemu-img convert -O vhdx /data/source.vdi /data/output.vhdx
qemu-img convert -O vdi /data/source.qcow2 /data/output.vdi
qemu-img convert -O vdi /data/source.raw /data/output.vdi
qemu-img convert -O vdi /data/source.vmdk /data/output.vdi
qemu-img convert -O vdi /data/source.vpc /data/output.vdi
qemu-img convert -O vdi /data/source.vhdx /data/output.vdi
- Bonus
qemu-img create -f raw -o size 10G /data/disk.raw
-f: Disk format
-o: Options, list of format specific options, name1=value1, name2=value2 etc. e.g. size=10G
qemu-img info source.qcow2
qemu-img check source.qcow2
qemu-img snapshot /data/source.qcow2 - /data/source.qcow2.snapshot
Note: raw format does not support snapshot, qcow2 does support snapshot
qemu-img snapshot /data/source.qcow2 -l
qemu-img snapshot -d /data/source.qcow2
qemu-img snapshot -d 2 /data/source.qcow2
qemu-img resize /data/disk +1G
Note: We can increase and decrease size on raw format, size of qcow2 format can only be increased
- Uninstall parallels tools from the machine and shut down the machine.
- Extract the
.hds
file to a working folder. The.hds
file is located in:
/Users/<user name>/Parallels/Windows 7.pvm/Windows 7-0.hdd/Windows 7-0.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds
- Issue this command to convert the parallels hard drive to raw image. Be careful the raw image size may be 5 times bigger than parallels hdd:
qemu-img convert -f parallels /Users/<user name>/Parallels/Windows 7.pvm/Windows 7-0.hdd/Windows 7-0.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds -O raw image.raw
- Convert the raw file to qcow2 image:
qemu-img convert -f raw -O qcow2 image.raw Windows7.qcow2
- Create a new UTM machine and select the
.qcow2
drive as a machine drive. Be careful when setting up the machine. Parallels creates a legacy Windows 7 installation so uncheck UEFI boot in the new UTM machine. - After booting install the qemu guest drivers. For Windows 7 I used this drivers version