Vagrant VBoxManage:错误:无法创建仅主机适配器(II)

Vagrant VBoxManage:错误:无法创建仅主机适配器(II),vagrant,virtualbox,vagrant-windows,Vagrant,Virtualbox,Vagrant Windows,此错误以前在post:中报告过,并且在新版本的Windows/vagrant/OracleVB中不断出现,如下所述。如果任何人已经为下面描述的安装程序找到了此问题的解决方案,请在此处共享: 主机:windows10家庭版1607;操作系统构建14939.105 来宾:使用“bento/ubuntu-14.04”图像 流浪汉:1.8.5 Oracle VB:5.1.4 r110228(Qt5.5.1) 我先安装了Oracle VB,然后安装了Vagrant(都是新安装的),然后像往常一样在我的

此错误以前在post:中报告过,并且在新版本的Windows/vagrant/OracleVB中不断出现,如下所述。如果任何人已经为下面描述的安装程序找到了此问题的解决方案,请在此处共享:

  • 主机:windows10家庭版1607;操作系统构建14939.105
  • 来宾:使用
    “bento/ubuntu-14.04”
    图像
  • 流浪汉:1.8.5
  • Oracle VB:5.1.4 r110228(Qt5.5.1)
我先安装了Oracle VB,然后安装了Vagrant(都是新安装的),然后像往常一样在我的一个工作区中运行
Vagrant up
。vagrant下载完虚拟机后,在尝试启动虚拟机时给出以下错误输出:

C:\Users\AHL\workspace>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bento/ubuntu-14.04' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'bento/ubuntu-14.04'
    default: URL: https://atlas.hashicorp.com/bento/ubuntu-14.04
==> default: Adding box 'bento/ubuntu-14.04' (v2.2.9) for provider: virtualbox
    default: Downloading: https://atlas.hashicorp.com/bento/boxes/ubuntu-14.04/versions/2.2.9/providers/virtualbox.box
    default: Progress: 100% (Rate: 74436/s, Estimated time remaining: --:--:--)
==> default: Successfully added box 'bento/ubuntu-14.04' (v2.2.9) for 'virtualbox'!
==> default: Importing base box 'bento/ubuntu-14.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/ubuntu-14.04' is up to date...
==> default: Setting the name of the VM: workspace_default_1473571560144_68182
==> 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 71 of file VBoxManageHostonly.cpp

C:\Users\AHL\workspace>
流浪汉档案:

Vagrant.configure(2) do |config|
  config.vm.box = "bento/ubuntu-14.04"
  config.vm.network "private_network", ip: "192.168.33.10"
end

该问题的解决方案似乎与相关帖子中的报告相同:

尽管Oracle VB GUI中的VM显示为未运行,但您必须通过Oracle VB GUI手动启动它(这应该可以工作并允许您登录到该框),然后再次手动关闭它(也可以通过Oracle VB GUI)。然后,再次运行
vagrant up
,它应该会工作

如果您对此设置有问题,请在此帖子中添加评论。

尝试执行

C:\HashiCorp\Vagrant\bin\Vagrant.exe作为管理员,然后

vagrant up
在命令行中


它对我起了作用。

更新2020.10:以下步骤不再有效

如果您安装的VirtualBox没有网络支持,或者您没有安装网络支持

尝试:

  • 开放虚拟箱
  • 菜单文件-->设置-->网络
  • 在右侧,单击“添加新网络”按钮
  • 采用默认设置
  • 终端类型:流浪者向上
  • 对我来说,它奏效了。祝你好运