Docker Community Forums

Share and learn in the Docker community.

Docker machine stuck on "Waiting for ssh to be available..."

docker

(Vishalu) #1

Installed docker for windows on windows 10 pro. Trying to create a docker machine using the command “docker-machine create --driver hyperv dev”

docker-machine.exe version 0.8.0-rc2, build 4ca1b85

Expected behavior

docker machine is created successfully

Actual behavior

since last 30 minutes the process is stuck at “Waiting for ssh to be available…” message.

Running pre-create checks…
Creating machine…
(devhost) Copying C:\Users\Vishal\.docker\machine\cache\boot2docker.iso to C:\Users\Vishal\.docker\machine\machines\devhost\boot2docker.iso…
(devhost) Creating SSH key…
(devhost) Creating VM…
(devhost) Using switch “DockerNAT”
(devhost) Creating VHD
(devhost) Starting VM…
(devhost) Waiting for host to start…
Waiting for machine to be running, this may take a few minutes…
Detecting operating system of created instance…
Waiting for SSH to be available…


Docker-machine fails to crate SSH connection to new VM
(Michael Friis) #2

Are you doing this in an Administrator powershell prompt? That’s required for the hyper-v driver to work. I’ve successfully created hyper-v boot2docker machines alongside Docker for Windows.


(Vishalu) #3

@friism yes i was running as an administrator. While going through the other questions on the forum i came across your reply Using Docker for Window’s docker-machine create. I created an external switch and it did create the machine successfully. Not sure why doesn’t it work with “DockerNAT” switch.


(4tran) #4

Hi I have similar problem to @vishalu. I have also installed docker on windows 10 pro (docker version 1.12.3, build 6b644ec).

I’ve already created virtual switch in the same way as it is described in this tutorial https://docs.docker.com/machine/drivers/hyper-v/

and when I try to create vm using following comand:
docker-machine create -d hyperv --hyperv-virtual-switch “Primary Virtual Switch” manager1

it cannot connect to vm via ssh. Any ideas what can I do more?

Waiting for machine to be running, this may take a few minutes…
(manager1) Calling .GetState
(manager1) DBG | [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Get-VM manager1 ).state
(manager1) DBG | [stdout =====>] : Running
(manager1) DBG |
Detecting operating system of created instance…
(manager1) DBG | [stderr =====>] :
Waiting for SSH to be available…
Getting to WaitForSSH function…
(manager1) Calling .GetSSHHostname
(manager1) DBG | [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Get-VM manager1 ).state
(manager1) DBG | [stdout =====>] : Running
(manager1) DBG |
(manager1) DBG | [stderr =====>] :
(manager1) DBG | [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (( Get-VM manager1 ).networkadapters[0]).ipaddresses[0]
(manager1) DBG | [stdout =====>] : 192.168.90.166
(manager1) DBG |
(manager1) Calling .GetSSHPort
(manager1) DBG | [stderr =====>] :
(manager1) Calling .GetSSHKeyPath
(manager1) Calling .GetSSHKeyPath
(manager1) Calling .GetSSHUsername
SSH binary not found, using native Go implementation
&{{{ 0 [] [] []} docker [0xc2bd70] []} 192.168.90.166 22 }
About to run SSH command:
exit 0
Error dialing TCP: dial tcp 192.168.90.166:22: connectex: Próba połączenia nie powiodła się, ponieważ połączona strona nie odpowiedziała poprawnie po ustalonym okresie czasu lub utworz
one połączenie nie powiodło się, ponieważ połączony host nie odpowiedział.


Can't generate a valid certificate. Stuck on "Waiting for SSH to be available..."
(4tran) #5

I’ve not found root cause why I cannot connect to my VM via ssh but I’ve found work around. After reading many different posts I’ve started assume that cause can be installed virtualbox. Uninstallation nothing changed, so I decided to recover my windows to the point before Virtualbox has been installed - and it helps. Now everything works great.


(Fraballi) #6

docker-machine create -d hyperv --hyperv-virtual-switch “” “”

I used the same from Docker: DockerNAT, but change the option "Connection Type"in hyper-v: “External”, take the network adapter your physical computer shows. Perhaps the virtual card provided is missconfigured or your personal antivirus/firewall client avoids properly being connected.

Luck!


(Ischyrus) #7

It was a firewall issue for me. I disabled the Windows firewall and it started working.


(Tisomaki) #8

fyi, without digging further into root cause, for me switching ssh implementation worked: changed from openssh to implementation that comes with git. OS: Win 10. docker-machine: 0.10.0. Git 2.12.2.


(Jicky) #9

docker-machine --version
docker-machine2.exe version 0.13.0, build 9ba6da9

docker-machine create
ssh key is OpenSSH SSH2 private key (old PEM format)

putty
Unable to use key file “C:\Users\jicky.docker\machine\machines\myvm2\id_rsa” (OpenSSH SSH-2 private key (old PEM format))

ssh -i C:\Users\jicky.docker\machine\machines\myvm1\id_rsa docker@192.168.1.145
key_load_public: invalid format
Unable to negotiate with 192.168.1.145 port 22: no matching host key type found. Their offer: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256


(Bloessdocker) #10

Problem: “Waiting for ssh to be available …” message

A connection between IntelliJ and Boot2Docker is not possible.

In the Windows world, however, there are some peculiarities to consider, which I have not found explicitly described.

Here is my solution:

  1. Install Boot2Docker for Windows -> this is an easy step.
  2. Then install / create a VM (based on boot2docker.iso) with docker-machine create --driver hyperv vm-docker-machine-01
    Of course, HyperV must be activated.
    The installation / process will hang with a “Waiting for ssh to be available …” message.
  3. Uninstall OpenSSH for Windows Beta, otherwise abort the creation of the virtual machine with o.g. Error.
    Settings -> Apps -> optional features
    Then the command docker-machine create --driver hyperv vm-docker-machine-01 runs smoothly
    and a connection between IntelliJ and Boot2Docker can be established.

(Davehowson) #11

I had the same issue and I solved it using GIT Bash to run the command to create the virtual machine.


(Broniusjanonis) #12

It worked for me as well:
User HyperV
Ran Git-Bash as Administrator
used command docker-machine create -d hyperv --hyperv-virtual-switch “DockerNAT” node1 (in HyperV Manager I set DockerNAT as external network)

Previously I was receiving with PowerShell Waiting for host to start... and on some HyperV configurations was stuck on Waiting for SSH to be available...

Note: Sometimes on Git-Bash it does not create node and stucks, then I reswitch between private and external networks and it unstucks (figures)