Machine: Docker “waiting for an IP” when starting or creating new machine

Created on 21 Dec 2018  Â·  2Comments  Â·  Source: docker/machine

Been struggling to get this resolved for several days now.

Trying to implement a WSL and VirtualBox setup on Windows 10 Pro. The reasons aren't relevant to the issue, but using Hyper-V isn't an option. Trying to implement per:

https://www.paraesthesia.com/archive/2018/09/20/docker-on-wsl-with-virtualbox-and-docker-machine/

Whether I use Docker Toolbox or just docker-machine, the results are invariably the same. "Running as Administrator" just creates the VMs under the admin account which I don't want either. Tried rm and recreating the VMs a few dozen times.

Basically whether creating a new machine, or trying to start one, I get this error:

(default) Waiting for an IP...

Error creating machine: Error in driver during machine creation: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded

It still creates the machine but state is timeout:

NAME      ACTIVE   DRIVER       STATE     URL   SWARM   DOCKER   ERRORS
default            virtualbox   Timeout

I do a docker-machine env default and get the following:

Error checking TLS connection: ssh command error:
command : ip addr show
err     : exit status 255
output  :

The VM does show up in VirtualBox and has the same network adapter as my other working VMs (in that they can connect to the internet) with the exception of "Adapter 2". That is not on my other VMs:

enter image description here

The Docker VM has the following in terminal:

enter image description here
enter image description here

In addition, I have gone through the following suggestions and nothing has resolved the issue. The solutions generally involve recreating the VM.

https://github.com/docker/toolbox/issues/457

https://stackoverflow.com/questions/35958619/docker-terminal-waiting-for-an-ip

https://github.com/docker/machine/issues/3268

https://github.com/docker/machine/issues/4053

Most helpful comment

i was faced the same issue trying to create docker vm
in my particular case there were troubles with establishing ssh connection:

 .\docker-machine --debug create default
...
(default) Waiting for an IP...
(default) DBG | Getting to WaitForSSH function...
(default) DBG | Using SSH client type: external
(default) DBG | &{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null [email protected] -o IdentitiesOnly=yes -i C:\Users\DulN\.docker\machine\machines\default\id_rsa -p 58996] C:\Windows\System32\OpenSSH\ssh.exe <nil>}
(default) DBG | About to run SSH command:
(default) DBG | exit 0
(default) DBG | SSH cmd err, output: exit status 255:
(default) DBG | Error getting ssh command 'exit 0' : ssh command error:
(default) DBG | command : exit 0
(default) DBG | err     : exit status 255
(default) DBG | output  :

further investigation shown that default ssh client (C:\Windows\System32\OpenSSH\ssh.exe) denies to establish ssh connection due to "bad permissions" of private key:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'C:/Users/DulN/.docker/machine/machines/default/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "C:/Users/DulN/.docker/machine/machines/default/id_rsa": bad permissions

all my attempts to _fix_ "bad permissions" using chmod were not successful
so i've decided to switch to ssh implementation shipped with Git installation:
C:\Program Files\Git\usr\bin\ssh.exe

$ where ssh
C:\Program Files\Git\usr\bin\ssh.exe
C:\Windows\System32\OpenSSH\ssh.exe

$ C:\Windows\System32\OpenSSH\ssh.exe -V
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

$ "C:\Program Files\Git\usr\bin\ssh.exe" -V
OpenSSH_8.0p1, OpenSSL 1.1.1c  28 May 2019

eventually i've switched my system PATH variable to _valid_ ssh executable and successfully recreated docker vm

All 2 comments

i was faced the same issue trying to create docker vm
in my particular case there were troubles with establishing ssh connection:

 .\docker-machine --debug create default
...
(default) Waiting for an IP...
(default) DBG | Getting to WaitForSSH function...
(default) DBG | Using SSH client type: external
(default) DBG | &{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null [email protected] -o IdentitiesOnly=yes -i C:\Users\DulN\.docker\machine\machines\default\id_rsa -p 58996] C:\Windows\System32\OpenSSH\ssh.exe <nil>}
(default) DBG | About to run SSH command:
(default) DBG | exit 0
(default) DBG | SSH cmd err, output: exit status 255:
(default) DBG | Error getting ssh command 'exit 0' : ssh command error:
(default) DBG | command : exit 0
(default) DBG | err     : exit status 255
(default) DBG | output  :

further investigation shown that default ssh client (C:\Windows\System32\OpenSSH\ssh.exe) denies to establish ssh connection due to "bad permissions" of private key:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'C:/Users/DulN/.docker/machine/machines/default/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "C:/Users/DulN/.docker/machine/machines/default/id_rsa": bad permissions

all my attempts to _fix_ "bad permissions" using chmod were not successful
so i've decided to switch to ssh implementation shipped with Git installation:
C:\Program Files\Git\usr\bin\ssh.exe

$ where ssh
C:\Program Files\Git\usr\bin\ssh.exe
C:\Windows\System32\OpenSSH\ssh.exe

$ C:\Windows\System32\OpenSSH\ssh.exe -V
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

$ "C:\Program Files\Git\usr\bin\ssh.exe" -V
OpenSSH_8.0p1, OpenSSL 1.1.1c  28 May 2019

eventually i've switched my system PATH variable to _valid_ ssh executable and successfully recreated docker vm

@nickdul : nice workaround using ssh.exe from Git. works for me.

Was this page helpful?
0 / 5 - 0 ratings