【发布时间】:2018-01-27 14:01:42
【问题描述】:
我正在尝试使用以下命令在 Windows 10 上使用 hyperv 创建 docker 机器
docker-machine create --driver hyperv --hyperv-virtual-switch "docker 虚拟交换机”机器4
但过程以错误结束:
错误创建机器:错误检测操作系统:等待重试次数过多 SSH 可用。最后一个错误:最大重试次数 (60) 超过
完整的控制台如下:
C:\WINDOWS\system32>docker-machine create --driver hyperv --hyperv-virtual-switch "docker Virtual Switch" machine4
Running pre-create checks...
Creating machine...
(machine4) Copying C:\Users\Manish Kumar\.docker\machine\cache\boot2docker.iso to C:\Users\Manish Kumar\.docker\machine\
machines\machine4\boot2docker.iso...
(machine4) Creating SSH key...
(machine4) Creating VM...
(machine4) Using switch "docker Virtual Switch"
(machine4) Creating VHD
(machine4) Starting VM...
(machine4) 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...
Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded
调试信息如下:
Getting to WaitForSSH function...
(machine4) Calling .GetSSHHostname
(machine4) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Get-VM machine4 ).state
(machine4) DBG | [stdout =====>] : Running
(machine4) DBG |
(machine4) DBG | [stderr =====>] :
(machine4) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (( Get-VM machine4 ).networkadapters[0]).ipaddresses[0]
(machine4) DBG | [stdout =====>] : 192.160.1.100
(machine4) DBG |
(machine4) DBG | [stderr =====>] :
(machine4) Calling .GetSSHPort
(machine4) Calling .GetSSHKeyPath
(machine4) Calling .GetSSHKeyPath
(machine4) Calling .GetSSHUsername
Using SSH client type: external
&{[-F /dev/null -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@192.160.1.100 -o IdentitiesOnly=yes -i C:\Users\Manish Kumar\.docker\machine\machines\machine4\id_rsa -p 22] C:\WINDOWS\System32\OpenSSH\ssh.exe <nil>}
About to run SSH command:
exit 0
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : ssh command error:
command : exit 0
err : exit status 255
output :
在 Hyper-V 管理器中,Host machine4 显示正在运行,我可以使用 root 访问权限访问 shell。
【问题讨论】:
-
您是否在管理员模式\Powershell 中运行了该命令?
-
是的,我以管理员身份尝试过使用 power shell 和 cmd。
标签: docker-machine boot2docker