相关文章推荐
热心的酱肘子  ·  Day 23:使用Docker Machine·  7 月前    · 
热心的酱肘子  ·  Install and register ...·  7 月前    · 
热心的酱肘子  ·  Configure GitLab ...·  7 月前    · 
任性的马克杯  ·  Docker(五):Docker ...·  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…

@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.

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ł.

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.

  • Delete original vm.
  • Then, edit virtual network adapter, change it from NAT.
    Recreate vm with this command, specify also virtual network adapter to avoid wrong links.
    https://docs.docker.com/machine/drivers/hyper-v/

    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!

    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

    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:

  • Install Boot2Docker for Windows -> this is an easy step.
  • 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.
  • 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.
  • 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)

    I had this issue as well. On Windows 10, I was attempting to create a new Docker machine using the hyperv driver and an external switch. Upon create, the sequence would repeatedly get stuck on “Waiting for ssh to be available…”, on both Powershell and cmd. Took the advice in this thread and ran the exact same commands in Git Bash and everything went though fine!

    My question is WHY did Git Bash work while Powershell and cmd both got hung up?

    Seconded. Running Powershell as admin, disabling firewalls, turning off my VPN, all failed. I was following Docker’s “get started” tutorial, part 3. I created one vm with all off those off using git bash (as Admin), then created another with them all turned back on, just to eliminate that variable.

    The relevant variable was the shell: Git bash > Powershell.
    For anyone stuck on “waiting for ssh to be available,” this is likely the answer

    It did word for me. The key is the permission of the id_rsa file of the created VM. Good luck!

    Or if you want to see the solution in Chinese, it’s here: https://www.jianshu.com/p/eb4641bc5c67

    I REALLY want to try out this fix but I just can’t get exactly what he is doing. Which IP address is in that ssh command he is putting on his VM? What is he doing after that on his windows machine with id_rsa permissions? What buttons is he changing? can anyone out there put this together for someone who doesn’t know a lot about it but needs his docker-machine working?