wurmlab / oswitch

Provides access to complex Bioinformatics software (even BioLinux!) in just one command.
76 stars 9 forks source link

/Volumes isn't mounted #4

Open yannickwurm opened 9 years ago

yannickwurm commented 9 years ago

(actually the directory doesn't even exist) on my mac - not visible in /mnt either.

yeban commented 9 years ago

/Volumes is never mounted. Nor /Volumes/Macintosh HD. If you have anything else in /Volumes, it should be mounted under /Volumes in the container.

yannickwurm commented 9 years ago

I think /Volumes/Macintosh HD should be mounted - and non-conflicting root links to /Applications /Library etc should be added/included

On 12 Jan 2015, at 14:31, Anurag Priyam notifications@github.com wrote:

/Volumes is never mounted. Nor /Volumes/Macintosh HD. If you have anything else in /Volumes, it should be mounted under /Volumes in the container.

— Reply to this email directly or view it on GitHub.

yannickwurm commented 9 years ago

(my container didn't contain /Volumes)

yeban commented 9 years ago

Why would you want access to /Applications or /Library in the container? I will have to check if root owned files / dirs can be mounted rw within container.

Did you have anything in /Volume (on host)?

yannickwurm commented 9 years ago

only Macintosh HD. I don't think /Applications or /Library need to be mounted with w. r is enough - to be able to read files that can be in strange places (e.g. from MacTex install?) ...

yeban commented 9 years ago

I made the necessary changes in switch, but still unable to mount /Applications. Probably because boot2docker is getting in the way. Perhaps @bmpvieira can help.

yannickwurm commented 9 years ago

The underlying issue is that any directory that exists in / on host that does not conflict with a directory in client should be mounted in / on the client. (e.g. on our cluster such key directories include /data/ , /scratch/ and /gpfs)

yeban commented 9 years ago

Test case is simple: docker run -it -v /Applications:/Applications. /Applications in the container comes up empty.

yeban commented 9 years ago

It is indeed boot2docker getting in the way. On Mac, boot2docker is the real host, not OSX.

The workaround is as below, using /Applications dir as an example:

boot2docker down
VBoxManage sharedfolder remove boot2docker-vm --name Applications
VBoxManage sharedfolder add boot2docker-vm --name Applications --hostpath /Applications
boot2docker up
boot2docker ssh "sudo mkdir -p /Applications && sudo mount -t vboxsf -o uid=1000,gid=50 Applications /Applications"

Mounting /Applications in a docker container works now: docker run --rm -it -v /Applications:/Applications ubuntu:14.04 ls /Applications.

And so does switch: switch ubuntu:14.04 ls /Applications.

I'm not sure how to best incorporate the solution in switch. I will document this in the readme for now. Would be great if boot2docker dealt with this auto-magically.

yannickwurm commented 9 years ago

I think it is safe to suppose that boot2docker will solve this in the future.

bmpvieira commented 9 years ago

Does Docker's "machine" solves this? Should we switch from boot2docker to "machine" in the short term?

yeban commented 8 years ago

docker-machine doesn't seem to solve this. Not automagically.