Mac下安装Homestead, vagrant up报错: Cannot register the hard disk

Jiameng_Jason
  • 2
新手上路,请多包涵

Mac下,安装Laravel运行环境Homestead vagrant up报错

jasondeMacBook-Pro:Homestead jason$ vagrant up
There was an error
while executing VBoxManage, a CLI used by Vagrant for controlling
VirtualBox. The command and stderr is shown below.

Command: ["list", "hostonlyifs"]

Stderr: VBoxManage: error: Failed to create the VirtualBox object!
VBoxManage: error: Cannot register the hard disk
'/Users/jason/VirtualBox
VMs/homestead-7/ubuntu-18.04-amd64-disk001.vmdk'
{30610e42-fefc-401e-ae9f-c3b6d84d826c} because a hard disk
'/Users/jason/VirtualBox
VMs/homestead-7/ubuntu-18.04-amd64-disk001.vmdk' with UUID
{436d022c-5932-4f12-a00f-6f37b1d313a9} already exists VBoxManage:
error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component
VirtualBoxWrap, interface IVirtualBox

clipboard.png

出现原因

步骤:
1、首次安装homestead环境是成功了,并能正常运行虚拟机
2、为了复习homestead环境的安装,删除了vagrant、virtual_box、并删除了文件/Users/jason/VirtualBox VMs/homestead-7/ubuntu-18.04-amd64-disk001.vmdk
3、再次安装好vagrant、virtualbox 添加了镜像box后,vagrant up 完蛋了总是提示我Cannot register the hard disk、with UUID already exists。。。。。。。

尝试的方法:

1、排除vagrant和virtual box版本不匹配导致的问题
   Vagrant V2.2.5
   virtual box V8.0.0.beta
   virtual 虚拟机: V6.0.8
2、VBoxManage internalcommands sethduuid 报错:
VBoxManage: error: Failed to create the VirtualBox object! VBoxManage:
error: Cannot register the hard disk '/Users/jason/VirtualBox
VMs/homestead-7/ubuntu-18.04-amd64-disk001.vmdk'
{30610e42-fefc-401e-ae9f-c3b6d84d826c} because a hard disk
'/Users/jason/VirtualBox
VMs/homestead-7/ubuntu-18.04-amd64-disk001.vmdk' with UUID
{436d022c-5932-4f12-a00f-6f37b1d313a9} already exists VBoxManage:
error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component
VirtualBoxWrap, interface IVirtualBox
3、可是这个文件:/Users/jason/VirtualBox VMs/homestead-7/ubuntu-18.04-amd64-disk001.vmdk 都已经被我删除了,总是提示Cannot register the hard disk


4、vim homestead.json
    

{


        "name": "laravel/homestead",
        "versions": [{
                "version": "8.0.0",
                "providers": [{
                        "name": "virtualbox",
                        "url": "/Users/jason/Homestead/virtualbox_8.0.0beta.box"
                }]
        }]
}
5、

jasondeMacBook-Pro:Homestead jason$ vagrant box list
laravel/homestead (virtualbox, 8.0.0)
回复
阅读 2.1k
1 个回答
Jiameng_Jason
  • 2
新手上路,请多包涵
✓ 已被采纳

已解决:

1、vim ~/Library/VirtualBox/VirtualBox.xml
2、删掉与homestead-7/ubuntu-18.04-amd64-disk001.vmdk相关的信息
3、Enjoy

宣传栏