Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker stuck on "Waiting for SSH to be available..."

I'm using a docker with Windows and Hyper-v to create containers. I've added a docker machine vmachine to my docker configuration. First time the machine is created, it gets an IP (although I cannot manage nginx to access it - ERR_CONNECTION_REFUSED) and finishes the bootup.

When I turn off the machine and then try to boot it, i get stuck in this message

Waiting for SSH to be available...

And it doesn't evolve from there. The machine is booted, however, I get an IPv6 when I input the command docker-machine ip vmachine like - fe80::215:5dff:fe21:10b insted of a IPv4

What am I doing wrong?

like image 354
João Dias Avatar asked Nov 02 '16 23:11

João Dias


5 Answers

Problem here is by default docker uses DockerNAT network switch. You should create a new external network switch instead. This issue is covered here and here. You can create an external network switch using the below command

docker-machine create -d hyperv --hyperv-virtual-switch external-switch tempbox1

or you can create one through the UI

external network switch

Be sure to reboot the device after creating the external switch.

like image 56
Penkey Suresh Avatar answered Nov 11 '22 22:11

Penkey Suresh


I had a similar issue and non of the solutions worked. Turns out that according to this answer, docker launches SSH with Unix specific elements. This is said to have been fixed in the releases that followed, but I still encountered the 'Waiting for SSH' issue. I resolved this by simply using GIT bash to run all docker related SSH commands.

like image 36
Dave Howson Avatar answered Nov 12 '22 00:11

Dave Howson


Use the switch --native-ssh

for example docker-machine --native-ssh .... Get more details from here

like image 2
craftsmannadeem Avatar answered Nov 11 '22 22:11

craftsmannadeem


docker-machine.exe -debug create --driver hyperv --hyperv-virtual-switch "External Virtual Switch" --hyperv-cpu-count "1" --hyperv-memory "1024" --hyperv-disk-size "20000" mydockervm

make sure to have additional VirtualSwitch configure , with external network driver selected , Uninstall virtualbox

Use the debug switch to see the exact error , for me it was not able to allocate memory.

like image 1
Subrata Fouzdar Avatar answered Nov 12 '22 00:11

Subrata Fouzdar


Here's what's solved it for me.

Turns out Windows 10 starting version 1709 has a built in SSH client at C:\Windows\System32\OpenSSH. Here's an article discussing it.

Looks like docker is using that SSH implementation and it's not compatible. I didn't look for a proper way to remove the built-in SSH implementatino in Windows 10, and simply renamed the folder. That was enough to fix it for me.

like image 1
Alon Catz Avatar answered Nov 11 '22 23:11

Alon Catz