最近在拷贝vitrualbox虚拟机上遇到了问题:
Parent UUID {6f11c8bd-afd0-4025-a430-269186775870} of the medium 'E:\VirtualMachine\ubuntu_Routing\Snapshots/{5bbce121-479c-4bf1-aa61-33fbeeaf44f4}.vdi' does not match UUID {7a8795ef-7e18-4c37-b268-c2dc96b3269e} of its parent medium stored in the media re
记录一下。
就是VitrualBox对机器的复制没有vmware支持那么好。所以相同的机器复制是不能直接使用的,因为他们的UUID相同。需要更改hardDisk的UUID和用户文件中的 Machine 的UUID。这个算是另一块内容,见https://blog.csdn.net/Monster_li57/article/details/114965931。
但是我改了之后发现遇到上述问题。原因是我机器中有快照。而快照系统 .vdi 重点 parent UUID并没有改过来。所以在运行时就出错了。
解决方法很简单,只需要把快照的parent UUID设置为自己机器的新UUID就好了。(最开始是想把本机的UUID改回来,却失败了,不知道为什么)
使用命令 sethdparentuuid
.\VBoxManage.exe internalcommands sethdparentuuid "E:\VirtualMachine\ubuntu_Routing\Snapshots/{5bbce121-479c-4bf1-aa61-33fbeeaf44f4}.vdi" 7a8795ef-7e18-4c37-b268-c2dc96b3269e
就可以了。