Search code examples
dockernetwork-programmingdocker-machine

Docker Machine network error on public network


I have an issue where I'm unable to start any docker machines whilst connected to a the WiFi network in my local Starbucks, receiving the following output;

$ docker-machine start
Starting "default"...
(default) Check network to re-create if needed...
Error setting up host only network on machine start: host-only cidr conflicts with the network address of a host interface

This does not happen when connected to my home network, or whilst using my mobile hotspot. Is there any workaround for this?


Solution

  • There is a collision between the docker machine and the network that is being set up for wifi. Try creating a new docker machine with other ip:

    docker-machine create --driver virtualbox --virtualbox-hostonly-cidr "192.168.123.99/24" mymachine
    

    Use it:

    docker-machine env mymachine
    

    This is a new machine in addition to the 'default' one. You might see that it won't have your previous work (images, etc).