2

I'm running on Mac OS X 10.6.8 Snow Leopard. FYI: I can't upgrade my OS so that is not an option for me right now.

So, I install boot2docker and when I go click on the icon I receive the following output:

username@My-Mac:~$ bash
username@My-Mac:~$ unset DYLD_LIBRARY_PATH ; unset LD_LIBRARY_PATH
username@My-Mac:~$ mkdir -p ~/.boot2docker
username@My-Mac:~$ if [ ! -f ~/.boot2docker/boot2docker.iso ]; then cp    /usr/local/share/boot2docker/boot2docker.iso ~/.boot2docker/ ; fi
username@My-Mac:~$ /usr/local/bin/boot2docker init 
/usr/local/bin/boot2docker up 
$(/usr/local/bin/boot2docker shellinit)
docker version
error in run: Failed to initialize machine "boot2docker-vm": exit status 1
username@My-Mac:~$ /usr/local/bin/boot2docker up 
error in run: Failed to get machine "boot2docker-vm": machine does not exist (Did you run `boot2docker init`?)
username@My-Mac:~$ $(/usr/local/bin/boot2docker shellinit)
error in run: Failed to get machine "boot2docker-vm": machine does not exist (Did you run `boot2docker init`?)
username@My-Mac:~$ docker version
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 4749651
OS/Arch (client): darwin/amd64
FATA[0000] Get http:///var/run/docker.sock/v1.18/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 
username@My-Mac:~$ 

What does this mean? How can I fix this?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
  • How are you installing boot2docker? Have you tried https://kitematic.com/ ? – Nathaniel Waisbrot Apr 22 '15 at 12:34
  • @Nathaniel Waisbrot - Thanks for the tip but no go. Kinematic doesn't seem to work on any OS X previous to 10.8. I have 10.6 and cannot upgrade for various technical and time constraint reasons so it's not really a solution in my case, but thanks anyways. – Ismael Rivera Apr 22 '15 at 21:32

3 Answers3

2

I ran into the same issue. You need to set the environment variables in your shell. Run the following:

eval "$(boot2docker shellinit)"

Since it is only persistent per shell you'll need to add it to your ~/.bashrc, ~/.bash_profile, .zshrc, or whatever other shell profile you need it to run in.

Here is a good example of a plist for auto starting boot2docker. You'll have to modify the plist so the working directory matches yours. https://gist.github.com/krak3n/0f7fe4c3c5828767ec5b

I've installed Kitematic (Version 0.5.19 which is Beta as of this writing) as well as boot2docker on my system. Kitematic does not install a plist for auto starting your boot2docker instance. It boots when you start Kitematic. It most likely shuts it down on close which means your containers that are running will shutdown as well.

Ultimately it is up to how you want to setup and run your environment. If you're going only boot2docker and docker CLI and want things running at boot, create the plist and set your .bash_profile/.zshrc. If you want a GUI and CLI option that only boots and runs when you want it to then Kitematic is the way to go.

bacrossland
  • 146
  • 3
  • This is what I get when I run the eval: "error in run: Failed to get machine "boot2docker-vm": machine does not exist (Did you run `boot2docker init`?)" Btw, when I run boot2docker init I get the following output: "error in run: Failed to initialize machine "boot2docker-vm": exit status 1". You said "set the environment variables..." Set them to what? This here is what my PATH variable looks like: export PATH="/usr/local/bin:/usr/bin:/usr/local:/usr/local/git/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin" – Ismael Rivera Apr 22 '15 at 21:22
  • This here is what my PATH variable looks like: – Ismael Rivera Apr 22 '15 at 21:26
2

The answer above is correct, but you don't need the eval, you can just use:

$(boot2docker shellinit)

You can put this in your .profile

echo '$(boot2docker shellinit)' >> ~/.profile

and then it is setup every time you create a new shell.

This might be a duplicate of a previous question I answered:

Docker TLS error on Mac

Community
  • 1
  • 1
Greg
  • 6,571
  • 2
  • 27
  • 39
  • I tried it without eval, like you suggested, and I got the same output as I did using eval below: "error in run: Failed to get machine "boot2docker-vm": machine does not exist (Did you run `boot2docker init`?)" – Ismael Rivera Apr 22 '15 at 21:25
  • Worked for me. OS X 10.9.5, boot2docker 1.6.0 installed from the official package. – Josh Hansen May 06 '15 at 21:47
1

After much hassle and delegation I was able to finally figure out what was going on. It was xanderlopez in this post that got me to realize that the problem lied with my shared folder and virtual machine folder locations for VitualBox. After changing the shared folder and renaming the location for the VM to "VirtualBox VMs", once I reinstalled boot2docker, everything ran as was supposed to and the hello world verification succeeded. So that's a gotcha right there. The location of your vm must be inside a folder named "VirtualBox VMs". The location seems to be unimportant as I just created a subfolder folder inside the folder that I was already using. Not sure how that works but it seems to have worked which is good enough for this issue. If I see any problems up ahead later related to the folder structure I'll be sure to reference this post.

Community
  • 1
  • 1