Machine: This machine has been allocated an IP address, but Docker Machine could not reach it successfully

Created on 22 May 2017  路  19Comments  路  Source: docker/machine

I have a little project called Fluentdocker here on GitHub. I've got a bug report that made me run my old docker-machine unit test and I get errors back when creating a new docker machine.

  • Environment: Windows 10
  • Docker: Community Edition, Version 17.05.0-ce-win11 (12053), Channel: edge, ffbc5f5

This is the error output:
_"This machine has been allocated an IP address, but Docker Machine could not reach it successfully.
SSH for the machine should still work, but connecting to exposed ports, such as the Docker daemon port (usually :2376), may not work properly.
You may need to add the route manually, or use another related workaround.
This could be due to a VPN, proxy, or host file configuration issue.
You also might want to clear any VirtualBox host only interfaces you are not using."_

Howerver the new _machine_ works - but it is hard for me to determine when such an operation has gone well or not during the create phase.

Cheers,
Mario

Most helpful comment

For me the problem is in VirtualBox 5.1
I have to give the following command every reboot.

sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up

My environment:
OS: Ubuntu 16.04 LTS
Docker version 17.05.0-ce, build 89658be
docker-machine version 0.12.1, build c8b17e8

All 19 comments

Anyone? Is this expected behavior?

I'm having the same issue.

Environment: macOS 10.12.5
Docker: Version 17.05.0-ce

Can't seem to find any solution to this error.

I am having the same issue!

I have the same issue on Ubuntu Desktop 16.04 today

Just tried this today after not using docker for a while, brand new install, doesn't work. Tried removing the host-only interface from vbox, deleted my ~/.docker, no luck.

Hi,

For me, removing Virtual Box 5.1 and installing Virtual Box 5.0 work

CentOS Linux release 7.3.1611 (Core)
docker-machine version 0.12.1

For me the problem is in VirtualBox 5.1
I have to give the following command every reboot.

sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up

My environment:
OS: Ubuntu 16.04 LTS
Docker version 17.05.0-ce, build 89658be
docker-machine version 0.12.1, build c8b17e8

Same issue - I have docker running hosts on a different subnet that work just fine. Just docker-machine that is the issue. No routing set up to get to the 192.168.x.x subnet when creating the host.
Tried setting it up manually with no luck as a ifconfig setup docker-machine sees as a conflict.

root@ubuntu:~# docker-machine version
docker-machine version 0.12.2, build 9371605
Ubuntu 16.04 LTS
Oracle VM VirtualBox Manager 5.1.24

Tried host-only mode and get the exact same indications

root@ubuntu:~# VBoxManage list hostonlyifs
root@ubuntu:~# docker-machine create -d virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying /root/.docker/machine/cache/boot2docker.iso to /root/.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) Found a new host-only adapter: "vboxnet0"
(default) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually :2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.
Checking connection to Docker...
Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.101:2376": dial tcp 192.168.99.101:2376: _getsockopt: no route to host_
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

Hi all,

removing Virtual Box 5.1 and installing Virtual Box 5.0 worked for me

I ran into this problem as well, but fortunately VirtualBox recently released a new version 5.1.30 which made the issue go away for me. So seems to have been a problem in VirtualBox 5.1 up until this version.

Updating VirtualBox fixed the errors for me. Thanks @baldervanx !

same issue with version 5.2.2 r119230

I had the same problem today with a new VM (VirtualBox 5.2.8 r121009). docker-machine ls would error out with a "timeout" and problems similar to the ones stated above.

Then I remembered that I had connected to my work VPN. Shutdown the VPN connection and the problem went away!

:-)

docker-machine version 0.14.0, build 89b8332

same issue with:

vboxmanage: 5.2.4r119785
docker-machine: 0.14.0, build 89b8332

Thanks @gautamsatpathy , I was having similar problem then came across your post. Somehow vpn messes it up.

Same problem for me on Linux Mint 19 (based on Ubuntu 18.04)

Docker version 18.06.1-ce, build e68fc7a
VirtualBox version 5.2.18r124319

Bringing the interface down and back up as suggested by ecylmz fixed it for me.

same problem for

Oracle VM VirtualBox Manager 5.1.38_Ubuntu
docker-machine version 0.16.0, build 702c267f

for Ubuntu 16.04.5 LTS

same problem

in the past when it happened I got it working again by deleting the machine and recreating

it has just hit me again today and nothing works:

$ docker-machine regenerate-certs anentropic
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Waiting for SSH to be available...
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.
...

$ curl -L https://github.com/docker/machine/releases/download/v0.16.1/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
>   chmod +x /usr/local/bin/docker-machine

$ dm --version
docker-machine version 0.16.1, build cce350d7

$ dm stop anentropic
Stopping "anentropic"...
Machine "anentropic" was stopped.

$ dm rm anentropic
About to remove anentropic
WARNING: This action will delete both local reference and remote instance.
Are you sure? (y/n): y
Successfully removed anentropic

$ sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up

$ dm create anentropic
Running pre-create checks...
Creating machine...
(anentropic) Copying /Users/anentropic/.docker/machine/cache/boot2docker.iso to /Users/paul/.docker/machine/machines/anentropic/boot2docker.iso...
(anentropic) Creating VirtualBox VM...
(anentropic) Creating SSH key...
(anentropic) Starting the VM...
(anentropic) Check network to re-create if needed...
(anentropic) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually <ip>:2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.
Checking connection to Docker...
Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": dial tcp 192.168.99.100:2376: i/o timeout
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

I can't do anything, it just doesn't work

rebooting my laptop and then recreating the machine fixed it

Was this page helpful?
0 / 5 - 0 ratings