Write the Code. Change the World.

7月 12

A VirtualBox machine with the name 'homestead' already exists.
Please use another name or delete the machine with the existing
name, and try again.

Do

之前在mac上安装laravel/homestead vagrant虚拟机环境时由于参照的教程是: 每次都必须在~/Homestead目录下边运行vagrant up/halt命令,觉得实在是不方便,于是乎按照另外一个教程(在任何目录下可以通过homestead up来启动虚拟机)来配置环境,但是当键入homestead up时,却报出

==> default: Importing base box 'laravel/homestead'...

==> default: Matching MAC address for NAT networking...

A VirtualBox machine with the name 'homestead' already exists.

Please use another name or delete the machine with the existing

name, and try again.

这样的错误

stackoverflow上好几个人说通过vagrant global-status 查看虚拟器,然后在vagrant destroy {id}删除对应名称的虚拟机可以解决问题,但是重复n遍homestead up或者到~/Homestead下运行vagrant up之后,还是会报出上边的错误,后来通过VBoxManage list vms获取虚拟机列表,然后在通过运行

VBoxManage unregistervm homestead --delete

之后,重新运行homestead up之后 一切回归正常

参考

https://www.cnblogs.com/huangye-dream/p/4604973.html