環境はWindows10。
以下のような設定で立ち上げていたが、2回目から繋がらない障害が発生。
Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.box_version = "2.2.9"
config.vm.network "private_network", ip: "192.168.33.11"
end
以下のような表示が出ていたため、問題の切り分けのためにbentoではなく
自分でboxファイルを作って試してみた。
Guest Addition version 5.0.26
VirtualBox version 5.1
起動して最初は繋がるが、bentoのboxと同じように2回目の立ち上げから繋がらない不具合が発生。
バージョンが原因ではないようだ。
$ ifconfig
で確認したところ、enp0s8が存在しなくなっていた。
ネットワーク設定を確認してみる。
/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp
# VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto enp0s3
iface enp0s3 inet static
address 192.168.33.11
netmask 255.255.255.0
# VAGRANT-END
#VAGRANT BEGIN以降の記述がおかしい。
enp0s8であったところがenp0s3になっている。
試しに以下のように書き直して再起動したところ、ネットワークは設定された。
/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp
# VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto enp0s8
iface enp0s8 inet static
address 192.168.33.11
netmask 255.255.255.0
# VAGRANT-END
boxを作るときに、ネットワーク設定を保存したまま作ってしまった可能性がある。
bentoのほうも要確認していきたい。
ifconfigで確認したところ、ipv6のアドレスが設定されていた。
Windowsのネットワークカードの設定の可能性もでてきた。
ipv6を外してやると繋がった。
