Skip to content
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

Closed
mikkin opened this issue Aug 29, 2012 · 30 comments

Comments

@mikkin
Copy link

mikkin commented Aug 29, 2012

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.

@lhagemann
Copy link

Same issue present in Lion

OSX: 10.7.5
Vagrant: 1.0.5
VirtualBox: 4.1.23

Log snippet

     INFO global: Vagrant version: 1.0.5
 INFO vagrant: `vagrant` invoked: ["up"]


[snip]

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /etc/debian_version (sudo=false)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /proc/version | grep 'Debian' (sudo=false)
DEBUG ssh: Exit status: 0
 INFO vm: Loading guest: debian
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: su -c 'cat /tmp/vagrant-network-interfaces > /etc/network/interfaces' (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading: /var/folders/cr/bwc5p2_17p16j5cjmlvk86km0000gn/T/vagrant20121008-5440-ui3r8s to /tmp/vagrant-network-entry
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry >> /etc/network/interfaces (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 (sudo=true)
DEBUG ssh: Exit status: 0
 INFO interface: info: Mounting shared folders...
[default] Mounting shared folders...
 INFO interface: info: -- v-root: /vagrant
[default] -- v-root: /vagrant
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: printf /vagrant (sudo=false)
DEBUG ssh: Exit status: 0
DEBUG ssh: stdout: /vagrant
DEBUG linux: Shell expanded guest path: /vagrant
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: mkdir -p /vagrant (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` v-root /vagrant (sudo=true)
DEBUG ssh: stderr: stdin: is not a tty

DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: chown `id -u vagrant`:`id -g vagrant` /vagrant (sudo=true)
DEBUG ssh: Exit status: 0
 INFO interface: info: Mounting NFS shared folders...
[default] Mounting NFS shared folders...
 INFO subprocess: Starting process: ["VBoxManage", "showvminfo", "b414b67e-4251-4778-8aa1-279403e2cda4", "--machinereadable"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
DEBUG subprocess: name="project_1349723239"
ostype="Debian_64"
UUID="b414b67e-4251-4778-8aa1-279403e2cda4"
CfgFile="/Users/lisa/VirtualBox VMs/project_1349723239/project_1349723239.vbox"
SnapFldr="/Users/lisa/VirtualBox VMs/project_1349723239/Snapshots"
LogFldr="/Users/lisa/VirtualBox VMs/project_1349723239/Logs"
hardwareuuid="b414b67e-4251-4778-8aa1-279403e2cda4"
memory=256
pagefusion="off"
vram=12
cpuexecutioncap=100
hpet="off"
chipset="piix3"
firmware="BIOS"
cpus=1
synthcpu="off"
bootmenu="messageandmenu"
boot1="floppy"
boot2="dvd"
boot3="disk"
boot4="none"
acpi="on"
ioapic="on"
pae="off"
biossystemtimeoffset=0
rtcuseutc="on"
hwvirtex="on"
hwvirtexexcl="off"
nestedpaging="on"
largepages="off"
vtxvpid="on"
VMState="running"
VMStateChangeTime="2012-10-08T19:39:49.863000000"
monitorcount=1
accelerate3d="off"
accelerate2dvideo="off"
teleporterenabled="off"
teleporterport=0
teleporteraddress=""
teleporterpassword=""
storagecontrollername0="Contrôleur IDE"
storagecontrollertype0="PIIX4"
storagecontrollerinstance0="0"
storagecontrollermaxportcount0="2"
storagecontrollerportcount0="2"
storagecontrollerbootable0="on"
storagecontrollername1="Contrôleur SATA"
storagecontrollertype1="IntelAhci"
storagecontrollerinstance1="0"
storagecontrollermaxportcount1="30"
storagecontrollerportcount1="1"
storagecontrollerbootable1="on"
"Contrôleur IDE-0-0"="none"
"Contrôleur IDE-0-1"="none"
"Contrôleur IDE-1-0"="emptydrive"
"Contrôleur IDE-IsEjected"="off"
"Contrôleur IDE-1-1"="none"
"Contrôleur SATA-0-0"="/Users/lisa/VirtualBox VMs/project_1349723239/box-disk1.vmdk"
"Contrôleur SATA-ImageUUID-0-0"="5529f761-340d-45c0-be23-7ee001a1b419"
natnet1="nat"
macaddress1="080027635EF5"
cableconnected1="on"
nic1="nat"
mtu="0"
sockSnd="64"
sockRcv="64"
tcpWndSnd="64"
tcpWndRcv="64"
Forwarding(0)="2g-7sg,tcp,,8080,,80"
Forwarding(1)="ssh,tcp,,2222,,22"
hostonlyadapter2="vboxnet0"
macaddress2="0800271B1D37"
cableconnected2="on"
nic2="hostonly"
nic3="none"
nic4="none"
nic5="none"
nic6="none"
nic7="none"
nic8="none"
hidpointing="usbtablet"
hidkeyboard="ps2kbd"
uart1="off"
uart2="off"
audio="none"
clipboard="bidirectional"
VideoMode="720,400,0"
vrde="on"
vrdeport=-1
vrdeports="3389"
vrdeaddress=""
vrdeauthtype="null"
vrdemulticon="off"
vrdereusecon="off"
vrdevideochannel="off"
usb="on"
SharedFolderNameMachineMapping1="v-root"
SharedFolderPathMachineMapping1="/Users/lisa/work_dir/project"
VRDEActiveConnection="off"
VRDEClients=0
GuestMemoryBalloon=0
GuestOSType="Linux26_64"
GuestAdditionsRunLevel=2
GuestAdditionsVersion="4.1.23r80858"
GuestAdditionsFacility_VirtualBox Base Driver=50,1349725196740
GuestAdditionsFacility_VirtualBox System Service=50,1349725198845
GuestAdditionsFacility_Seamless Mode=0,1349725196740
GuestAdditionsFacility_Graphics Mode=0,1349725196740

 INFO subprocess: Starting process: ["VBoxManage", "list", "dhcpservers"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
 INFO subprocess: Starting process: ["VBoxManage", "list", "hostonlyifs"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: Name:            vboxnet0
GUID:            786f6276-656e-4074-8000-0a0027000000
Dhcp:            Disabled
IPAddress:       10.11.12.1
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0


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 /data/web (sudo=false)
DEBUG ssh: Exit status: 0
DEBUG ssh: stdout: /data/web
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: mkdir -p /data/web (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: mount -o vers=3 10.11.12.1:'/Users/lisa/work_dir' /data/web (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.

*** above error repeasted 10 times ***


ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Guest::Linux::LinuxError: 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.>
ERROR vagrant: 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.
ERROR vagrant: /Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/communication/ssh.rb:62:in `execute'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/communication/ssh.rb:72:in `sudo'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/guest/linux.rb:64:in `block in mount_nfs'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/guest/linux.rb:58:in `each'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/guest/linux.rb:58:in `mount_nfs'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/vm/nfs.rb:144:in `mount_folders'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/vm/nfs.rb:43:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/vm/prune_nfs_exports.rb:15:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/vm/provision.rb:27:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/vm/forward_ports.rb:24:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/vm/check_port_collisions.rb:42:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/env/set.rb:16:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/vm/clear_forwarded_ports.rb:13:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/vm/clean_machine_folder.rb:17:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/vm/check_accessible.rb:18:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/general/validate.rb:13:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/builder.rb:92:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/runner.rb:49:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/action/runner.rb:49:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/vm.rb:192:in `run_action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/vm.rb:152:in `start'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/command/up.rb:28:in `block in execute'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/command/base.rb:116:in `block in with_target_vms'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/command/base.rb:111:in `each'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/command/base.rb:111:in `with_target_vms'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/command/up.rb:24:in `execute'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/cli.rb:42:in `execute'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/lib/vagrant/environment.rb:167:in `cli'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.0.5/bin/vagrant:43:in `<top (required)>'
/Applications/Vagrant/bin/../embedded/gems/bin/vagrant:19:in `load'
/Applications/Vagrant/bin/../embedded/gems/bin/vagrant:19:in `<main>'

@mikkin
Copy link
Author

mikkin commented Oct 8, 2012

@lhagemann my issue was that /etc/hosts file did not have this line:
127.0.0.1 localhost

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.

@cgeisel
Copy link

cgeisel commented Oct 10, 2012

@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?

@budda
Copy link

budda commented Oct 13, 2012

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.
Deleted all VBox and nfs related items from Firewall list, re-enabled Firewall, Vagrant NFS mount fails again. Hmm.

@afterdesign
Copy link

Hi.
I'm using vagrant 1.0.5 with virtualbox 4.2.4 on osx 10.8.2 and I have the same problem. Debug is saying:

DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: mount -o vers=3 192.192.1.1:'/Users/afterdesign/intranet' /project (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.

And when I try mounting it manually I'm getting:

vagrant@vagrant-debian64:~$ sudo mount -o vers=3 192.192.1.1:/Users/afterdesign/intranet /project
mount.nfs: access denied by server while mounting 192.192.1.1:/Users/afterdesign/intranet

@afterdesign
Copy link

Ok. I've done some debugging and I missed stupid error in Vagrantfile.
First problem was that nfsd wasn't running and sudo nfsd start helped.
Second problem was that I had 2 times config.vm.share_folder added to Vagrantfile and then it was added to /etc/exports. Just check your exports file with sudo nfsd checkexports.
Now it's working like a charm.

@davidmytton
Copy link

I still had this issue even with a "correct" /etc/exports file and nfsd running:

10/12/12 13:40:27 david@dm-mba ~/Vagrantfiles/honshuu-environment: cat /etc/exports
# VAGRANT-BEGIN: 08239943-4e75-4a03-a2c7-5c50664e6045
"/Users/david/Sites/honshuu-vagrant" 192.168.33.10 -mapall=501:20
# VAGRANT-END: 08239943-4e75-4a03-a2c7-5c50664e6045

The fix was to disable the OS X Firewall from Preferences > Security > Firewall at which point the NFS mount worked properly.

@mac-flanker
Copy link

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

@aar0nr
Copy link

aar0nr commented Jan 22, 2013

@budda and @dmytton thank you. Turning off the firewall resolved the issue for me as well.

@bubenkoff
Copy link

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

@bubenkoff
Copy link

but anyhow, disabling firewall didn't helped me

@dkubb
Copy link

dkubb commented Apr 30, 2013

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:

  • /usr/sbin/rpcbind
  • /sbin/nfsd
  • /usr/sbin/rpc.statd
  • /usr/sbin/rpc.lockd
  • /usr/libexec/rpc.rquotad

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 /var/log/appfirewall.log. When vagrant would attempt to mount the folder using nfs, I would see errors about rpcbind being denied by socketfilterfw.

@mac-flanker
Copy link

Thanks for the response!

I ended up getting it to work. For me what I ended up doing was using a
different version of nfs. Mounting using linux, I used nfs version 3 and
for the Mac, I switched to nfs version 4. For me I never had to mess with
the firewall on the mac in question.

Hope this helps

On Mon, Apr 29, 2013 at 9:45 PM, Dan Kubb notifications@github.com wrote:

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 like others suggested. I tried adding nfsd to the list of
applications like @bubenkoff https://github.com/bubenkoff recommended.
That was on the right track, but wasn't enough. I had to add all the
following applications:

  • /usr/sbin/rpcbind
  • /sbin/nfsd
  • /usr/sbin/rpc.statd
  • /usr/sbin/rpc.lockd
  • /usr/libexec/rpc.rquotad

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)


Reply to this email directly or view it on GitHubhttps://github.com//issues/1093#issuecomment-17209368
.

@finnlewis
Copy link

Just for the record, I had the same problem on OSX 10.8.2
For me I think it was permissions related. I was trying to map the /var/www folder from my host to the /var/www folder int he vagrant box. On the mac, the /var folder was a symlink to private/var or some-such, and owned by root.
Changing this to map a www folder from inside the vagrant root made all my problems go away!

@drewcking
Copy link

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.

@mjackson
Copy link

mjackson commented Jun 6, 2013

Alas, been struggling with using NFS for a few hours now on a Mac OSX 10.8.3 host. When I run Vagrant's mount command manually from inside my Ubuntu 12.04 VM, I get:

$ sudo mount -v -o vers=3 192.168.100.1:'/Users/michael/Projects/mobile' /vagrant
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: timeout set for Thu Jun  6 03:45:51 2013
mount.nfs: trying text-based options 'vers=3,addr=192.168.100.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query retrying: RPC: Program not registered
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Program not registered
mount.nfs: requested NFS version or transport protocol is not supported

Just to verify that I actually have nfs running correctly on my host:

$ showmount -e
Exports list on localhost:
/Users/michael/Projects/mobile  192.168.100.1

Totally stumped at this point.

@MarioRicalde
Copy link

I'm having the same issue. Disabled the firewall, but doesn't seem to help.

@lifeisfoo
Copy link

Same on osx 10.8.4 and vagrant 1.2.2

INFO ssh: Execute: mount -o vers=3 10.1.1.1:'/Users/alessandro/Dev/vagrant/webroot' /var/www (sudo=true)
DEBUG ssh: stderr: stdin: is not a tty
DEBUG ssh: stderr: mount.nfs: requested NFS version or transport protocol is not supported
DEBUG ssh: Exit status: 32

@mitchellh
Copy link
Contributor

So for this issue, the original issue, it looks like the issue was NFS versioning. Note that shared folders take an optional parameter nfs_version where you can specify the version that Vagrant will use to mount the folder. Try changing this to the proper version. Example:

config.vm.synced_folder "/foo", "/bar", nfs: true, nfs_version: "4"

@gtmtech
Copy link

gtmtech commented Aug 13, 2013

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.

@prismic
Copy link

prismic commented Aug 23, 2013

I ran into the same problem, and the error messages I keep getting was variants of requested NFS version or transport protocol is not supported or Protocol not supported. On my Mac (10.7), only version 3 is supported, but the issue wasn't because of that either. There was a rule set in the /etc/hosts.allow file that denied access to a lot of services, including rpcbind. I was clued into this when I saw this message in the console whenever I tried to connect:

rpcbind: connect from 192.168.33.10.141.66 to getport() : request from unauthorized host

To fix it, I added this line to my /etc/hosts.allow file:

ALL : 192.168.33.10 : allow

before any deny statements, restarted rpcbind and nfsd, and that fixed it.

@paulyoung
Copy link

@prismic - your advice seems to have solved the issue for me. Thanks.

@richardjennings
Copy link

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.

@paulyoung
Copy link

To clarify, I'm using Vagrant 1.2.7 and VirtualBox 4.2.16 r86992.

@ndj-prive
Copy link

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

@ajlee
Copy link

ajlee commented Oct 26, 2013

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!

@AlexSkrypnyk
Copy link

@ajlee
nfs_version => 2 worked for me too.

On the client

$ nfsstat
.....
Client nfs v2:
....

So looks like my client VM is running V2 only.

cpjobling pushed a commit to cpjobling/vagrant-chef-dlamp that referenced this issue Jun 20, 2014
@drdreamm
Copy link

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"] }

@wgabka
Copy link

wgabka commented Jan 18, 2016

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
/sbin/nfsd
/usr/sbin/rpc.statd
/usr/sbin/rpc.lockd
/usr/libexec/rpc.rquotad

as @dkubb write above.

@amontalban
Copy link
Contributor

For anyone having issues with OSX + NFS you can execute this in your OSX host:

sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "/usr/sbin/rpcbind"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "/usr/sbin/rpcbind"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "/sbin/nfsd"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "/sbin/nfsd"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "/usr/sbin/rpc.statd"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "/usr/sbin/rpc.statd"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "/usr/sbin/rpc.lockd"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "/usr/sbin/rpc.lockd"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "/usr/libexec/rpc.rquotad"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "/usr/libexec/rpc.rquotad"
sudo nfsd restart

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!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests