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」してもエラーは起きてない。とりあえず、これで、様子見をしよう。