How to convert qcow2 virtual disk to physical machine and reversely. Ask Question Asked 6 years, 11 months ago. Convert the disk to something useful. Cd /media/wherever-the-image-is/ sudo apt-get install qemu-kvm qemu-img convert test.qcow2 -O raw disk.img. Jun 13, 2016 With that being said, if you convert to qcow2 the file size of your image should automatically shrink to the real used space. So if you’re having a 100GB raw image and the real used disk space is about 5GB, the image (after the conversion to qcow2) should be 5GB instead of 100GB in total. Hope this helped. Converting between image formats. Run the following command to convert a vmdk image file to a qcow2 image file. $ qemu-img convert -f vmdk -O qcow2 image.vmdk image.qcow2 Note. The -f format flag is optional. If omitted, qemu-img will try to infer the image format.
Question: I have downloaded a virtual appliance packaged in OVA format. I want to convert the OVA image to QCOW2 format, so that I can run the virtual appliance on KVM hypervisor. How can I convert OVA image to QCOW2 format on Linux?
When virtual appliances are created and distributed, they are packaged in a special archive format. One such archive format is OVA (short for 'Open Virtualization Format'). This format is supported by VirtualBox, VMware, XenServer and several others. An OVA file (with .ova extension) is nothing more than a TAR archive which contains an OVF file, one or more disk image files, and optional manifest files for your certificate and checksums.
The XML-based OVF ('Open Virtualization Format') file specifies the properties of the packaged virtual appliance, such as hardware/networking configuration and disk image format. The disk image contains the content and structure of the disk storage used by the virtual appliance. OVF-supported disk image formats are VDI or VMDK.
If you want to run an OVA virtual appliance on KVM hypervisor, you need to convert the disk image contained in the OVA file into the format supported by KVM (e.g., QCOW2, RAW).
Here is how to convert OVA appliance to QCOW2 format on Linux environment.
The first step is to extract the disk image contained in the OVA file. The tar command will do it.
This will produce an OVF file, one or more disk images (VDI or VMDK), and other optional supplementary files.
Now you just need to convert the extracted disk image(s) to QCOW2 format. For this, you can use the qemu-img command line tool which is a versatile disk image creation/conversion tool.
To install qemu-img on Debian or Ubuntu:
$ sudo apt-get install qemu-utils
To install qemu-img on CentOS, Fedora or RHEL:
You can check a list of all disk image formats supported by qemu-img as follows.
$ qemu-img -h | tail -n1
As shown above, this tool does support both VDI and VMDK formats.
Convert Qcow2 Image To Iso
To convert VDI image to QCOW2 format:
$ qemu-img convert -O qcow2 input.vdi output.qcow2
To convert VMDK image to QCOW2 format:
$ qemu-img convert -O qcow2 input.vmdk output.qcow2
Download this article as ad-free PDF (made possible by your kind donation):
Convert Qcow2 To Iso Converter
Subscribe to Ask Xmodulo
Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.
Support Xmodulo
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Active4 years, 4 months ago
I have a KVM Server and I am using qcow2 as vm image format
I need to convert virtual machines into physical machines
Any helpfull idea?
Convert Img To Qcow2
user91632
2 Answers
It's not even that hard, it just takes some time, a Ubuntu LiveCD, and an external USB disk (if you don't have more than one internal disks).
Preliminary step: Convert the disk to something useful
You can do this from your current system without having to boot to a LiveCD.
Load a terminal and fire in:
Move /media/wherever-the-image-is/disk.img somewhere that you're not about to write to. If you're planning to write it to the disk that it's currently sitting on, you'll want to stick it on a separate internal disk, or, worst-comes-to-worst an external disk.
The following instructions assume you've moved it to /media/dave/disk.img (dave is an external USB disk)
Before you do any serious writing, make sure you have backups. CloneZilla can help you take whole disk backups if you have somewhere for that data to be stored.
Write the image to a disk of its very own
You'll want to do something like this. This assumes you're going to overwrite a whole disk.
Boot into an Ubuntu Live CD and click Try Ubuntu.
Mount your the place where your qcow2 image is being stored (eg the external USB disk as /media/dave). Do not mount the place where you want to write to.
Then we go to work:
You want to replace sdX with the correct path to your destination disk. The sudo password is blank, just hit return.
You can then open gparted or something else and you should see your Ubuntu partition sitting on the disk. You should be able to expand it out.
![Iso Iso](/uploads/1/2/6/3/126344988/447225742.png)
user61928
abkrimabkrim