微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

vbox虚拟机vdi文件用VMware打开

转自:https://blog.51cto.com/dahui09/1863486

方法一:

使用VirtualBox 自带的VBoxManage来进行格式转换:

1、安装VBoxManage

2、使用VBoxManage格式转换指令转为Vmware能识别的(vmdk)格式

 

方法二:

vdi转成VM虚拟机文件vmdk文件生成vm虚拟机配置文件

1、vBox导出ova虚拟机文件

2、用VM虚拟机打开ova文件

方法三:

我们将使用qemu-img工具。QEMU磁盘镜像工具(这个要在能开机的情况下开始,安装qemu-kvm可能导致virtualBox无法启动)

1、安装qemu-kvm 软件

2、修改已经建好的虚拟机,更改格式

 ========================================================================

 

方法一:

1.VBoxManage.exe在VirtualBox 安装目录下,如下图,我们进VirtualBox 安装目录查看到VBoxManage.exe

 

2.命令行进入VirtualBox目录,运行相关VBoxManage格式转换指令,语法如下:

VBoxManage clonehd源硬盘格式文件 目录硬盘格式文件 --format目标格式后缀
 
VBoxManageclonehd <uuid>|<filename> <outputfile> [--format VDI|VMDK|VHD|RAW|<other>] [--variant Standard,Fixed,Split2G,Stream,ESX] [--existing]
 

 

3.将VDI文件转成VHD文件,如下图命令将vdi的虚拟机文件转换成微软vhd虚拟机文件

 


wKiom1gQWFXSTwU_AAEw7vTDHqw087.png

执行进度至100%结束完成转换,随后我们用微软虚拟机软件挂载顺利运行

至此,利用VBoxManage对三种常见虚拟硬盘格式转换介绍结束,vmdk、vhd转VDI等按格式套用即可。

 

 

 

方法二:

xp.vdi转成VM虚拟机文件vmdk文件生成vm虚拟机的配置文件vmx文件

1. virtal Box 导入vdi文件

文件转换步骤

wKiom1gQWiXz65hEAAJRRV7oeDQ376.jpg

 

2.导出ova虚拟机文件

(1). ovf文件选择1.0格式。

(2). 2.0格式,第三步通不过。

wKiom1gQWiqQnuEUAAFJ7Yi6jOA083.jpg


wKioL1gQWifDUktgAAHg0k9LtQk097.jpg

 

wKioL1gQWiaDSVeeAAGh0LWQADk075.jpg

 

(3). 用vmworkstaion打开ova文件

 

wKiom1gQWiaRHODfAAJFvBRZaAg113.jpg

wKiom1gQWiigM_JtAAEqiQ7HeTE932.jpg


wKioL1gQWiaxwvHhAAD6JBfgXng457.jpg

wKiom1gQWiaQxdTrAABJsC1Jrek377.jpg


wKioL1gQWimQpZs-AAKvsO69ENE611.jpg

(4).打开step_2.vmx

wKiom1gQWiuQ171qAAKIF59xABE398.jpg

 

方法三:

在Ubuntu下可以很方便的安装

[email protected]:~#

sudo apt-get install qemu-kvm

使用如下一个命令就可以轻松完成转换。

[email protected]:~#

qemu-img convert  -f vdi -O vmdk Winxp.vdi Winxp.vmdk

直接修改已经建好的虚拟机,(Ubuntu系统在~/vmware/)

 

例如我建立的虚拟机叫Win,则修改~/vmware/Win/Win.vmx,找到 ide0:0.fileName = "Win.vmdk"

 

把其中的Win.vmdk修改成你转换生成文件名即可。

[注]:

1,Winxp.vdi要根据VitrualBox虚拟机的名称修改,在目录~/.VirtualBox/Harddisks下可以找到。

2,.vmx 是VMware虚拟机的配置文件,是一个文本文件可以直接修改,也可以在程序中更改,删除原来的硬盘,再添加转换后的硬盘。

======================

[email protected]:~$ qemu-img

qemu-img version 0.12.3,copyright (c) 2004-2008 Fabrice Bellard

usage: qemu-img command [command options]

QEMU disk p_w_picpath utility

Command Syntax:

check [-f fmt] filename

create [-f fmt] [-o options] filename [size]

commit [-f fmt] filename

convert [-c] [-f fmt] [-O output_fmt] [-o options] filename [filename2[...]] output_filename

info [-f fmt] filename

snapshot [-l | -a snapshot | -c snapshot | -d snapshot] filename

Command parameters:

‘filename‘ is a disk p_w_picpath filename

‘fmt‘ is the disk p_w_picpath format. It is guessed automatically in most cases

‘size‘ is the disk p_w_picpath size in bytes. Optional suffixes

‘k‘ or ‘K‘ (kilobyte,1024),‘M‘ (megabyte,1024k),‘G‘ (gigabyte,1024M)

and T (terabyte,1024G) are supported. ‘b‘ is ignored.

‘output_filename‘ is the destination disk p_w_picpath filename

‘output_fmt‘ is the destination format

‘options‘ is a comma separated list of format specific options in a

name=value format. Use -o ? for an overview of the options supported bythe

used format

‘-c‘ indicates that target p_w_picpath must be compressed (qcow format only)

‘-h‘ with or without a command shows this help and lists the supportedformats

Parameters to snapshot subcommand:

‘snapshot‘ is the name of the snapshot to create,apply or delete

‘-a‘ applies a snapshot (revert disk to saved state)

‘-c‘ creates a snapshot

‘-d‘ deletes a snapshot

‘-l‘ lists all snapshots in the given p_w_picpath

Supported formats: cow qcow vdi vmdk cloop dmg bochs vpc vvfat qcow2parallels nbd host_cdrom host_floppy host_device raw tftp ftps ftp https http

======================

参考:

Howto ConvertVmware Image to Virtualbox Image or Import Vmware Image into Virtualbox

======================================
警告:

安装qemu-kvm可能导致virtualBox无法启动,在我的机器上出现了如下提示

Failed to open a session for the virtual machine WinXP.

VirtualBox can‘t operate in VMX root mode. Please disable the KVM kernelextension,recompile your kernel and reboot (VERR_VMX_IN_VMX_ROOT_MODE).

Details:

Result Code:

NS_ERROR_FAILURE (0x80004005)

Component:

Console

Interface:

IConsole {6375231a-c17c-464b-92cb-ae9e128d71c3}

 

可能导致

的原因是系统环境比较复杂:安装在USB硬盘上,经常在T60p和Dell的740上工作,他们的 cpu一个是Intel、另外一个是AMD,在网上找到一个解决方案。

[email protected]:~$

sudo modprobe -r kvm_intel

#因为我当前的cpu是Intel,你也可以直接使用sudo modprobe -r kvm来删除kvm模块,无论你使用什么样的cpu

然后打开VirtualBox就可以了,但是你需要在每次重启开机后执行这个命令,如果你需要启动VBox的话。

参照:

VirtualBox can‘t operate in VMX rootmode.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐