Failed to create the host-only adapter

Viewed 7375

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
5 Answers

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!

I was driving nuts last 2 days with this problem. Finally found a solution.

1.The Antivirus was causing the issue

2.You need to disable to Antivirus services on your windows system (You will need Admin access or get this done from your company IT Person)

3.Reinstall Docker tool box and start it (Admin mode) This works

I found all other solutions did not work, till I found this post: Laravel Vagrant Up SSH Problems

where adding the next code just before the end tag in YAML file did the trick

 config.vm.provider "virtualbox" do |vb|
        vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
    end

This thread is 3 years old but forward in time and I also had a similar issue with windows 10. Let me show you how I fixed it.

Open virtual box -> file -> host network manager host network manager

Once you select the option a box will open with the adapters for you to enable/disable.

By default for me the adapter 2 was disabled, once I enabled it I could run vagrant up with no issues.

adapters

Related