boot2docker starting in Windows 7

2019-05-21 02:54发布

问题:

I am having issues to start boot2docker in windows 7, virtualbox 4.3.26 (installed together with boot2docker).

Here is the output

Boot2Docker-cli version: v1.6.0
Git commit: 9894ae9
2015/05/05 17:08:12 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe showvminfo boot2docker-vm --machinereadable
2015/05/05 17:08:12 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe guestproperty set boot2docker-vm /VirtualBox/GuestAdd/SharedFolders/MountPrefix /
2015/05/05 17:08:12 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe guestproperty set boot2docker-vm /VirtualBox/GuestAdd/SharedFolders/MountDir /
2015/05/05 17:08:12 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe sharedfolder add boot2docker-vm --name c/Users --hostpath C:\Users --automount
VBoxManage.exe: error: Shared folder named 'c/Users' already exists
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), component SessionMachine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "CreateSharedFolder(Bstr(name).raw(), Bstr(hostpath).raw(), fWritable, fAutoMount)" at line 1008 of file VBoxManageMisc.cpp
2015/05/05 17:08:12 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe setextradata boot2docker-vm VBoxInternal2/SharedFoldersEnableSymlinksCreate/c/Users 1
2015/05/05 17:08:12 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe startvm boot2docker-vm --type headless
Waiting for VM "boot2docker-vm" to power on...
VM "boot2docker-vm" has been successfully started.
2015/05/05 17:08:16 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe 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).Connect
ing 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 t
cp://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://loc
alhost: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:2
022 (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 (att
empt #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).Connect
ing 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 t
cp://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://loc
alhost: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:2
022 (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 (att
empt #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).Connect
ing 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 t
cp://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://loc
alhost: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:2
022 (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 (att
empt #0).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0)VM Host-only IP address:
Waiting for Docker daemon to start...
o2015/05/05 17:09:53 executing: C:\Program Files (x86)\Git\bin\ssh.exe ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 2022 -i C:\Users\zencv\.ssh\id_boot2docker docker@localhost grep tcp:// /proc/$(cat /var/run/docker.pid)/cmdline

Then it hangs..

My virtualbox config is as follows (sorry, in german):

I tried different things such as deleting the boot2docker-vm, downloading again and starting again and again. Also please note that this seems to be different from similar issues like Boot2Docker Start up fails or docker on windows not working -- in those cases, the error message explicitly mentions that the virtualization is disabled, but I do not see any such error in my output. Unfortunately, I work in a very controlled env. and I cannot use any tools that check whether virtualization is enabled or not.

回答1:

This similar boot2docker issue mentions:

It sounds like you might have a stray boot2docker-vm set up in VirtualBox -- it's probably worth trying to open the VirtualBox GUI to delete that and try:

boot2docker -v init 
boot2docker -v up

The complete reinstall process is:

docker cask remove virtualbox
docker cask install virtualbox
boot2docker delete
boot2docker init
boot2docker up

Also check if you have a %HOME% environment variable defined:

The problem was my SSH Config. When it try to connect to boot2docker vm, it use my github private key and not the boot2docker private key.

I confirm it works perfectly. Just changing %HOME%/.ssh/config
I added:

Host boot2docker
  Hostname localhost
  IdentityFile ~/.ssh/id_boot2docker