boot2docker / osx-installer

Docker installer for Mac OS X
Apache License 2.0
1.25k stars 258 forks source link

boot2docker start = long time #94

Closed rdpanek closed 6 years ago

rdpanek commented 9 years ago

Hi, I have problem with start boot2docker-vm.

boot2docker version
Boot2Docker-cli version: v1.3.2
Git commit: e41a9ae

VirtualBox: 4.3.20 OSX http://d.pr/i/1dVCR

And, when start:

boot2docker start -v
Boot2Docker-cli version: v1.3.2
Git commit: e41a9ae
2014/12/15 12:53:30 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/15 12:53:30 executing: VBoxManage guestproperty set boot2docker-vm /VirtualBox/GuestAdd/SharedFolders/MountPrefix /
2014/12/15 12:53:30 executing: VBoxManage guestproperty set boot2docker-vm /VirtualBox/GuestAdd/SharedFolders/MountDir /
2014/12/15 12:53:30 executing: VBoxManage sharedfolder add boot2docker-vm --name Users --hostpath /Users --automount
VBoxManage: error: Shared folder named 'Users' already exists
VBoxManage: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "CreateSharedFolder(Bstr(name).raw(), Bstr(hostpath).raw(), fWritable, fAutoMount)" at line 1009 of file VBoxManageMisc.cpp
2014/12/15 12:53:30 executing: VBoxManage setextradata boot2docker-vm VBoxInternal2/SharedFoldersEnableSymlinksCreate/Users 1
2014/12/15 12:53:30 executing: VBoxManage startvm boot2docker-vm --type headless
Waiting for VM "boot2docker-vm" to power on...
VM "boot2docker-vm" has been successfully started.
2014/12/15 12:53:30 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).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).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).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).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).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).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).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).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).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).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).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0)
...
...

during booting: http://d.pr/i/16JbJ and don't boot. Where's problem? Thx

Stellaverse commented 9 years ago

I'm having the exact same problem. I've posted to SO here: http://stackoverflow.com/questions/27614056/osx-boot2docker-hangs-on-waiting-for-vm-and-docker-daemon-to-start

rdpanek commented 9 years ago

I resolved problem fully uninstall Docker and Virtualbox and install again.

Stellaverse commented 9 years ago

Glad to hear that. I've done two full uninstall/reinstalls with no luck.

rdpanek commented 9 years ago

Your version of OSX is 10.8.5, my is 10.10.1. You can use all information from this page for successfull uninstalling? http://therealmarv.com/blog/how-to-fully-uninstall-the-offical-docker-os-x-installation/

Stellaverse commented 9 years ago

Just uninstalled everything again following the instructions above. Still no luck. Cursed I am.

paulp commented 9 years ago

I was experiencing this problem and tracked it down to ssh issues: world-readable permissions on ~/.ssh/id_boot2docker. Unfortunately even when running boot2docker with -v, it passes ssh "-o LogLevel=quiet" which prevents the relevant error from ever being printed. It would look like

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/paulp/.ssh/id_boot2docker' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /Users/paulp/.ssh/id_boot2docker
Permission denied (publickey,password,keyboard-interactive).

So in my case the fix for this was

chmod 0600 ~/.ssh/id_boot2docker
paulp commented 9 years ago

Also, because that's not the only possible ssh problem and all errors are likely invisible, a more general diagnostic is to run the ssh command yourself the same way it is failing but without -o LogLevel=quiet.

/usr/bin/ssh -o IdentitiesOnly=yes \
  -o StrictHostKeyChecking=no \
  -o UserKnownHostsFile=/dev/null \
  -p 2022 -i ~/.ssh/id_boot2docker docker@localhost pwd
SvenDowideit commented 9 years ago

very odd - I was sure that we saved those files with 0600

perhaps we should explicitly check the permissions and error out.. (in the cli)

paulp commented 9 years ago

I don't know in what ways you're handling those files, but in my experience the way these permissions often get hosed is by way of git, which will turn an 0600 into 0644 without a twinge of regret.

The main thing is not to lose the error output, especially when logging has been explicitly increased. I advise against trying to reproduce the permissions check because you won't do it with full fidelity and you're just duplicating ssh logic. If people can hear it complain, they'll figure out where the problem is.

Stellaverse commented 9 years ago

Well, I crossed my eyes and sneezed and it just started working.

Altogether, I performed 6 full uninstall/reinstall dances and threw a sudo in there somewhere and it worked on a try when I was pretty sure it would fail again.

I did follow paulp's advice about ensuring the permissions on the id_boot2docker key were set to the required 0600, but the attempt that followed immediately after that change didn't work, but then it worked a couple tries down the road.

Wish I could be more helpful. Thanks for all the helpful suggestions.

SvenDowideit commented 9 years ago

argh!

Stellaverse commented 9 years ago

I hear ya.

jamshid commented 9 years ago

FWIW I was seeing the original problem in this issue, started soon after a recent "brew update". My boot2docker vm might have exited abnormally (eg out of memory), not sure.

Fortunately the below error went away after I installed the latest VirtualBox 4.3.20.

$ boot2docker start -v
Boot2Docker-cli version: v1.4.1
Git commit: 43241cb
2015/01/03 14:14:46 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2015/01/03 14:14:47 executing: VBoxManage guestproperty set boot2docker-vm /VirtualBox/GuestAdd/SharedFolders/MountPrefix /
2015/01/03 14:14:47 executing: VBoxManage guestproperty set boot2docker-vm /VirtualBox/GuestAdd/SharedFolders/MountDir /
2015/01/03 14:14:47 executing: VBoxManage sharedfolder add boot2docker-vm --name Users --hostpath /Users --automount
VBoxManage: error: Shared folder named 'Users' already exists
VBoxManage: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "CreateSharedFolder(Bstr(name).raw(), Bstr(hostpath).raw(), fWritable, fAutoMount)" at line 1009 of file VBoxManageMisc.cpp
2015/01/03 14:14:47 executing: VBoxManage setextradata boot2docker-vm VBoxInternal2/SharedFoldersEnableSymlinksCreate/Users 1
2015/01/03 14:14:47 executing: VBoxManage startvm boot2docker-vm --type headless
Waiting for VM "boot2docker-vm" to power on...
VBoxManage: error: Nonexistent host networking interface, name 'vboxnet1' (VERR_INTERNAL_ERROR)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Console, interface IConsole
2015/01/03 14:14:47 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
error in run: Failed to start machine "boot2docker-vm" (run again with -v for details)
SvenDowideit commented 9 years ago

ok, and the b2d installer comes with

ENV VBOX_VERSION 4.3.20
ENV VBOX_REV 96996

(yes, using brew seems to give more problems, as it doesn't bundle everything together)

Jerry49Taylor commented 9 years ago

Any idea why boot2docker on Mac has added in an 'ssh' to the command in up?

2015/04/16 18:00:14 executing: /usr/bin/ssh ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 2022 -i /Volumes/Users/jeremy/.ssh/id_boot2docker docker@localhost grep tcp:// /proc/$(cat /var/run/docker.pid)/cmdline

Boot2Docker-cli version: v1.5.0 Git commit: ccd9032

tianon commented 6 years ago

Sorry, this repository is long-since deprecated in favor of Docker Toolbox (whose usage is now also discouraged in favor of Docker for Windows and Docker for Mac).