-
Notifications
You must be signed in to change notification settings - Fork 32
Example with nfs #10
Comments
Hey @dduportal , After playing around a bit, I got it working by setting: config.vm.synced_folder "/Users", "/Users", type: "nfs", mount_options: ["nolock", "vers=3", "udp"]
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ["nolock", "vers=3", "udp"] Is there any particular reason? Maybe this can be documented here? |
Hi @tonivdv ! Thanks you for pointing me out that fact. To be honest, I haven't tested well the NFS part (i rely on the PR submitted). I you have a reproduction example, i'll try to reproduce and provide a setting or documentation inside the next version. If you have and idea, or an envy to write some doc, it's open :) |
Hey @dduportal , Well I can do that for sure. I'm currently very hard busy for a talk I have to do in 2 weeks. I've been able to tweak the vagrant file in order to have it seamlessly like if I was using boot2docker, except with much better performances. Here's how my vagrant file looks like at the moment of this writing: # Make sure same user and group as host is used
config.nfs.map_uid = Process.uid
config.nfs.map_gid = Process.gid
config.vm.box = "dduportal/boot2docker"
config.vm.network "private_network", ip: "192.168.10.10"
config.vm.synced_folder "/Users", "/Users", type: "nfs", mount_options: ["nolock", "vers=3", "udp"]
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ["nolock", "vers=3", "udp"] In awaiting better doc, this could maybe already help others. |
@tonivdv Thank you very much, no rush, take your time :) |
I have this in my Vagrantfile:
It actually mounts fine (though on my colleague's MBP it doesn't work for some reason we have yet to determine) my LAMP/LNxMP apps need to chown & chmod lots of files in the nfs share, but instead of running like they did in boot2docker, instead of a normal startup, I get 1,000s of lines of I gave |
Hey @phpguru , Did you try with following too: config.nfs.map_uid = Process.uid
config.nfs.map_gid = Process.gid |
OK, my thought are : if we push that default setting inside the baseball (there is a Vagrantfile inside), it should work on both Windows and Mac OS. |
When i run the above commands for nfs, i get the following error. Im running vagrant in Window 8.1 host. config.nfs.map_uid = Process.uid config.vm.network "private_network", ip: "172.17.10.5" config.vm.synced_folder "/Users", "/Users", type: "nfs", mount_options: ["nolock", "vers=3", "udp"]
|
Hello @IbnSaeed, by default, NFS does not work on Windows (see. Vagrant documentation - http://docs.vagrantup.com/v2/synced-folders/nfs.html ). Maybe you should try with smb (http://docs.vagrantup.com/v2/synced-folders/smb.html) which should work with boot2docker (recent ones at least). Or if NFS is absolutely needed, there is a vagrant plugin : https://github.com/GM-Alex/vagrant-winnfsd. |
@dduportal I am running the vagrant-winnfsd plugin. It works when i run docker container with coreos + vagrant. But i get the above error when i try it with boot2docker. |
@dduportal Thanks for the smb link, ill take a look at it. |
@dduportal by the way, how is smb speed compared to nfs for bi-directional syncing ? |
Hi @IbnSaeed, @mitchellh, the creator of Vagrant, has published that post some times ago : http://mitchellh.com/comparing-filesystem-performance-in-virtual-machines around the sharing folder performances. Briefly :
I personally use vboxsf as i need portability (i work on Mac OS and Windows and have a Debian-based GUI in a container). |
I had to spent some time debugging why NFS didn't work, before I found this issue. Just wanted to mention that if you want to prevent the need for the nolock option, you can start the nfs-client in b2d. I think it's worth considering putting in, makes the usage of the box and NFS easier. It's already installed and I think you can add to /opt/bootlocal.sh to start the nfs client with each boot. |
Thanks for the information @ffung ! I'm re-opening the issue to prepare a future PR (from myself or whoever is ready to do that :) ) that will add the nfs-client start inside the VM. |
@tonivdv I missed your comment before and will try it. On another thread I saw the nix prog BindFS gets around the permissions issue but config option is preferred with less software if it works. I couldn't figure out how to install BindFS on tinycore. Really hopeful for an nfs solution! Thanks @dduportal! |
@phpguru yeah I read about bindfs. I even looked at https://github.com/gael-ian/vagrant-bindfs where I did learn about map_uid and map_gid. When I saw it, I found it easier with those params. This config currently does work on all our macs :) We still need to do the changes for making it work on Windows. Once that is done, I'll be happy to write some Readme about this, which imho will be very helpful for new users. @dduportal thx for the brief review on the sharing folders! |
OK, i'm trying to reproduce in order to add a bats tests that will describe the NFS share (at least /vagrant by default). First try on 10.9.5 with vagrant 1.7.2 :
|
@dduportal I have the same issue when I remove the option 'nolock' option in the nfs mounting. Didn't try to understand why though ... |
Just started over from scratch. I'm really trying to switch from boot2docker to Vagrant but I keep running into various issues along the way. For instance, this time, now when I try to follow along, I get:
|
Upgrade your local boot2docker Douglas Ferguson
|
Thanks @thedug - I checked all my versions, and still get issues:
I try again:
I'm actually wondering if its VirtualBox... |
Hey @phpguru , Did you update the environment variables correctly? export DOCKER_HOST=tcp://127.0.0.1:2376 I suggest you set this in your .profile or equivalent |
And you don't have to keep boot2docker to use the docker client. You can download it and install through following: curl -L -o docker https://get.docker.io/builds/Darwin/x86_64/docker-1.5.0
chmod +x docker
sudo mv docker /usr/local/bin/docker But of course you can keep boot2docker but be sure to not mix ips and environment vars. Hope it helps. |
Hi all, i implemented NFS default sharing, tested on Mac OS (Mavericks and Yosemite) : #17 The documentation has been updated. The released box is the 1.6.1 : https://atlas.hashicorp.com/dduportal/boxes/boot2docker/versions/1.6.1 I've done a quick released since docker 1.6.2 is out. If you have any feedback, please open a new Issue. Thanks all for your help ! |
Thanks @dduportal 👍 |
Hey @tonivdv, Up above you said |
@phpguru sorry couldn't respond sooner. But I see you figured it out 👍 |
@tonivdv After stopping and re-starting the vagrant box, and doing a |
@phpguru yeah @dduportal did a great job of taking this project over, and especially maintaining it. I however try to get rid of vagrant and use docker-machine instead. We shared our script which activates nfs on docker-machine here https://github.com/adlogix/docker-machine-nfs. Though it could be that vagrant suits some projects better. But at least you know an alternative :) |
Hi everyone Maybe one of you can help me with this issue #48 nfs simple example "failed:Connection refused" |
Hey @dduportal ,
I was wondering if you could share a working Vagrantfile with NFS sharing. More specifically sharing the /Users directory (I'm on mac)
I was able to make it work with the version of https://github.com/YungSang/boot2docker-vagrant-box, however with this box I get permissions issues ... !?
Thanks
The text was updated successfully, but these errors were encountered: