vagrantvirtual-machinevirtualboxvagrant-windows

Failed to create the host-only adapter


I have the problem with vagrant up on my system. I have the error, you can see below. I have tried reinstall VBox, Vagrant, turned of the firewall, сhecked VBox networking driver and restarted host system, but it`s dont working.

Thanks all for help.

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: SetupDiCallClassInstaller (DIF_INSTALLDEVICE) failed 
(0x00000002)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component 
HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdeclhandleCreate(struct 
HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp

VBox version 5.2.22

Vagrant version 2.2.0

Host operating system Win7 x64

Guest operating system Ubuntu-16.04.5-desktop-amd64

Vagrantfile

dir = File.dirname(File.expand_path(__FILE__))

require 'yaml'
require "#{dir}/puphpet/ruby/deep_merge.rb"
require "#{dir}/puphpet/ruby/to_bool.rb"

configValues = YAML.load_file("#{dir}/puphpet/config.yaml")

provider = ENV['VAGRANT_DEFAULT_PROVIDER'] ? ENV['VAGRANT_DEFAULT_PROVIDER'] : 'local'
if File.file?("#{dir}/puphpet/config-#{provider}.yaml")
  custom = YAML.load_file("#{dir}/puphpet/config-#{provider}.yaml")
  configValues.deep_merge!(custom)
end

if File.file?("#{dir}/puphpet/config-custom.yaml")
  custom = YAML.load_file("#{dir}/puphpet/config-custom.yaml")
  configValues.deep_merge!(custom)
end

data = configValues['vagrantfile']

Vagrant.require_version '>= 1.8.1'

Vagrant.configure('2') do |config|
  eval File.read("#{dir}/puphpet/vagrant/Vagrantfile-#{data['target']}")
end

Solution

  • I did vagrant up on my host!

    After many tries I was reinstall my Windows. The need Virtual Machine host driver (VirtualBox Host-Only Ethernet Adapter in Windows Networking) was installing only on "clean" system that very curiously for me.

    Vagrant also need Windows PowerShell version older then 3, but Win7 default using 2. You need update Windows Net Framework for install 3 and older version on Win7.

    Good luck!