-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to mount nfs shared folder on Mountain Lion, Virtualbox 4.1.18 with vagrant 1.01 #1093
Comments
Same issue present in Lion
Log snippet
|
@lhagemann my issue was that /etc/hosts file did not have this line: But that has been fixed in 1.0.4+, I believe. One thing that helped me to debug was running the failed command manually to see what error it throws and go from there. |
@mikkin can you be more specific? Are you referring to /etc/hosts on the guest or host? I'm having a similar issue. What is strange in my case is that my VM was running perfectly until I allowed my host machine to hibernate. When I resumed it, the VM was in an "unstable" state (IIRC), so I ran vagrant destroy and vagrant up again. That's when I got the NFS issue. Also, did you upgrade vagrant to 1.0.4+? If so, did you need to upgrade VirtualBox and any Guest Additions on your box? |
I had mounts working under OS X Snow Leopard. Upgraded to Mountain Lion and it all stopped working during the vagrant up process. Turned off the OSX Firewall and it works fine. |
Hi.
And when I try mounting it manually I'm getting:
|
Ok. I've done some debugging and I missed stupid error in Vagrantfile. |
I still had this issue even with a "correct"
The fix was to disable the OS X Firewall from Preferences > Security > Firewall at which point the NFS mount worked properly. |
I just recently ran into this problem with Vagrant as well. Try changing the vers number in the mount command. So vers=4 opposed to vers=3. If that works, you can then go into the Vagrantfile and specify version number for your nfs file so it uses the appropriate version by default. config.vm.share_folder "v-data","/guest/path","/host/path", :nfs => true, nfs_version => 4 |
@budda and @dmytton thank you. Turning off the firewall resolved the issue for me as well. |
No need to fully disable it, just add nfsd to exceptions, you'll need to navigate to root by cmd+up and enter nfsd in search field |
but anyhow, disabling firewall didn't helped me |
I ran into this same problem. I found that disabling the firewall fixed the problem. However, I sometimes work over insecure networks, like at a coffeeshop, so I couldn't just keep it disabled. I made sure nfsd was running like others suggested. I tried adding nfsd to the list of applications like @bubenkoff recommended. That was on the right track, but wasn't enough. I had to add all the following applications:
These settings didn't seem to take effect right away, I had to reboot for this to work. FWIW I got the list of applications from http://www.bresink.com/osx/143439/Docs-en/pgs/Share.html (in the "Using the application-based private firewall of OS X" section) EDIT: One other thing that helped me debug the issue was tailing |
Thanks for the response! I ended up getting it to work. For me what I ended up doing was using a Hope this helps On Mon, Apr 29, 2013 at 9:45 PM, Dan Kubb notifications@github.com wrote:
|
Just for the record, I had the same problem on OSX 10.8.2 |
I wrestled with this same issue for a few hours (OSX 10.8.3 host, Ubuntu 12.04 guest). Everything worked fine with vbox shared folders, but once I added the :nfs=>true and reloaded, the mapping failed. Fwiw, my issue turned out to be case-sensitivity; my host folder is "../sites" but I was mapping it in my Vagrantfile as "../Sites". Lowercased it, and everything's fine now. |
Alas, been struggling with using NFS for a few hours now on a Mac OSX 10.8.3 host. When I run Vagrant's
Just to verify that I actually have nfs running correctly on my host:
Totally stumped at this point. |
I'm having the same issue. Disabled the firewall, but doesn't seem to help. |
Same on osx 10.8.4 and vagrant 1.2.2
|
So for this issue, the original issue, it looks like the issue was NFS versioning. Note that shared folders take an optional parameter config.vm.synced_folder "/foo", "/bar", nfs: true, nfs_version: "4" |
A few things I discovered with NFS on OSX which might also help some people out... If you get errors such as "No such file or directory" or "access denied by server while mounting" and you think you should be able to mount it properly (e.g. your /etc/exports all looks good).. then it could also be a weird nfs behaviour I experienced as follows: By studying the Max OSX Console (command-space console) I noticed that even though my Vagrantfile was nfs mounting directory foo, and even though the /etc/exports referenced directory foo, the nfsd process was actually trying to mount directory foo-old. At some point I had renamed the directory foo as foo-old, possibly whilst nfsd was still running and it was mounted(?) - and had symlinked foo to foo-old .... but the end result is nfsd is trying to mount a directory it doesnt have permission to mount in /etc/exports, because of course everything is configured to look for foo, not foo-old. It's all odd because nowhere do I specify foo-old, and I checked $HOME/.vagrant.d for mentions of it and found none there too... but there must be some internal part of nfsd which has kept track of the filehandle or follows the symlink instead and tries to compare the symlink destination against the /etc/exports list, or something like that. So if you experience the same odd behaviour in the OSX console, then I recommend, starting over, blatting nfsd (sudo nfsd stop), removing all the directories involved, perhaps moving the mounted directory on the server to a new location, and updating Vagrantfile to remount it from a different place. This worked for me. |
I ran into the same problem, and the error messages I keep getting was variants of
To fix it, I added this line to my /etc/hosts.allow file:
before any deny statements, restarted rpcbind and nfsd, and that fixed it. |
@prismic - your advice seems to have solved the issue for me. Thanks. |
The issue for me was that I had renamed a folder in the shared path previously from upper case to lower case. Despite the shared path being specified relative to the vagrant file, vagrant was issuing a mount command which included an uppercase character where it was now a lowercase character. Simply renaming one of the shared folders parents from lower case to uppercase ended hours of pain. |
To clarify, I'm using Vagrant 1.2.7 and VirtualBox 4.2.16 r86992. |
For some strange reason after a reboot my /etc/hosts file was also missing the 127.0.0.1 localhost, and the machine was not able to mount the NFS shared vagrant folder. After adding this again to my hosts file the problem was fixed. Thx to @mikkin |
For some reason I needed to set nfs_version => 2. I'm on the latest version of OSX so no idea why I need an old version of nfs! |
@ajlee On the client
So looks like my client VM is running V2 only. |
I had the same issue on OSX 10.7.5. I turned off the firewall (pref-> security & Privacy -> firewall) and all is now ok :) For info (config.vm.synced_folder) : config.vm.synced_folder "../", "/var/www/blah/blah/", :nfs => { :mount_options => ["dmode=777", "fmode=777"] } |
For my case (OSX Maverick) the problem was strictly related to firewall. In case you have the same problem which means, when you disable firewall everything is working correctly. The solution is to allow incoming connections for /usr/sbin/rpcbind as @dkubb write above. |
For anyone having issues with OSX + NFS you can execute this in your OSX host: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "/usr/sbin/rpcbind" That should allow all related daemons in firewall and restart NFS service to allow incoming connections from VM. Based on @wgabka and @dkubb info. Hope it helps someone! |
The following is the log output that can probably help you out:
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: printf /opt/workfeed (sudo=false)
DEBUG ssh: stdout: /opt/workfeed
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: mkdir -p /opt/workfeed (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: mount -o vers=3 33.33.33.1:'/Users/derickson/dev/workfeed' /opt/workfeed (sudo=true)
DEBUG ssh: Exit status: 32
ERROR warden: Error occurred: Mounting NFS shared folders failed. This is most often caused by the NFS
client software not being installed on the guest machine. Please verify
that the NFS client software is properly installed, and consult any resources
specific to the linux distro you're using for more information on how to
do this.
The text was updated successfully, but these errors were encountered: