Posted on

[Feature Request] Specify a static IP for VirtualBox VMs · Issue #1709 · docker/machine

By default, seems docker-machine picks one randomly, so forced to use the one for vboxnet0(192.168.59.3/24, the one used by boot2docker) seems to solve the issue:

$ docker-machine create --driver virtualbox --virtualbox-hostonly-cidr "192.168.59.3/24" dev
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...
To see how to connect Docker to this machine, run: docker-machine env dev

$ docker-machine ip dev
192.168.59.103

By default, seems docker-machine picks one randomly, so forced to use the one for vboxnet0 (192.168.59.3/24, the one used by boot2docker) seems to solve the issue: $ docker-machine create –driver virtualbox –virtualbox-hostonly-cidr “192.168.59.3/24” dev Creating VirtualBox VM… Creating SSH key… Starting VirtualBox VM… Starting VM… To see how to connect Docker to this machine, run: docker-machine env dev $ docker-machine ip dev 192.168.59.103

Source: [Feature Request] Specify a static IP for VirtualBox VMs · Issue #1709 · docker/machine