Windows 10 x64 (version 1511, build 10586.63)
> docker-machine --version
docker-machine.exe version 0.6.0, build e27fb87
the machine appears to being creating ok, but then I see a series of retried ssh connections ending in failure:
> docker-machine -D create --driver=hyperv test
...
Getting to WaitForSSH function...
(test) Calling .GetSSHHostname
(test) DBG | [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\\powershell.exe -NoProfile -NonInteractive ( Get-VM test ).state
(test) DBG | [stdout =====>] : Running
(test) DBG |
(test) DBG | [stderr =====>] :
(test) DBG | [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\\powershell.exe -NoProfile -NonInteractive (( Get-VM test ).networkadapters[0]).ipaddresses[0]
(test) DBG | [stdout =====>] : fe80::215:5dff:fefa:692a
(test) DBG |
(test) Calling .GetSSHPort
(test) DBG | [stderr =====>] :
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHKeyPath
(test) Calling .GetSSHUsername
Using SSH client type: external
{[-o BatchMode=yes -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none docker@fe80::215:5dff:fefa:692a -o IdentitiesOnly=yes -i C:\Users\user\.docker\machine\machines\test\id_rsa -p 22] C:\Program Files (x86)\Git\bin\ssh.exe}
About to run SSH command:
exit 0
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : Something went wrong running an SSH command!
command : exit 0
err : exit status 255
output :
Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded
open : The system cannot find the file specified.
notifying bugsnag: [Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded]
The machine exists but with a problem:
> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
test - hyperv Running tcp://[fe80::215:5dff:fefa:692a]:2376 Unknown Unable to query docker version: Unable to read TLS config: open C:\Users\user\.docker\machine\machines\test\server.pem: The system cannot find the file specified.
And, I confirmed that C:\Users\user\.docker\machine\machines\test\server.pem
does not exist. The folder does & there's other stuff in there as expected, but no pem.
Hm, I'm not really sure it's supposed to be going to IPv6 by default. Our SSH code might not handle that exactly properly.
Struggling with the same thing. Looks like the problem is here:
Getting to WaitForSSH function...
(hyperv) Calling .GetSSHHostname
(hyperv) DBG | [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\\powershell.exe -NoProfile -NonInteractive ( Get-VM hyperv ).state
(hyperv) DBG | [stdout =====>] : Running
(hyperv) DBG |
(hyperv) DBG | [stderr =====>] :
(hyperv) DBG | [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\\powershell.exe -NoProfile -NonInteractive (( Get-VM hyperv ).networkadapters[0]).ipaddresses[0]
(hyperv) DBG | [stdout =====>] : 10.31.247.80
(hyperv) DBG |
(hyperv) Calling .GetSSHPort
(hyperv) Calling .GetSSHKeyPath
(hyperv) Calling .GetSSHKeyPath
(hyperv) DBG | [stderr =====>] :
(hyperv) Calling .GetSSHUsername
Using SSH client type: external
{[-o BatchMode=yes -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none [email protected] -o IdentitiesOnly=yes -i C:\Users\daniil.barvitsky\.docker\machine\machines\hyperv\id_rsa -p 22] C:\Program Files (x86)\Gow\bin\ssh.bat}
About to run SSH command:
exit 0
SSH cmd err, output: exit status 1: 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Error getting ssh command 'exit 0' : Something went wrong running an SSH command!
command : exit 0
err : exit status 1
output : 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Judging from error message it is the space in un-escaped C:Program Files (x86)Gowbinssh.bat path. Is there a way to make it use a different SSH? Or somehow configure the SSH command to be used?
A bit of an update - got it working on Windows 10 x64 + Hyper-V. Bruteforce hack for now - install mingw64 into a folder that does not have spaces (e.g. C:Tools) and then re-run docker -D provision
For poor souls who have to run on Windows it would be very helpful to have some sort of config file where dependent tools for docker-machine are listed and configured.
Indeed Gow is the culprit (more exactly the ssh
alias it makes which points to plink
). You could get it working by taking Gow out of your PATH
(if you can live with that) or using Git Bash instead of cmd. See also #3152
Hopefully this will be solved in docker-machine
itself. @nathanleclaire what do you think?
Hm, we probably should verify that it's actually OpenSSH we're detecting with os.LookPath("ssh")
. You should be able to use --native-ssh
to get around this in create
for now. I do think a configuration file for Machine would be nice but is a bit large in scope.
Re @nathanleclaire suggestion on --native-ssh
, that's an option for docker-machine
itself, not for the create
, this worked for me:
docker-machine --native-ssh create foo-vm --driver hyperv
[...]
docker-machine --native-ssh ssh foo-vm
where as this docker-machine create foo-vm --driver hyperv
as mentioned before goes on timeout with Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded
, and this docker-machine ssh foo-vm
gives exit status 255
.
Most helpful comment
Re @nathanleclaire suggestion on
--native-ssh
, that's an option fordocker-machine
itself, not for thecreate
, this worked for me:where as this
docker-machine create foo-vm --driver hyperv
as mentioned before goes on timeout withError creating machine: Error detecting OS: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded
, and thisdocker-machine ssh foo-vm
givesexit status 255
.