安装该命令
ubuntu
apt install -y qemu-utils
使用语法
qemu-img convert -f <原格式> -O <目标格式> <原文件路径> <目标文件路径> 这里 -f <原格式>可以忽略。qemu-img会自动识别
vmdk与qcow2互转
qemu-img convert -O qcow2 test.vmdk test.qcow2 #qcow2转vmdk qemu-img convert -O vmdk test.qcow2 test.vmdk
vdi转qcow2
qemu-img convert -O qcow2 test.vdi test.qcow2
vhd&vhdx转qcow2
qemu-img convert -O qcow2 test.vhdx test.qcow2
RAW转qcow2
qemu-img convert -O qcow2 test.raw test.qcow2
img转qcow2
qemu-img convert -O qcow2 test.img test.qcow2
示例
curl -o iKuai8_x32_3.6.2 https://www.ikuai8.com/download.php?n=/3.x/img/iKuai8_x32_3.6.2_Build202203291450.img.gz
gzip -d
qemu-img convert -O qcow2 ikuai.img system.qcow2
qemu-img resize system.qcow2 +2G