无法在Docker中创建虚拟机

5

我刚刚在我的Windows 7机器上安装了Docker。当我启动Docker QuickStart时,我遇到了以下错误,似乎是在创建机器时出现的:

Creating machine...
(default) Unable to get the latest Boot2Docker ISO release version:  Get https:/
/api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp 192.30.2
52.124:443: connectex: A connection attempt failed because the connected party d
id not properly respond after a period of time, or established connection failed
 because connected host has failed to respond.
(default) Copying C:\Users\robot\.docker\machine\cache\boot2docker.iso to C:\Use
rs\robot\.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
Error attempting heartbeat call to plugin server: read tcp 127.0.0.1:60733->127.
0.0.1:60732: wsarecv: An existing connection was forcibly closed by the remote h
ost.
Error attempting heartbeat call to plugin server: connection is shut down
Error attempting heartbeat call to plugin server: connection is shut down
Error attempting heartbeat call to plugin server: connection is shut down
Error attempting heartbeat call to plugin server: connection is shut down
Error creating machine: Error in driver during machine creation: read tcp 127.0.
0.1:60733->127.0.0.1:60732: wsarecv: An existing connection was forcibly closed
by the remote host.
Looks like something went wrong... Press any key to continue...

我在Win-7 64位系统中发现了相同的问题:它开始运行(1)预创建检查...,(2)创建机器...,(3)创建VirtualBox虚拟机...,(4)创建SSH密钥...,(5)启动虚拟机...,(6)检查网络以重新创建(如果需要)...然后出现错误->“创建机器时出错:在创建机器期间驱动程序出错:无法启动虚拟机:退出状态1”。 - IRSHAD
2个回答

3

docker/machine/issues/2773中存在类似问题。

尝试自己创建一个机器,而不是使用快速启动,看看问题是否仍然存在:

找到docker-machine.exe的安装位置(或将最新版本复制到您的%PATH%),并在常规CMD会话中使用它:

首先测试现有机器:

# find the name of the machine created.
docker-machine ls
docker-machine env --shell cmd <nameOfTheMachine>
docker machine ssh <nameOfTheMachine>

然后尝试创建一个新的:
docker-machine create -d virtualbox <aNewMachine>
docker-machine env --shell cmd <aNewMachine>
docker machine ssh <aNewMachine>

我也尝试从 cmd 创建机器,但问题仍然存在。docker-machine.exe 路径已经在 %PATH% 中。docker-machine ls 列出了我尝试创建的机器,它们都处于错误状态,并带有描述 - "机器不存在"。 - Ayush
@Napstar docker-machine版本返回什么?您是否在两种情况下看到与问题中相同的错误? - VonC
Docker 版本 1.9.1 docker-machine 版本 0.5.5 - Ayush

1
我没有解决方案,但找到了根本原因。
我安装了boot2docker并使用了几个月。一直在同一个文件夹中创建所有vbox镜像。有一天我决定归档我的机器,并更改了我用来创建vbox镜像的文件夹。它开始出现奇怪的错误。我恢复了我的归档并再次测试。它开始正常工作。
我发现两个设置的区别是,在归档文件夹中,它跳过了ca证书创建步骤并直接创建了机器。在新文件夹中,它会创建证书,然后再创建机器。看起来服务器不喜欢新的证书!

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接