使用仅主机网络启动虚拟机时出现 Vagrant 错误

使用仅主机网络启动虚拟机时出现 Vagrant 错误

我已经使用命令在我的 vagrant vm 中设置了仅主机网络

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

但设置之后,每次我尝试启动vagrant up虚拟机时,它都会失败并发出下面的错误日志

Bringing machine 'default' up with 'virtualbox' provider...                                                                                                                         
[default] Clearing any previously set forwarded ports...                                                                                                                            
[default] Creating shared folders metadata...                                                                                                                                       
[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_INVALIDARG                                                                                                                                                        
VBoxManage.exe: error: Failed to create the host-only adapter                                                                                                                       
VBoxManage.exe: error: Assertion failed: [!aGuid.isValid()] at 'D:\tinderbox\win-4.3\src\VBox\Main\src-server\HostNetworkInterfaceImpl.cpp' (74) in long __cdecl HostNetworkInterface::init(class com::Bstr,class com::Bstr,class com::Guid,enum __MIDL___MIDL_itf_VirtualBox_0000_0000_0034).                                                                          
VBoxManage.exe: error: Please contact the product vendor!                                                                                                                           
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface                                                           
VBoxManage.exe: error: Context: "int __cdecl handleCreate(struct HandlerArg *,int,int *)" at line 66 of file VBoxManageHostonly.cpp         

以下是我的 vagrant 文件内容 -

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise64"
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
  config.vm.network :private_network, ip: "192.168.33.10"
end

答案1

刚刚为面临类似问题的人找到了答案。这出票清楚地解释了这是 VirtualBox 本身的一个错误。请点击此链接获取更多信息。这应该只发生在机器。请下载此测试构建他们已经修复了该问题,尽管它尚未发布稳定版本。

相关内容