machine icon indicating copy to clipboard operation
machine copied to clipboard

Duplicate host only adapters created when creating a VM with virtualbox, VM creation hangs

Open rwilliams opened this issue 11 years ago • 8 comments

Description of problem:

I'm running the latest Docker Toolbox (1.8.2) on Windows 10 When creating my first VM docker-machine creates 2 network adapters, the 2nd one gets assigned to the vm with garbage settings and create process hangs.

The culprit

It appears that there is significant latency from when a hostonlyif is created to being able to accurately query hostonlyifs. When docker-machine checks to see if there is an already created hostonlyif the netmask returned from list hostonlyifs doesn't match the expected netmask, instead we see a value of 15.0.0.0. This causes docker-machine to create a 2nd hostonlyif.

I'm not sure if this a bug in virtualbox or just a quirk we'll have to deal with.

Environment details (AWS, VirtualBox, physical, etc.):

Windows 10. Docker Toolbox 1.8.2

How reproducible:

Very reproducible

Steps to Reproduce:
  1. Start with a fresh Docker Toolbox install.
  2. Remove all VM's and orphaned host only adpaters in VirtualBox
  3. Attempt to create the default vm with docker quickstart,kitematic, or docker-machine
Actual Results:

VM creation hangs and two host only network adapters are created here's the docker-machine create with debug http://pastebin.com/raw.php?i=i868Tt7c

Expected Results:

VM creation to succeed with only one host only adapter

rwilliams avatar Sep 12 '15 08:09 rwilliams

Hello, Any release plan for that issue?

michalborek avatar Sep 28 '15 09:09 michalborek

@michalborek It will be released in the 0.5.0 release in about two weeks. In the meantime, you can try the master build to see if it resolves your issue.

nathanleclaire avatar Sep 28 '15 18:09 nathanleclaire

I tried using master to workaround this exact issue but was stymied by other problems (#1906). If you have success with it, would love to know how! Good to know that the next release is coming soon. :smile:

carolynvs avatar Sep 28 '15 18:09 carolynvs

Hope this is fixed soon. My workaround is: docker-machine stop default, turn off all network adapter beyond the first (#2, #3, ... #n). You can not delete them (windows says it's impossible, at least here, YMMV), then docker-machine start default.

The reason why it does not work is that DHCP server is still bound to old one in windows route table (102.168.99.x entries in route print), but no one actually listens there as it is no one there. If you switch all of them off, you switch off the one which was used to route 192.168.99.x, the entries are removed, and new routing is created for new interface (which then works and assigns the badly needed 192.168.99.100 where due).

If the new one wasn't created (or at least, old one was always switched off / removed), the problem wouldn't appear.

ghost avatar Oct 25 '15 20:10 ghost

In fact I have simpler workaround - stop / start the machine directly from virtualbox UI.

ghost avatar Oct 25 '15 20:10 ghost

You should remove any host only network adapters above 3. Ex to remove the 4: VBoxManage hostonlyif remove vboxnet4

Then you should be good to go :)

gregory avatar Feb 08 '16 20:02 gregory

@gregory This worked for me! Thanks :)

on OSX version 10.11.3

ironprice91 avatar Mar 18 '16 03:03 ironprice91

@gregory thank you - this has been annoying me for weeks!

jaspertandy avatar Mar 30 '16 13:03 jaspertandy