Vagrant 开启报错?

最近在学Laravel,然后启动vagrant时候报错了,说啥IP不在范围内,啥情况勒
截屏2021-12-07 下午10.57.44.png

jw@ljwdeMacBook-Air Homestead % vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' version '12.0.0' is up to date...
==> homestead-7: Fixed port collision for 3306 => 33060. Now on port 2200.
==> homestead-7: Clearing any previously set network interfaces...
The IP address configured for the host-only network is not within the
allowed ranges. Please update the address used to be within the allowed
ranges and run the command again.

  Address: 192.168.10.10
  Ranges: 192.168.56.0/21

Valid ranges can be modified in the /etc/vbox/networks.conf file. For
more information including valid format see:

  https://www.virtualbox.org/manual/ch06.html#network_hostonly
阅读 4.2k
2 个回答

这个报错信息不是说了么?你用了hostonly网络,你的ip和hostonly的IP段不匹配,让你去改virtualbox的network配置文件,详情参阅最后virtualbox的官方文档中关于hostonly network mode的说明

而且你也没有完全按照Laravel的官方文档去做,配置的IP完全不对。virtualbox默认的hostonly network网段就是192.168.56.0/24,你自己改错了这个ip导致这个错误

我刚刚滚动更新了我整个manjaro系统也碰到这个问题,
解决办法是,修改/etc/vbox/networks.conf文件内容,比如我vbox对外暴露的ip是192.168.33.77,那么改成这个:

$ sudo cat /etc/vbox/networks.conf
* 192.168.33.0/21

楼主应该把/etc/vbox/networks.conf文件内容改成

* 192.168.10.0/21
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进