1
1

More than 3 years have passed since last update.

vagrant up で 「Failed to create the host-only adapter」が発生した場合の対応

Last updated at Posted at 2019-12-01

VirtualBox6.0 + vagrantで「Failed to create the host-only adapter」が発生して、「vagrant up」ができない。

==> default: Setting the name of the VM: centos7_default_1575127270766_28
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:

  https://www.virtualbox.org/manual/ch04.html#sharedfolders

This option can be disabled globally with an environment variable:

  VAGRANT_DISABLE_VBOXSYMLINKCREATE=1

or on a per folder basis within the Vagrantfile:

  config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
==> 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: Operation canceled by the user

VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component VirtualBoxWrap, interface IVirtualBox

VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp

調べていくと、下記のブログにセキュリティソフトをOFFにして、インストールできたとのことで、試してみた。
https://blog.officekoma.co.jp/2018/04/vagrant-up-failed-to-create-host-only.html

今回、Vagrant のプロバイダはVirtualBoxにしているのですが、
結論から言うと、
一度VirtualBoxをアンインストールして、「ウイルスバスター」が停止している状態で、VirtualBoxを再インストールする必要があります。
その上で、再度「vagrant up」試してみると、うまく行きました。
(再インストールから「vagrant up」まで、ウイルスバスターは停止させています。)

※一度、仮想環境まで作成出来れば、後はウイルスバスターが起動していても大丈夫です。

今回、私はカスペルスキーを使ってましたが、同様にカスペルスキーをOFFにしてVirtualBoxを再インストール。その後、カスペルスキーを起動。そして、「vagrant up」してもエラーは起きてない。とりあえず、これで、様子見をしよう。

1
1
0

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
1
1