I run a docker machine on OS X and it works fine on my home Wi-Fi network (wifi-one).
On another wifi network (wifi-two), I canβt access the machine by default, either through the docker machine, or using pings. I tried to remove all the applications for dockers and virtual boxes and caches and reinstall them when Wi-Fi-2 was connected, but to no avail.
docker-machine uses a small vm virtual field that uses the host-only vbox network (vboxnet0) to communicate between the host and vm.
In wifi-one, I can connect the gateway to vboxnet0 (192.168.99.1), and I can ping vm (192.168.99.100). In the routing table, I can see the routes to vm using the correct interface:
Internet: Destination Gateway Flags Refs Use Netif Expire default dlinkrouter UGSc 60 2 en0 ... dlinkrouter c0:a0:bb:xx:xx:xx UHLWIir 66 155 en0 1180 192.168.99 link#10 UC 2 0 vboxnet 192.168.99.100 8:0:27:db:16:21 UHLWIi 2 42 vboxnet 1109 ...
In wifi-two, I can ping a vboxnet0 gateway, but not vm. Ping reports a request timeout, but the docker says "no host path." The routing table connected to Wi-Fi-2 shows the route to the network only for the vboxnet0 host on the wifi (en0) interface, and not on the vboxnet0 interface. It is also curious that the default route is the route to the vboxnet0 gateway, but there are no signs of a Wi-Fi router in the routing table. Despite this, the Internet connection works great on Wi-Fi.
Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.99.1 UGSc 46 0 en0 ... 192.168.99 link
So, I donβt know where the problem is here: router, mac os, virtual box or docker machine. I suspect that there is something funny in the configuration of the router, but I do not understand why the Wi-Fi router will have anything to do with the routes to the virtual network for hosting only.
edit: manually deleting the en0 route to 192.168.99 via en0 and running sudo route -nv add -net 192.168.99 -interface vboxnet0 seems to allow this on wifi-two.
But I would like to understand why this happens - why there is no way to vboxnet0 automatically when I join Wi-Fi-2, and I would like to find a better solution than running route add when I am on wifi-two.