Mount.nfs: Connection timed out ... - Vagrant - Trellis

deleting picture deleting · Jul 26, 2017 · Viewed 7.4k times · Source

I'm trying to run vagrant up for the first time, but I'm getting this error:

==> default: Mounting NFS shared folders...

The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

mount -o vers=3,udp xxx.xxx.xx.x:/home/erick/... (path)

Stdout from the command:

Stderr from the command:

mount.nfs: Connection timed out

How Can I fix it?

Thank You

Answer

hotfire42 picture hotfire42 · Sep 6, 2017

Is your nfs daemon running? You can check it with nfsd status, which should return nfsd service is enabled. In case it is not running, you can enable and start it with:

sudo nfsd enable
sudo nfsd start

I have had the same problem recently and noticed that enabling the default macOS firewall will block NFS, and it will just timeout without any error. If you have enabled the firewall, I would first try to disable it and try again. If it works then, you can add rules to allow the nfs traffic to pass trough the firewall.

If it is still not working:

  • Make sure the file /etc/exports exists
  • Check your export file using nfsd checkexports
  • Check your syslog for nfsd errors

You can find the nfsd man here: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man8/nfsd.8.html

(edit: unfortunately, the man page is down and I can not find it anymore - here is a replacement, but you should probably check if you can retrieve the correct version from apple. https://www.unix.com/man-page/osx/8/nfsd/)