Update
Fixed in VirtualBox 5.1.22.
(https://www.virtualbox.org/ticket/16670)
Original answer
In my case a symlink inside the VM was wrong.
Log into the VM:
$ vagrant ssh
Then:
$ ls -lh /sbin/mount.vboxsf
lrwxrwxrwx 1 root root 49 Apr 19 14:05 /sbin/mount.vboxsf -> /opt/VBoxGuestAdditions-5.1.20/other/mount.vboxsf
This link is broken. When you look inside /opt/VBoxGuestAdditions-5.1.20/ you see that the subfolder "other" doesn't exists.
This line fixes that:
$ sudo ln -sf /opt/VBoxGuestAdditions-*/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf
Now logout of the VM:
$ exit
And check if it works for you:
$ vagrant reload
But i can't fix the link because /sbin/mount.vboxsf does not exist inside my box!
If the link /sbin/mount.vboxsf does not exists in the first place, than the VBoxGuestAdditions couldn't be installed. This can happen if you have not downloaded the matching VirtualBox Extension Pack after you updated VirtualBox (v5.2.18 and up should download it automatically during Virtualbox updates). You can do that now:
- Halt all your running VMs.
- Open the VirtualBox program.
- Start the download of the VirtualBox Extension Pack and install it.
- If you are not being asked if you want to download the VirtualBox Extension Pack, open ->File ->Check for Update, to trigger the download dialog.
If there was no update for the VirtualBox Extension, than it's possible the VBoxGuestAdditions can't be installed because the installer shows a message and the vagrant plugin vbguest can not prompt an answer (this is "fixed" in vbguest v0.15.0). You can see that in the output of "vagrant up". There should be a line similar to this one:
Do you wish to continue? [yes or no]
If that is the case you can run the installer manually. To do so, start the box:
$ vagrant up
Then trigger vbguest to try the installation again but leave the VBoxGuestAdditions ISO mounted afterwards:
$ vagrant vbguest --do install --no-cleanup
Log into the box:
$ vagrant ssh
Ran the installer manually:
$ sudo /mnt/VBoxLinuxAdditions.run
A last hope: DIY!
If nothing of the above worked, try to install the guest additions manually:
cd /opt
sudo wget -c http://download.virtualbox.org/virtualbox/5.1.28/VBoxGuestAdditions_5.1.28.iso -O VBoxGuestAdditions_5.1.28.iso
sudo mount VBoxGuestAdditions_5.1.28.iso -o loop /mnt
sudo sh /mnt/VBoxLinuxAdditions.run
Not required restart nfs
service. After you add below in /etc/exports
/home/nfs 192.168.13.81(rw,async,no_root_squash)
Just re-export the NFS directories:
exportfs -ra
Then use nfs4
to mount it.
mount -t nfs4 192.168.13.80:/home/nfs /home/nfs
You may also want to check if client has NFS access to server by the following command.
rpcinfo -p 192.168.13.80
You will get result if client has access, with lines as portmapper, nfs, mountd, nlockmgr, nfs_acl and rquotad.
Best Answer
Is your nfs daemon running? You can check it with
nfsd status
, which should returnnfsd service is enabled
. In case it is not running, you can enable and start it with: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:
/etc/exports
existsnfsd checkexports
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/)