OSX boot2docker挂起“正在等待VM和Docker守护程序启动…". [英] OSX boot2docker hangs on "Waiting for VM and Docker daemon to start …"

查看:57
本文介绍了OSX boot2docker挂起“正在等待VM和Docker守护程序启动…".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在OSX 10.8.5上安装了boot2docker,似乎安装正常,但是当我尝试启动boot2docker时,我得到了以下内容,该内容会无限期挂起:

I've installed boot2docker on OSX 10.8.5 and it seems that the installation went fine, but when I try to launch boot2docker I get the following, which hangs indefinitely:

$ /usr/local/bin/boot2docker up 
Waiting for VM and Docker daemon to start...
..........................................................................oooooooooooooooooooooooooooooo

我应该采取哪些步骤进行调试?我无法找到有关此特定问题的任何信息.

What steps should I take to debug this? I haven't been able to find any information on this particular issue.

$ boot2docker version
Boot2Docker-cli version: v1.4.1
Git commit: 43241cb

$ docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8
OS/Arch (client): darwin/amd64

$ boot2docker -v up
Boot2Docker-cli version: v1.4.1
Git commit: 43241cb
2014/12/23 00:19:25 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 00:19:25 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 00:19:25 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
Waiting for VM and Docker daemon to start...
.Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).^C


在我的~/.bash_profile文件中:

export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH=/Users/Me/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1


当我打开VirtualBox时,这是我看到的:

When I open VirtualBox, this what I see:


我已经使用Virtual Box GUI尝试了powering offremoving boot2docker-vm,当我再次运行boot2docker时得到以下信息:


I've tried powering off and removing the boot2docker-vm using the Virtual Box GUI, and I get the following when I run boot2docker again:

$ /usr/local/bin/boot2docker init 
error in run: Failed to initialize machine "boot2docker-vm": exit status 2

然后:

$ /usr/local/bin/boot2docker up 
Waiting for VM and Docker daemon to start...
...............................................................…..

哪个挂不完.


另外

$ docker ps
FATA[0000] Couldn't read ca cert /Users/Me/.boot2docker/certs/boot2docker-vm/ca.pem: open /Users/Me/.boot2docker/certs/boot2docker-vm/ca.pem: no such file or directory

并且:

$ sudo docker ps
FATA[0000] Get http:///var/run/docker.sock/v1.16/containers/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?


按照下面Sven的建议,再次删除boot2docker-vm并以详细模式运行init:

Following Sven's advice below deleted the boot2docker-vm again and run init in verbose mode:

    $ boot2docker -v init
Boot2Docker-cli version: v1.4.1
Git commit: 43241cb
2014/12/23 01:53:02 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 01:53:02 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 01:53:03 executing: VBoxManage list vms
2014/12/23 01:53:03 executing: VBoxManage createvm --name boot2docker-vm --register
Virtual machine 'boot2docker-vm' is created and registered.
UUID: eca00a0a-6d68-45f3-acd1-ccc4dd1bcec9
Settings file: '/Users/Me/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox'
2014/12/23 01:53:03 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 01:53:03 executing: VBoxManage setextradata boot2docker-vm VBoxInternal/CPUM/EnableHVP 1
2014/12/23 01:53:03 executing: VBoxManage modifyvm boot2docker-vm --firmware bios --bioslogofadein off --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --natdnshostresolver1 off --natdnsproxy1 off --ostype Linux26_64 --cpus 8 --memory 2048 --vram 8 --acpi on --ioapic on --rtcuseutc on --cpuhotplug off --pae on --longmode on --synthcpu off --hpet on --hwvirtex on --triplefaultreset off --nestedpaging on --largepages on --vtxvpid on --vtxux off --accelerate3d off --uart1 0x3F8 4 --uartmode1 server /Users/AJB/.boot2docker/boot2docker-vm.sock --boot1 dvd
2014/12/23 01:53:03 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 01:53:03 executing: VBoxManage modifyvm boot2docker-vm --nic1 nat --nictype1 virtio --cableconnected1 on
2014/12/23 01:53:03 executing: VBoxManage controlvm boot2docker-vm natpf1 ssh,tcp,127.0.0.1,2022,,22
2014/12/23 01:53:03 executing: VBoxManage list hostonlyifs
2014/12/23 01:53:03 executing: VBoxManage list dhcpservers
2014/12/23 01:53:03 executing: VBoxManage hostonlyif create
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
2014/12/23 01:53:03 executing: VBoxManage hostonlyif ipconfig dyld: DYLD_ environment variables being ignored because main executable (/Applications/VirtualBox.app/Contents/MacOS/VBoxNetAdp --ip 192.168.59.3 --netmask 255.255.255.0
VBoxManage: error: The host network interface with the given name could not be found
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component Host, interface IHost, callee nsISupports
VBoxManage: error: Context: "FindHostNetworkInterfaceByName(name.raw(), hif.asOutParam())" at line 218 of file VBoxManageHostonly.cpp
VBoxManage: error: Could not find interface 'dyld: DYLD_ environment variables being ignored because main executable (/Applications/VirtualBox.app/Contents/MacOS/VBoxNetAdp'
error in run: Failed to initialize machine "boot2docker-vm": exit status 2


在此先感谢您的帮助.

推荐答案

我在OSX Yosemite上遇到了相同的问题,必须执行以下操作:

I run into same problem on OSX Yosemite and have to do the following:

1)用docker清理东西

1) clean stuff with docker

  • boot2docker delete- 警告::这会删除您所有的docker镜像.
  • 在Virtualbox中,转到VirtualBox(菜单)=> 首选项=>网络=>仅主机网络
    • 删除仅主机的网络,然后我重新添加了它们
    • boot2docker delete - Warning: this deletes all your docker images.
    • In Virtualbox, go to VirtualBox (menu) => Preferences => Network => Host Only Networks
      • Delete the host only networks, then I re-added them

      2)非常重要,您很可能会丢失有关环境变量的信息,就像他们所说的那样:

      2) very important, and you probabbly are missing it dealing with environmental variables, as they say:

      To connect the Docker client to the Docker daemon, please set:
          export DOCKER_HOST=tcp://192.168.59.103:2376
          export DOCKER_CERT_PATH=/Users/andi/.boot2docker/certs/boot2docker-vm
          export DOCKER_TLS_VERIFY=1
      

      对于您来说,第二个导出命令将因用户名而有所不同-不是andi,而是其他.只需复制粘贴,然后按Enter键即可应用此env变量,然后运行例如docker ps来检查是否认为工作正常.

      For you the second export command will differ by user name - not andi, but something else. Just copy paste, and hit enter to apply this env variable, and then run e.g docker ps to check either thinks are working properly.

      这篇关于OSX boot2docker挂起“正在等待VM和Docker守护程序启动…".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆