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

最近由于要把 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          <uuid>|<filename> <outputfile>
                            [--format VDI|VMDK|VHD|RAW|<other>]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--type normal|writethrough|immutable]
                            [--remember] [--existing]</other></outputfile>
                                                     </filename></uuid>

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       <uuid>|<name> [--details] [--statistics]
 [--machinereadable]
VBoxManage showvminfo       <uuid>|<name> --log <idx>

......

实例操作(图)

命令:

"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 格式的转换也是同一个道理,只需改一下相关的参数即可。

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

最近由于要把 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          <uuid>|<filename> <outputfile>
                            [--format VDI|VMDK|VHD|RAW|<other>]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--type normal|writethrough|immutable]
                            [--remember] [--existing]</other></outputfile>
                                                     </filename></uuid>

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       <uuid>|<name> [--details] [--statistics]
 [--machinereadable]
VBoxManage showvminfo       <uuid>|<name> --log <idx>

......

实例操作(图) 命令:

"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 格式的转换也是同一个道理,只需改一下相关的参数即可。

用 VMware 打开 VirtualBox 创建的虚拟磁盘文件(Windows 中 vdi 转 vmdk )

详细的文字介绍请看这里:Convert VDI to VMDK & Open Sun VirtualBox Virtual Machine in VMware Player & Workstation

需要的软件 :QEMU manager 下载地址:http://www.davereyn.co.uk/download.htm

需要转换两次:vdi –> raw –> vmdk

注意:文件名不能有空格,raw 文件的大小取决于虚拟磁盘所定义的大小而不是 vdi 文件大小

vdi –> raw :

命令:

"E:\Program Files\VirtualBox\VBoxManage.exe" convertfromraw
E:\虚拟主机备份\xp.vdi E:\虚拟主机备份\xp.raw

结果:

raw –> vmdk

命令: 继续阅读

用 VMware 打开 VirtualBox 创建的虚拟磁盘文件(Windows 中 vdi 转 vmdk )

详细的文字介绍请看这里:Convert VDI to VMDK & Open Sun VirtualBox Virtual Machine in VMware Player & Workstation 需要的软件 :QEMU manager 下载地址:http://www.davereyn.co.uk/download.htm 需要转换两次:vdi –> raw –> vmdk 注意:文件名不能有空格,raw 文件的大小取决于虚拟磁盘所定义的大小而不是 vdi 文件大小 vdi –> raw : 命令:

"E:\Program Files\VirtualBox\VBoxManage.exe" convertfromraw
E:\虚拟主机备份\xp.vdi E:\虚拟主机备份\xp.raw

结果:

raw –> vmdk: 命令:

"C:\Program Files\QemuManager\qemu\qemu-img.exe" convert
"E:\虚拟主机备份\xp.raw" -O raw e:\虚拟主机备份\xp.vmdk

结果: 最后将 vmdk 文件加载到 VMware 虚拟系统中,即可使用 VirtualBox 创建的虚拟系统。