如何将ova转成QCOW2

第一步,解压缩ova,提取其中的vmdk

第二步, 从https://www.qemu.org/download/ 下载qemu工具。我下载的是windows版本。


第三步,安装之后,执行命令如下:


qemu-img.exe convert -O qcow2  your-vmdk-file  the-target-qcow2-file-name.qcow2

文件比较大的,需要慢慢等待。

转成qcow2之后,文件大小会翻倍。下面是转换前后的文件大小的比较。

 

ova转qcow2
主要步骤如下:

  • 解压OVA文件,获取*.vmdk文件;
  • 将*.vmdk文件转换为qcow2文件;



1.  解压ova文件

  • tar xvf  example.ova


解压出来一共三个文件,其中.vmdk文件就是我们需要的硬盘文件:


example.ovfexample-disk1.vmdk example.mf


2.  用命令将vmdk文件转化为qcow2文件

  • qemu-img convert -c -f vmdk -O qcow2 example-disk1.vmdk example.qcow2


指令说明:

-c:标识目标image必须是压缩的(qcow format only);-f:first image format-O:output_format

参考:

https://edoceo.com/notabene/ova-to-vmdk-to-qcow2

[size=1.5]The OVA file is nothing more than a TAR archive, containing the .OVF and .VMDK files. Easy!
[size=1.5]Using Evergreen ILS for example:

~ $ file Evergreen_trunk_Squeeze.ovaEvergreen_trunk_Squeeze.ova:                POSIX tar archive (GNU)

[size=1.5]I’ts possible to use the tar command to list the contents

~ $ tar -tf Evergreen_trunk_Squeeze.ova Evergreen_trunk_Squeeze.ovfEvergreen_trunk_Squeeze-disk1.vmdk

[size=1.5]Simply extract those things…

~ $ tar -xvf Evergreen_trunk_Squeeze.ovaEvergreen_trunk_Squeeze.ovfEvergreen_trunk_Squeeze-disk1.vmdk

[size=1.5]Now take a look at the created files The OVF XML file describes the image, it makes for some interesting reading about the expectations of the running environment.

~ $ file Evergreen_trunk_Squeeze*Evergreen_trunk_Squeeze-disk1.vmdk: VMware4 disk imageEvergreen_trunk_Squeeze.ova:        POSIX tar archive (GNU)Evergreen_trunk_Squeeze.ovf:        XML document text

[size=1.5]Recent versions of qemu are able to run directly from the VMDK file, buy why do that? Use QCOW2, it’s better. Execute: qemu-img -h and the last line of output shows the supported formats.

~ $ qemu-img -h |tail -n1Supported formats: raw cow qcow vdi vmdk cloop dmg bochs vpc vvfat qcow2 parallels nbd blkdebug sheepdog host_cdrom host_floppy host_device file

[size=1.5]Now actually convert it, this may take some time.

~ $ qemu-img convert -O qcow2 Evergreen_trunk_Squeeze-disk1.vmdk Evergreen_trunk_Squeeze.qcow2Contents of OVF Files

[size=1.5]The OVA is intended to run an Appliance and this OVF file describes the appliance. Examine the contents of this file to determine information about the expected CPU, Memory and other appliance details. These will be important to getting the image to run under KVM. Noteably, Windows has a terrible time moving, ensure you have the MergeIDE fix in place.
下载说明:
1.本站资源都是白菜价出售,同样的东西,我们不卖几百,也不卖几十,甚至才卖几块钱,一个永久会员能下载全站100%源码了,所以单独购买也好,会员也好均不提供相关技术服务。
2.如果源码下载地址失效请联系站长QQ进行补发。
3.本站所有资源仅用于学习及研究使用,请必须在24小时内删除所下载资源,切勿用于商业用途,否则由此引发的法律纠纷及连带责任本站和发布者概不承担。资源除标明原创外均来自网络整理,版权归原作者或本站特约原创作者所有,如侵犯到您权益请联系本站删除!
4.本站站内提供的所有可下载资源(软件等等)本站保证未做任何负面改动(不包含修复bug和完善功能等正面优化或二次开发);但本网站不能保证资源的准确性、安全性和完整性,用户下载后自行斟酌,我们以交流学习为目的,并不是所有的源码都100%无错或无bug;同时本站用户必须明白,【安安资源网】对提供下载的软件等不拥有任何权利(本站原创和特约原创作者除外),其版权归该资源的合法拥有者所有。
5.请您认真阅读上述内容,购买即以为着您同意上述内容,由于源码具有复制性,一经售出,概不退换。
安安资源网 » 如何将ova转成QCOW2