Boot2Docker for OS X fails to start

2019-04-30 03:32发布

I am new to docker and I'm attempting to run boot2docker on my work computer. I'm logged in to the computer running OS X version 10.10.1 (Yosemite) with a user account that mounts the home directory from the office network.

I installed Docker v1.4.1 from https://github.com/boot2docker/osx-installer/releases and VirtualBox 4.3.20 for OS X hosts from https://www.virtualbox.org/wiki/Downloads

I followed the instructions on docker.com mac installation but I didn't get the supposed to be results.

The docker terminal gives this error:

bash-3.2$ /usr/local/bin/boot2docker init 
Virtual machine boot2docker-vm already exists
bash-3.2$ /usr/local/bin/boot2docker up 
error in run: Failed to start machine "boot2docker-vm" (run again with -v for details)
bash-3.2$ $(/usr/local/bin/boot2docker shellinit)
error in run: VM "boot2docker-vm" is not running.
bash-3.2$ 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
FATA[0000] Get http:///var/run/docker.sock/v1.16/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 

Starting boot2docker-vm on VirtualBox returns the following error:

Failed to open a session for the virtual machine boot2docker-vm.

NamedPipe#0 failed to bind to local socket
/Network/Servers/servername/Volumes/cal/Users/username/.boot2docker/boot2docker-vm.sock (VERR_NOT_SUPPORTED)

8条回答
Summer. ? 凉城
2楼-- · 2019-04-30 03:54

Here's my experience...

At home I have a Macbook Air, and at work I have a Macbook Pro.

I was having the same issues on both. If I ran from command line, I would get something about "VBOX_E_OBJECT_IN_USE". And if I ran from Virtual Box UI, I would get something about "VMMR0.r0".

I tried almost everything...reinstalling VBX, B2D, etc. To no avail.

Then finally, on the MBA, I tried Usman's suggestions and that fixed it.

But that didn't work on my MBP.

For the MBP, I had to Repair My Disk Permissions with Disk Utility.

(Thanks to mpwin for the suggestion in this thread: https://github.com/boot2docker/windows-installer/issues/63)

Now, both machines work. Hopefully, this helps someone else.

查看更多
爷的心禁止访问
3楼-- · 2019-04-30 03:59

A combination of couple of answers helped me to resolve the issue:

As Usman Ismail said, run the following:

boot2docker delete
boot2docker download
boot2docker init
boot2docker up

And then run:

$(boot2docker shellinit)

That worked.

查看更多
劫难
4楼-- · 2019-04-30 04:00

Add your configs to your bash:

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

then open a new terminal window or source the file.

查看更多
Ridiculous、
5楼-- · 2019-04-30 04:07

I get the same error if I restart my MBP and allow iTerm2 to start automatically with previous tabs open. I've found that restarting iTerm2 solves it for me.

查看更多
【Aperson】
6楼-- · 2019-04-30 04:10

Finally, this solution worked for me. I have to move the VirtualBox VMs folder from my network home directory to my local machine and change their permissions.

So on my VirtualBox GUI, under Settings>Storage, I changed the file locations from

/Network/Servers/servername/Volumes/cal/Users/username/VirtualBox VMs/boot2docker.iso
/Network/Servers/servername/Volumes/cal/Users/username/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vmdk

to

/Applications/VirtualBox VMs/boot2docker.iso
/Applications/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vmdk

and under the Settings>Ports

from

/Network/Servers/servername/Volumes/cal/Users/username/VirtualBox VMs/boot2docker-vm.sock

to

/Applications/VirtualBox VMs/boot2docker-vm.sock

So I think it’s a directory and permission issue.

查看更多
一夜七次
7楼-- · 2019-04-30 04:14

Try the following: Some people have reported problems starting suspended boot2docker VM's the steps below have normally fixed the issue for me.

boot2docker delete
boot2docker download
boot2docker init
boot2docker up

If this does not work Open the Virtual box and see the status of the boot2docker vm. If it says saved, then start the VM from the UI and then send it the shutdown signal from the menu. You should then be able to start and stop the VM from boot2docker subsequently.

查看更多
登录 后发表回答