问题原因分析:
已使用过的镜像文件拷贝到其他硬盘不能直接用,需要给镜像文件生成新的 UUID,原因是这个 UUID 已经在本机的 VirtualBox 里注册过了。
方法1:
管理-》虚拟介质管理-》
找到相同的UUID,先释放掉,这里要先释放掉后续才能执行删除操作,挂载的情况下是无法删除的。
然后再次执行:管理-》虚拟介质管理-》找到相同的UUID虚拟机,把它删除即可解决问题。
方法2:
如果你想保留原来的虚拟机,可以用这个方法。
2.1 打开命令行操作,跳转到你的VM安装目录,直接窗口跳转或者命令行使用 cd 命令跳转都可以
2.2 输入下面指令
VBoxManage.exe internalcommands sethduuid +“虚拟的路径你的虚拟硬盘(要包括文件名后缀)”
C:Program FilesOracleVirtualBox>VBoxManage.exe internalcommands sethduuid F:AVS_UBUNTU2_REAmlogic_CMIAA158_UBUNTU2004.vmdk
# C:Program FilesOracleVirtualBox> VM的安装目录
# VBoxManage.exe internalcommands sethduuid 需要执行命令
# F:AVS_UBUNTU2_RE 虚拟机的路径
# Amlogic_CMIAA158_UBUNTU2004.vmdk 虚拟机名称,带后缀
2.3执行完会出现一行 UUID change to : xxxxx-xxxxx-xxxxx-xxxx-xxxxxxx 效果如下图所示,执行完这一步你就可以继续添加你的虚拟机了
总结:
使用上面两种方法的其中一个方法操作后,就可以正常添加了。