vBox导入vdi文件uuid报错的解决办法

vBox导入vdi文件uuid报错的解决办法

处理中需要用到的两条命令
查看注册信息

VBoxManage showmediuminfo  xxx.vdi

修改uuid

VboxManage internalcommands sethduuid "xxx.vdi" “uuid“

操作中要注意的两点:
1、先将VBoxManage.exe所在的路径加到环境变量paht里,否则会提示打不到文件;
2、在命令行里要进入到xxx.vdi文件所在的路径后再运行命令操作。


打开虚拟机提示如下错误信息

UUID {4be1594a-77bc-45ec-b7ca-9fed95938ccc} of the medium 'D:\VMach\VirtualBox VMs\Win7x32\HG001.vmdk' does not match the value {da9ac997-1961-42ba-bcd9-6cc94b78c99d} stored in the media registry ('C:\Users\james\.VirtualBox\VirtualBox.xml').
翻译意思如下
D:\VMach\VirtualBox VMs\Win7x32\HG001的UUID {4be1594a-77bc-45ec-b7ca-9fed95938ccc}。vmdk'不匹配存储在媒体注册表中的值{da9ac997-1961-42ba-bcd9-6cc94b78c99d} ('C:\Users\james\. virtualbox \VirtualBox.xml')。

查看虚拟盘文件注册信息如下,有错误提示

 输入查看注册信息的命令

vboxmanage showmediuminfo hg001.vmdk

结果显示
UUID:           da9ac997-1961-42ba-bcd9-6cc94b78c99d
Parent UUID:    base
State:          inaccessible
Access Error:   UUID {4be1594a-77bc-45ec-b7ca-9fed95938ccc} of the medium 'D:\VMach\VirtualBox VMs\Win7x32\HG001.vmdk' does not match the value {da9ac997-1961-42ba-bcd9-6cc94b78c99d} stored in the media registry ('C:\Users\james\.VirtualBox\VirtualBox.xml')
Type:           normal (base)
Location:       D:\VMach\VirtualBox VMs\Win7x32\HG001.vmdk
Storage format: VMDK
Format variant: dynamic default
Capacity:       0 MBytes
Size on disk:   0 MBytes
Encryption:     disabled
In use by VMs:  Win7x32 (UUID: 4e85fb1d-afd3-4829-a7fb-e6db93ada3a6) [备份 1 (UUID: ed1cafa2-a652-43bd-a2c9-b7671adef7ae)]
Child UUIDs:    0ee64149-edde-4ad7-9430-d5d9be224dd5

上面的信息提示HG001.vmdk文件中的UUID:{4be1594a-77bc-45ec-b7ca-9fed95938ccc} 与 'C:\Users\james\.VirtualBox\VirtualBox.xml'中指向虚拟机.box文件中记录的UUID: {da9ac997-1961-42ba-bcd9-6cc94b78c99d}不匹配,那么我们就使用VboxManage internalcommands sethduuid指令把HG001.vmdk文件中的UUID改为{da9ac997-1961-42ba-bcd9-6cc94b78c99d}即可

修改UUID信息

VboxManage internalcommands sethduuid "hg001.vmdk" "da9ac997-1961-42ba-bcd9-6cc94b78c99d"

运行结果显示
UUID changed to: da9ac997-1961-42ba-bcd9-6cc94b78c99d

再查看虚拟盘文件注册信息,显示正常
vboxmanage showmediuminfo hg001.vmdk
UUID:           da9ac997-1961-42ba-bcd9-6cc94b78c99d
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       D:\VMach\VirtualBox VMs\Win7x32\HG001.vmdk
Storage format: VMDK
Format variant: dynamic default
Capacity:       32768 MBytes
Size on disk:   3763 MBytes
Encryption:     disabled
In use by VMs:  Win7x32 (UUID: 4e85fb1d-afd3-4829-a7fb-e6db93ada3a6) [备份 1 (UUID: ed1cafa2-a652-43bd-a2c9-b7671adef7ae)]
Child UUIDs:    0ee64149-edde-4ad7-9430-d5d9be224dd5

启动虚拟机非常顺利的就见到了虚拟机的桌面了^_^
 

上一篇:《关于想在Pycharm下使用nmap然后报错nmap.nmap.PortScannerError: ‘nmap program was not found in path.然后解决的那些事》


下一篇:virtualbox给已有磁盘扩展容量