vmdk、vhd 转 vdi(vmdk、vhd to vdi)、vdi 转 vmdk and vhd(vdi to vmdk and vhd)一步完成

文章转自:http://xmsigh.com/node/77

最近由于要把 vmdk 转成 vdi 格式(本来想继续用 VMware 的,但由于 VMware 的无缝模式没有 VirtualBox 好,且内存、CPU 占有太高,所以又换回了 VirtualBox。换来换去,换了好几次了,我是不折腾会死星人( ̄▽ ̄")),想上网找一下有没有比上一篇文章提到的更简单的方法。搜索了一下,除了上一篇写的要用到 qemu 软件进行两次转换外,还真让我找到了一个一步转换完成的方法。

原来新版的 VirtualBox 附带的 VBoxManage 已经可以实现转换虚拟磁盘格式的功能,不再需要借助 qemu 等第三方软件(將vmdk/vhd轉換為VDI格式)。

把 vmdk 转成 vdi 的命令是:

VBoxManage clonehd source.vmdk target.vdi --format VDI

--format

是指target的格式,source的格式似乎会自动判断

Your are no longer needed to use vditool, the tool "VBoxManage" comes with recent revision VirtualBox.

Just type the command:

VBoxManage clonehd source.vmdk target.vdi --format VDI
- format

refers to the target format, source format seems to be automatically determined.

VirtualBox Command Line Management Interface Version 3.1.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Usage:

VBoxManage clonehd |
[--format VDI|VMDK|VHD|RAW|]
[--variant Standard,Fixed,Split2G,Stream,ESX]
[--type normal|writethrough|immutable]
[--remember] [--existing]

VBoxManage 的其他参数可以通过在命令提示符中输入 VBoxManage 或 "E:\Program Files\VirtualBox\VBoxManage.exe"(VBoxManage.exe 文件路径) 来获取。

D:\Backup\我的文档\Virtual Machines\Ubuntu>"E:\Program Files\VirtualBox\VBoxManage.exe"

Oracle VM VirtualBox Command Line Management Interface Version 3.2.0

(C) 2005-2010 Oracle Corporation

All rights reserved.

Usage:

VBoxManage [-v|--version] print version number and exit

VBoxManage [-q|--nologo] ... suppress the logo

VBoxManage list [--long|-l] vms|runningvms|ostypes|hostdvds|hostfloppies|

bridgedifs|hostonlyifs|dhcpservers|hostinfo|

hostcpuids|hddbackends|hdds|dvds|floppies|

usbhost|usbfilters|systemproperties

VBoxManage showvminfo | [--details] [--statistics]

[--machinereadable]

VBoxManage showvminfo | --log

………………

实例操作(图)

命令:

"E:\Program Files\VirtualBox\VBoxManage.exe" clonehd "D:\Backup\我的文档\Virtual Machines\Ubuntu\Ubuntu.vmdk" "D:\Backup\我的文档\Virtual Machines\Ubuntu\Ubuntu.vdi" --format VDI

或 "E:\Program Files\VirtualBox\VBoxManage.exe" clonehd Ubuntu.vmdk Ubuntu.vdi --format VDI

好了,转换完了。

同理,把 vdi 转成 vmdk 的命令是:

VBoxManage clonehd source.vdi target.vmdk --format VMDK

vhd 格式的转换也是同一个道理,只需改一下相关的参数即可。

原文地址:https://www.cnblogs.com/micronm/p/vdh_vdi.html