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

Angad Dubey picture Angad Dubey · Apr 24, 2017 · Viewed 20.1k times · Source

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...

Answer

vctls picture vctls · Feb 28, 2018

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.