在Windows 10上使用hyperv驱动程序创建docker机器

时间:2018-01-27 14:01:43

标签: docker-machine boot2docker

我正在尝试使用以下命令

在Windows 10上使用hyperv创建docker机器
  

docker-machine create --driver hyperv --hyperv-virtual-switch“docker   虚拟交换机“machine4

但是过程以错误结束:

  

创建计算机时出错:检测到操作系统时出错:重试次数太多   使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管理器中,主机machine4显示正在运行,我可以通过root访问权限访问shell。

1 个答案:

答案 0 :(得分:0)

尝试添加此内容:

--generic-ssh-user

如果有帮助,请告诉我......