Failed to create the host-only adapter - windows 10, docker, virtualbox
Asked Answered
O

12

14

I've recently run into this problem after having used docker toolbox without a problem for a while.

Started happening after windows update?

Windows 10 Home - 64

Uninstalled and reinstalled Docker toolbox

Uninstalled and reinstalled various versions of VirtualBox

Still get the same error

Running pre-create checks...
Creating machine...
(default) Copying C:\Users\me\.docker\machine\cache\boot2docker.iso to C:\Users\me\.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to create a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
(default) Creating a new host-only adapter produced an error: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe hostonlyif create failed:
(default) 0%...
(default) Progress state: E_FAIL
(default) VBoxManage.exe: error: Failed to create the host-only adapter
(default) VBoxManage.exe: error: Querying NetCfgInstanceId failed (0x00000002)
(default) VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
(default) VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 71 of file VBoxManageHostonly.cpp
(default)
(default) This is a known VirtualBox bug. Let's try to recover anyway...
Error creating machine: Error in driver during machine creation: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue
Looks like something went wrong in step ´Checking if machine default exists´... Press any key to continue...
Overstretch answered 24/4, 2017 at 6:0 Comment(0)
L
5

This answer is not specifically related to Docker, but seeing as this is one of the more recent top Stack Overflow search results (together with this question) on Google when searching for the "Failed to create the host-only adapter" error message from VirtualBox, I'm leaving this here in the hope that it will help someone else.

As a side note, if you can, I recommend you use Docker For Windows instead of Docker Toolbox to run Docker on Windows (requires Windows 10 Professional or Enterprise 64-bit).


My scenario:

  • Windows 10 Pro Version 1709
  • I use Hyper-V to run virtual machines whenever possible, but had a need to run an old VirtualBox VM with Windows XP as the guest OS
  • VirtualBox 5.2.4-119785 (Windows only supports a single hypervisor - I can recommend this approach if you need to switch between Hyper-V and VirtualBox)
  • VirtualBox did not (or failed to) create a host-only adapter on installation

When trying to create a host-only adapter using the Host Network Manager GUI, I got the dreaded "Failed to create the host-only adapter" error message, with a detail of: "Querying NetCfgInstanceId failed (0x00000002)".

Because I use Hyper-V, I had a number of Hyper-V Virtual Ethernet Adapters in addition to the actual physical adapter.

Network Connections

Looking at the properties of the physical adapter, it appears to be normal for Hyper-V to turn off all of the protocol drivers except for "Hyper-V Extensible Virtual Switch". Windows then gets its network connectivity through one of the virtual adapters, in my case it's called "External Virtual Switch", and the usual set of protocol drivers (TCP/IPv4 etc.) is enabled there.

Hyper-V Extensible Virtual Switch

I then noticed that VirtualBox appears to (want to) work in a similar fashion, because it had managed to install and enable a new protocol driver called "VirtualBox NDIS6 Bridged Networking Driver".

VirtualBox NDIS6 Bridged Networking Driver

When I checked the properties of the other, virtual, adapters I noticed that the "VirtualBox NDIS6 Bridged Networking Driver" was enabled on all of them, but the "Hyper-V Extensible Virtual Switch" was not. It seemed odd that the VirtualBox driver was enabled on the Hyper-V virtual adapters, so I disabled it on all of them but left it enabled on the physical adapter.

I think at this stage I threw in a good old reboot for good luck, though I doubt whether that was actually necessary. When I subsequently tried to create the VirtualBox host-only adapter again, it worked! (I actually got an error message from VirtualBox, in a modal that I had to find on the taskbar, about the adapter name already being used. However a new "VirtualBox Host-Only Ethernet Adapter" showed up under the Windows Network Connections and when I closed and re-opened the VirtualBox Host Network Manager window, the adapter showed up there too.)

TL;DR;

My theory is that VirtualBox is for some reason unable to determine which adapter is the actual physical network adapter, and in a rather gung-ho manner goes ahead and enables its "VirtualBox NDIS6 Bridged Networking Driver" on every adapter that it finds.

Furthermore it then appears to be unable to determine which adapter it needs to create its virtual "wrapper adapter" for and fails.

Even if you don't use/have Hyper-V, you might have multiple adapters including virtual ones (lots of VPN software installs virtual adapters too, for example).

You can try disabling the "VirtualBox NDIS6 Bridged Networking Driver" on all but your actual physical network adapter(s) before attempting to create the VirtualBox host-only adapter again.


This is certainly not a new issue for VirtualBox judging by the large number of related tickets on their public bugtracker and in other places, some more than 2 years old. I have a feeling that for a lot of people the problem might be related to what I have described above, so hopefully this helps them.


Edit 01/15

Hmm, in retrospect I'm not sure how normal it is for Windows to use the Hyper-V "External Virtual Switch" for network connectivity. If I remember correctly the "Default" switch that Hyper-V creates and which provides connectivity to guests via NAT is a relatively new thing and before it was necessary to add and use the "External" switch... On my home PC, without an "External" switch, the normal (TCP/IPv4 etc.) protocol drivers stay enabled on the physical network adapter and the "Hyper-V Extensible Virtual Switch" is disabled both on the physical and on the virtual adapters. I haven't had a chance to test what happens if I add a new "External Virtual Switch" under those circumstances.

Lithomarge answered 12/1, 2018 at 14:3 Comment(3)
I'm not using Docker, and I'm on Windows 7 x64, and have never had this problem before. But I just upgraded VirtualBox from 5.2.4 to 5.2.6 and began receiving Failed to create the host-only adapter upon vagrant up, whether with a new or existing VM. Uninstall/reinstalling/repairing VirtualBox had no effect, but thanks to your post, I thought to peek in Control Panel\Network and Internet\Network Connections, in Windows 7, and the two host-only adapters that VirtualBox had been using were greyed-out (disabled)! I simply right-clicked on them, re-enabled them, and was off to the races!Alberik
@BenJohnson Well I'm glad my (extremely long) post was helpful to you in that way :) I've come across your particular scenario a few times in my readings. Another common one seems to be that the "VirtualBox NDIS6 Bridged Networking Driver" is simply not enabled on the adapter.Lithomarge
In my case, it's also quite possible that the reboot actually solved the problem. Too many variables...Lithomarge
P
5

tl;dr If you are using Trend Micro or Symantec antivirus solutions, try uninstalling Virtualbox, then re-install it with the antivirus disabled. It may work with others as well.

I am adding this answer for the record.

My coworkers and I started having a similar issue just after updating from Windows 10 Pro version 1703 to version 1709.

I tried rolling back to version 1703, and it worked, but of course this is not an acceptable solution.

For some reason, this had to do with the antivirus, which in our case is Trend Micro Office Scan. After doing a clean re-install with the antivirus disabled, the host-only adapter was available again.

The issue has been reported in the Virtualbox forum and issue tracker:
https://forums.virtualbox.org/viewtopic.php?f=6&t=86179#p413876
https://www.virtualbox.org/ticket/17354#comment:22

Unfortunately, this error is quite frequent, and it has been reported dozens of times with different causes. In our case, the settings shown in bszom's answer were already correct.

Padron answered 28/2, 2018 at 11:54 Comment(1)
Seems to be the case with any antivirus, I had to disable Kaspersky. I uninstalled virtualbox then reinstalled and everything worked. ThanksDurant
E
2

I was able to get this working by disabling all of the network adapters, besides the physical one, during installation. Once installation is complete you can re-enable them. To disable the adaptors, do the following steps:

  1. Open Control Panel
  2. Network Connections
  3. Select each adaptor and then select 'Disable this network device' from the top
Enneahedron answered 12/12, 2018 at 1:27 Comment(0)
I
2

I have the same error as you. In my case when I open VirtualBox after got error, it alerts that the VirtualBox is needed to update. So I install the newest one and open the "Docker Quickstart Terminal" shortcut again eventually, it worked. So I think that install the virtual box again or install before installing Docker ToolBox may solve this problem. ( i know there is someone install it first ). good luck.

Intoxicated answered 23/3, 2020 at 10:2 Comment(0)
B
1

I was able to resolve the problem with the latest Virtualbox version 6.0.14

Bassinet answered 2/12, 2019 at 3:46 Comment(0)
S
0

Unfortunately I also had the Issue (Win10, 1709,virtualbox 5.1). While Using vagrant to pull linux images from the web.

This fixed it

Get your network drivers to the latest stand

Uninstall Virtualbox

Reinstall Virtualbox

Check if you have the "host only" virtual adapter in your network adapters config. If yes than you're good to go. If not. Try to install it from vboxmanage.

C:\Program Files\Oracle\VirtualBox\VBoxManage.exe hostonlyif create

And uninstall HyperV Virtual ethernet Adapter from the device manager if you see it (this blocks usually creation of virtualbox virtual network (Host-Only Ethernet adapter))

I had this issue on one type of computer of my company but not on others types. So this must be related to the type of network adapter itself. so sometimes you are lucky sometimes not. But I was more lucky having hardware to the latest stand.

Selfmortification answered 28/5, 2018 at 17:0 Comment(0)
H
0

I got the same error.

Checking Window's device manager, revealed a Virtualbox network adapter device with an exclamation mark.

The device's status stated that there was a signature problem for some reason.

I'm not encouraging anyone to ignore the warning, but I chose to do that :)

I turned off Window's signature verification using the method described in this link and I could finally use Virtualbox with a host-only adapter.

Note: this answer was duplicate. I've removed the other ones

Hardboard answered 22/8, 2019 at 20:19 Comment(0)
S
0

I got to the same error.

But I don't have "VirtualBox NDIS6 Bridged Networking Driver" in properties of physical connection. A have same driver "NPCAP ..." from wireshark installation. If look at description you can see this is NDIS6 driver.

Then I remove all wireshark packages: NPCAP, WinPCAP, Wireshark and remove VirtualBox.

Restart.

Reinstall Virtual Box. Install Docker ToolBox(Uncheck install NDIS5). And Create default VM for docker.

docker-machine create -d "virtualbox" default

Host-only interface created normally

docker-machine status
Running

That works for me.

Screwy answered 29/8, 2019 at 10:50 Comment(0)
A
0

I uninstalled wireshark, docker tooltip and VirtualBox.I also deactivate the antivirus temporary. Then, i installed docker tooltip without selecting install NDIS5 and it worked for me.

Antimagnetic answered 15/5, 2020 at 11:8 Comment(0)
G
0

I first installed Docker Toolbox yesterday since I have Windows 10 Home which does not support Docker Desktop.

Rebooting or installing Java did not solved it for me. What did was to delete Oracle's VM that was installed with the Toolbox (5.2.12 or something), and reinstall the new 6.1.8. Checking their website, this makes sense:

enter image description here

Gamic answered 29/5, 2020 at 13:8 Comment(0)
P
0

Above solutions do not work for me, so I have installed the Virtual Box separately from here.

When installing Docker, uncheck the Virtual Box checkbox.

Palinode answered 7/7, 2020 at 16:51 Comment(0)
L
0

I got the same error:

(default) VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface

but in my case I was trying to install Docker Toolbox on Windows 8.1 64-bit.

Windows-8.1-6.3.9600-SP0 : AMD64

Previously, I had virtualbox version 6.0 installed on my system, so I unchecked the docker toolbox installer option, install virtualbox.

For my scenario it worked to uninstall virtualbox 6.0 reboot the system and install VirtualBox-6.1.12-139181

Note: As uninstaller use this tool.

And ready docker in windows 8.1 running.

Docker ToolBox on Windows 8.1

Luannaluanne answered 11/8, 2020 at 9:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.