1. 下載地址
https://cloudbase.it/qemu-img-windows/
2. 解壓縮 然后扔到 system32目錄下
或者是 修改環境變量--
我很懶,我決定扔到system32目錄下
3. 打開cmd 或者是powershell
最簡單的辦法 cd 到vhdx 存放路徑下面
執行命令
qemu-img.exe convert -f vhdx -O qcow2 Win2012r2WithUpdate.vhdx Win2012r2WithUpdate.qcow2
4. 這個貌似能實現 幾乎所有的磁盤格式的互轉.
很好用的小工具
官網上面的說明
Supported formats
| Image format | Argument for -f and -O options |
|---|---|
| VMDK (VMware) | vmdk |
| QCOW2 (KVM, Xen) | qcow2 |
| VHD (Hyper-V) | vpc |
| VHDX (Hyper-V) | vhdx |
| RAW | raw |
| VDI (VirtualBox) | vdi |
Usage examples
Convert a QCOW2, RAW, VMDK or VDI image to VHDX
|
1
|
qemu-img.exe convert source.img -O vhdx -o subformat=dynamic dest.vhdx
|
Convert a QCOW2, RAW, VMDK or VDI image to VHD
|
1
|
qemu-img.exe convert source.img -O vpc -o subformat=dynamic dest.vhd
|
Subformat can be either “dynamic” or “fixed” for VHD (vpc) or VHDX.
Note: use the fixed VHD subformat for Azure, the conversion will automatically take care of the required 1MB virtual size alignment.
Check a virtual disk for consistency
|
1
|
qemu-img.exe check source.qcow2
|
Get info about a virtual disk
|
1
|
qemu-img.exe info image.qcow2
|
Run qemu-img.exe -h or see the manual page for a complete list of all supported options.
