VirtualBox Host-Only Ethernet Adapter #2 がエラーの解決方法

ある時突然、virtualboxでhost-only adapterが使えなくなったので,解決方法をシェア

 

★現象

Vagrantからvagrant upを行って、virtualboxを使用するもhost-only adapterが使えずエラー...


★エラー内容

Interface ('VirtualBox Host-Only Ethernet Adapter #2') is not a Host-Only Adapter interface (VERR_INTERNAL_ERROR)


★ログ

f:id:Appkun:20190623224208p:plain

error

★原因

ネットをちらほら検索するとどうやらWindowsUpdateが原因の模様のようです。

 

★解決方法

1.VirtualboxをUnInstall

2.Virtualboxを改めてネットから以下のVagrant対応版※1をインストール

3.Vagrantからvagrant upを行って、virtualboxを使用するもhost-only adapterが使えずエラー...

4.ここでC:\Program Files\Oracle\VirtualBoxディレクトリへ行き、「.\VBoxManage.exe hostonlyif create 」を実行する※2

※注意1

 

    ※1 以下のVagrant対応版をインストールすること!
 vagrant対応版でないと以下のエラーが出るため。
    $ vagrant up
    The provider 'virtualbox' that was requested to back the machine
    'default' is reporting that it isn't usable on this system. The
    reason is shown below:
 
    Vagrant has detected that you have a version of VirtualBox installed
    that is not supported by this version of Vagrant. Please install one of
    the supported versions listed below to use Vagrant:
 
    4.0, 4.1, 4.2, 4.3, 5.0, 5.1, 5.2, 6.0
 

※注意2

(virtualboxのUnInstallを行わずに、上記手順4のコマンドを実行すると'VirtualBox Host-Only Ethernet Adapter #3'が作成されるが、その後の対応方法が不明のため、VirtualBoxを再インストールしました。)

f:id:Appkun:20190623224535p:plain

command(VBoxManage.exe hostonlyif create)




5.Vagrantからvagrant upを行い、問題なく起動。

 

f:id:Appkun:20190623224648p:plain

正常にvagrant upでvirtualboxが起動

5.しかしこれでは、仮想環境へのpingが通らない。

f:id:Appkun:20190623230922p:plain

仮想環境へのpingに失敗

6.vagrant reloadでvirtual boxを再起動

f:id:Appkun:20190623231023p:plain

vagrant reload

 

7.無事にPingが通りました..

f:id:Appkun:20190623231138p:plain

仮想環境へのpingに成功



(なお、本手順では、vagrant upによるvirtualboxの操作を行っているが、通常のvirtualboxGUIを使ったケースでも同様と推測します...)