高木のブログ

VirtualBox のバージョンを上げたら vagrant up ができなくなった

· 115 words · 1 minutes to read

VirtualBox を 6.1.32 に上げたら vagrant up でコケるようになった(上げる前のバージョンは失念した)

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'centos/7' version '2004.01' is up to date...
==> default: 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.30.93
  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

原因 🔗

どこからかのバージョンから、Vagrantfileで設定する private_network のIPアドレスに範囲制限が入ったみたい

config.vm.network "private_network", ip: "192.168.30.93"

解決方法 🔗

解決方法は2パターンある

https://www.virtualbox.org/manual/ch06.html#network_hostonly

範囲内のIPアドレスにする方法 🔗

Ranges: 192.168.56.0/21 となっているので、192.168.56.1 ~ 192.168.63.254 のどれかにする

範囲を変更する方法 🔗

/etc/vbox/networks.conf で範囲を指定できるのでそこに任意の値を記述する

以下は範囲制限を無効にする設定

0.0.0.0/0 ::/0

自分の環境では /etc/vbox ディレクトリがなかったので作成した

Categories


Tags