系統類型及軟件版本
- 系統:Win10 專業版
- Vagrant:Vagrant 2.2.4
- VM VirtualBox:6.0.12
報錯信息
PS E:\Develop\Vagrant\Ubuntu_ser_18_bmg> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'peru/ubuntu-18.04-server-amd64' version '20191202.01' is up to date...
==> 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: Could not find Host Interface Networking driver! Please reinstall
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp
報錯原因
Could not find Host Interface Networking driver! Please reinstall
意思是:找不到主機接口網絡驅動程序!請重新安裝
這時我突然想到之前我覺得網絡連接裏面的網卡太多了,在設備管理 > 網絡適配器 中卸載了許多自己認爲不重要的虛擬網卡,同時也把VirtualBox虛擬網卡驅動給刪除了
因爲驅動沒有了,無法創建虛擬網卡,所以通過 vagrant up
命令啓動虛擬機拋出上面的錯誤信息。
解決辦法
- 找到
xxx\Oracle\VirtualBox\drivers\network\netadp6
目錄,文件如下。
- 右擊
VBoxNetAdp6.inf
文件,選擇安裝
3. 這時執行 vagrant up
命令,可以正常啓動虛擬機了!