LoginSignup
17
12

More than 5 years have passed since last update.

vagrant up で起動できなくなった

Last updated at Posted at 2017-02-22

ちょっとハマったのでシェア。
何かをキッカケに vagrant up で起動できなくなった。

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: E_FAIL
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: SetupDiCreateDeviceInfo failed (0x00000005)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 71 of file VBoxManageHostonly.cpp

Failed to host-only adapter とあるので、ネットワーク設定をコメントアウトして vagrant ssh してみると起動できた。

$ vi Vagrantfile
config.vm.network "private_network", ip: "192.168.33.10"

#config.vm.network "private_network", ip: "192.168.33.10"

$ vagrant ssh

気になったので Windows のスタートメニューから「ネットワーク接続」を開き、「VirtulBox Host-Only Network」のプロパティを確認すると、なんとIPv4アドレスが 192.168.56.1 となっていた。デフォルトは 192.168.33.1 なんですけどー

思い当たるフシがあって、おそらく ViretulBoxのアップデートを一度アンインストールせずにしたためか、またはDockerをインストールしたためか。

とりあえずは vi Vagrantfile して、IPアドレスを書き換えることで対処。

$ vi Vagrantfile
#config.vm.network "private_network", ip: "192.168.33.10"

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

$ vagrant up

17
12
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
12