Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

VirtualBox Guest Additions - #534

Merged
tianon merged 2 commits into
boot2docker:masterfrom
tianon:vbox-guest-additions
Sep 15, 2014
Merged

tianon merged 2 commits into
boot2docker:masterfrom
tianon:vbox-guest-additions

Conversation

@tianon

@tianon tianon commented Sep 11, 2014

Copy link
Copy Markdown
Contributor

To provide some context about why this is being reintroduced despite so many expressed reservations, "boot2docker" currently is essentially the "Docker daemon for Mac OS / Windows". On Mac OS at least, where we have a native Docker client, the experience of talking to your "Docker daemon" currently lacks the ability to bind mount files, which causes a lot of problems including fig not working as it should. This is being pushed as a simple stopgap solution to that specific problem while other more sustainable solutions are developed in Docker itself (such as is proposed in moby/moby#7249).

This builds upon the work in #284. Also, this includes a hacky init script that @bfirsh gets to take all the credit for that tries to mount /Users and/or /c/Users, since we can't run VBoxService proper (thanks to hairy issues with 32bit userspace of TCL; good times). The init script will bail quickly and quietly on non-VirtualBox machines or on VirtualBox machines that don't have one of those two shares.

This has been tested on Linux, Mac OS X, and Windows.

If you'd like to test it out without any changes to boot2docker-cli, use:

This will make it so that things like docker run -v "$(pwd)":/some/container/path ... work as you'd expect from Mac OS, and also so that the /Users or /c/Users directory is available for easy access when you boot2docker ssh into your VM.

As a side note, if anyone has ideas for how to disable or prevent that msys path conversion from happening without linking against msys.dll, please please please let me know (I can't find anything useful).

@sfitts

sfitts commented Sep 11, 2014

Copy link
Copy Markdown

I've run into the msys auto-conversion thing myself and the only thing I've found is that if you add an extra / to the path it should prevent the conversion (though you end up with both slashes, so sometimes that doesn't really help). Not sure if trick will work here, but it might be worth a shot (I'll try it out myself at some point, but that won't be for a bit due to other work priorities).

Oh -- and thanks for resurrecting this. I know it is controversial, but it really does make life for those of us working on Windows a lot nicer (the lack of a native Docker client there gives us a few more issues than our Mac brethren).

@tianon
tianon force-pushed the vbox-guest-additions branch from d62fb7c to 3998f22 Compare September 11, 2014 23:41
@SvenDowideit

Copy link
Copy Markdown
Contributor

Where's the Documentation?

@tianon

tianon commented Sep 11, 2014

Copy link
Copy Markdown
Contributor Author

Fair point - I'll write up something. 👍

Comment thread Dockerfile Outdated

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@tianon
tianon force-pushed the vbox-guest-additions branch from 3998f22 to 341c434 Compare September 12, 2014 00:27
@dduportal

Copy link
Copy Markdown
Contributor

That's a good job !

One point to (maybe?) help you : while it's perfectly working with vagrant (see my custom vagrant image, based on the previous work - http://vagrantup.com/dduportal/boot2docker), we should throw an eye on how vagrant did it on Windows ?

@tianon
tianon force-pushed the vbox-guest-additions branch from 341c434 to 09d749b Compare September 12, 2014 21:49
@tianon

tianon commented Sep 12, 2014

Copy link
Copy Markdown
Contributor Author

Just as an update, I was dealing with some ill family today. I've updated the technical bits here, but hope to get some docs done tomorrow.

@tianon
tianon force-pushed the vbox-guest-additions branch 4 times, most recently from 8389685 to ef06a84 Compare September 13, 2014 20:34
@tianon

tianon commented Sep 13, 2014

Copy link
Copy Markdown
Contributor Author

Ok, this has some basic documentation now, too. 👍

@tianon
tianon force-pushed the vbox-guest-additions branch from ef06a84 to 34a017c Compare September 13, 2014 20:49
Comment thread README.md

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@tianon
tianon force-pushed the vbox-guest-additions branch from 34a017c to 7e0872b Compare September 14, 2014 07:28
@SvenDowideit

Copy link
Copy Markdown
Contributor

This PR is only missing some documentation to say that it does not work for Linux - even if you share /home as Users, it will then be mounted in the wrong place, and the -v $(pwd):/data will thus fail.

once that's done - LTGM

…che-ability)

Also, this includes a hacky init script that bfirsh gets to take all the credit for that tries to mount `/Users` and/or `/c/Users`, since we can't run `VBoxService` proper (thanks to hairy issues with 32bit userspace of TCL; good times).
@tianon
tianon force-pushed the vbox-guest-additions branch from 7e0872b to 1bf1671 Compare September 15, 2014 23:39
@tianon

tianon commented Sep 15, 2014

Copy link
Copy Markdown
Contributor Author

Ok, I've updated with a paragraph about the nonexistent Linux support: (copied here for easier review)

In case it isn't already clear, the Linux host support here is currently hazy.
You can share your /home or /home/jsmith directory as Users or one of the
other supported automount locations listed above, but note that you will then
need to manually convert your docker run -v /home/...:... bind-mount host
paths accordingly (ie, docker run -v /Users/...:...). As noted in the
previous paragraph however, this is likely to change in the future as soon as a
more suitable/scalable solution is found and implemented.

@SvenDowideit

Copy link
Copy Markdown
Contributor

LGTM - will there be a b2d-cli PR to set these up?

@tianon

tianon commented Sep 15, 2014

Copy link
Copy Markdown
Contributor Author

Yeah, that's the plan - I've been working on that on the side while this one got some review. 😄

tianon added a commit that referenced this pull request Sep 15, 2014
@bfirsh

bfirsh commented Sep 25, 2014

Copy link
Copy Markdown
Contributor

UI is here: boot2docker/boot2docker-cli#258

This will be in the next official release.

@razic

razic commented Sep 28, 2014

Copy link
Copy Markdown

Wow this actually made it in?

@stevepereira

Copy link
Copy Markdown

Is this release waiting to sync with the next Docker release?

@tianon

tianon commented Sep 30, 2014

Copy link
Copy Markdown
Contributor Author

Yes, boot2docker releases are synced to Docker releases, so this will be in
1.3 or 1.2.1, whichever comes first.

@gansbrest

Copy link
Copy Markdown

VirtualBox Guest Additions are unusable/slow for project with lots of small files ( tested with 17K files ). Is it just me?

I created Hodor github.com/gansbrest/hodor to streamline dev workflow for Mac and Linux. Let me know what you guys think.

@SchumacherFM

Copy link
Copy Markdown

Nice work @gansbrest !
Sounds like a great solution as we are using Magento with the same amount of files and it is so slow via shared folders ...

But I don't like Ruby so I'm gonna to rewrite it in Go. I also need the sync on Windows :-(
Go has a library for cross plattform sync: https://github.com/howeyc/fsnotify no idea if that works well....

@AkeemMcLennon

Copy link
Copy Markdown

Hmm, @gansbrest and @SchumacherFM bring up some interesting points and ideas.

However, since these changes are ultimately intended for the fig project, perhaps it might be useful to integrate this filesystem monitoring into Fig directly?

@bfirsh

bfirsh commented Oct 6, 2014

Copy link
Copy Markdown
Contributor

You might be interested in docker/compose#184

@huahaiy

huahaiy commented Oct 8, 2014

Copy link
Copy Markdown

These changes should be independent from Fig. The results of Fig's monitoring filesystem change is to rebuild and reload the container, but that may be too expensive. People often prefer to use their development environment's own system reloading mechanism, e.g. Clojure's lein-ring, etc. boot2docker should support these use cases.

@SvenDowideit

Copy link
Copy Markdown
Contributor

@huahaiy there is nothing in these changes that are dependant on fig - there are comanion changes in boot2docker-cli to make it work. - if you read @AkeemMcLennon 's comment, it asks about integrating this change into fig :)

@gansbrest

Copy link
Copy Markdown

Sorry guys, I'm not too familiar with fig. From the brief look, Hodor seem to follow similar concepts ( define config and run task ). You may probably take and integrate file sync/forwarding parts. I just wanted to create simple tool to allow our team to do develop in the docker environment efficiently.

@dekz

dekz commented Oct 11, 2014

Copy link
Copy Markdown

Correct me if I am wrong but no longer have to build from source (as per @sciutand comment) for this support, you can just curl the iso and use that.

http://static.dockerfiles.io/boot2docker-v1.2.0-virtualbox-guest-additions-v4.3.14.iso

@tianon

tianon commented Oct 11, 2014

Copy link
Copy Markdown
Contributor Author

That ISO isn't an official release. ;)

@dekz

dekz commented Oct 11, 2014

Copy link
Copy Markdown

Oh maybe I misunderstood based on the URL.

Would you say one should follow the original @sciutand advice in building and copying the ISO over then?

@gaastonsr

Copy link
Copy Markdown

If the above ISO works why not use it?

@abilash222

Copy link
Copy Markdown

the above ISO is not working. /User directory is not mounted

@dekz

dekz commented Oct 14, 2014

Copy link
Copy Markdown

@abilash222 did you use VBoxManage to share the folder into boot2docker?

@vmaatta

vmaatta commented Oct 21, 2014

Copy link
Copy Markdown

Ok so folders on the Mac host (under $HOME) can now be shared with the container… and you can do nothing with them:

Operation not permitted, Permission denied, could not create directory…

I've tried chowning them to 999:999, changed folder rights to 777… and still, those volume folders are just as unusable from the container.

E.g. -v ($HOME)/projects/data/db/:/var/lib/postgresql/data/

@michaelneale

Copy link
Copy Markdown
Contributor

@vmaatta I ran `docker -it -v /Users:/Users ubuntu:14.04 /bin/bash' and was able to ls and cat files from my him dir just fine - this is stock Docker 1.3

@vmaatta

vmaatta commented Oct 21, 2014

Copy link
Copy Markdown

Ok, say:

  1. docker run -v /Users/vmaatta/test:/tmp/test -it --rm debian:latest bash: I can manually read, write files and create folders in the container.
  2. I make the same folder a data volume for a postgres /var/lib/postgresql/data and here's the result:
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... initdb: could not create directory "/var/lib/postgresql/data/global": Permission denied
initdb: removing contents of data directory "/var/lib/postgresql/data"

The same with a different container, a web server that needs to write all kinds of files, they both fail with the aforementioned access problems.

@vmaatta

vmaatta commented Oct 21, 2014

Copy link
Copy Markdown

And it seems there's an issue for it… #581. The release notes are really quite misleading / missing an important note.

@huahaiy

huahaiy commented Oct 23, 2014

Copy link
Copy Markdown

@vmaatta I seem to be able to run postgres container just fine on boot2docker, see my Postgres Dockerfile here. initdb run as the user postgres, so make sure that user have permission on the $PGDATA directory.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.