VirtrualBox使用已存在的镜像创建虚拟机
再将一个已经存在的虚拟机镜像拷贝为另一个新的虚拟机镜像后,要将该新的镜像添加到新的虚拟机中时会出现错误提示,从而导致不能创建虚拟机。例如有'D:\App\VirtualBox VMs\CentOS_6.5_One\CentOS_6.5_One.vmdk' 镜像拷贝成'D:\App\VirtualBox VMs\CentOS_6.5_Three\CentOS_6.5_Three.vmdk' 后,将其加入到新的虚拟机CentOS_6.5_Three时出现了下面的问题:
打开硬盘文件D:\App\VirtualBox VMs\CentOS_6.5_Three\CentOS_6.5_Three.vmdk失败.
Cannot register the hard disk'D:\App\VirtualBox VMs\CentOS_6.5_Three\CentOS_6.5_Three.vmdk' {e8afafd8-3d4d-4b5f-b620-1474b542d9db} because a hard disk'D:\App\VirtualBox VMs\CentOS_6.5_One\CentOS_6.5_One.vmdk' with UUID {e8afafd8-3d4d-4b5f-b620-1474b542d9db} already exists.
返回 代码: |
E_INVALIDARG (0x80070057) |
组件: |
VirtualBox |
界面: |
IVirtualBox {fafa4e17-1ee2-4905-a10e-fe7c18bf5554} |
被召者 RC: |
VBOX_E_OBJECT_NOT_FOUND (0x80BB0001) |
截图如下:
出现该问题的主要原始如错误信息中所提示的那样,主要是在同一个机器中所有的虚拟机镜像的UUID不能相同,且VirtualBox没有提供在创建时自动修改镜像UUID的机制。为了解决该问题,VirtualBox提供了命令来处理。解决办法:
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands sethduuid "D: \App\VirtualBox VMs\CentOS_6.5_Three\CentOS_6.5_Three.vmdk"
UUID changed to: 038a6beb-e24c-485f-a6ca-6d977f9c36ce
注: C:\Program Files\Oracle\VirtualBox为VirtualBox的安装路径,该命令是将"D:\App\VirtualBox VMs\CentOS_6.5_Three\CentOS_6.5_Three.vmdk"镜像的UUID修改,命令结束后输出了新的UUID信息