Vagrant up fails on mounting NFS shared folders

Today I ran into this problem as well. While running vagrant up I got an error while vagrant up was performing task ==> default: Mounting NFS shared folders... and the output was the following:

...

==> 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 192.168.50.1:/home/user/Sites/clientsite.com/site /vagrant-nfs-clientsite.com

Stdout from the command:



Stderr from the command:

mount.nfs: requested NFS version or transport protocol is not supported

While trying to vagrant up another projects vm I got the same error message so logic says it must me related to my host machine. When tried running systemctl status nfs-kernel-server if got the following:

● nfs-server.service - NFS server and services
   Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2019-11-15 14:56:22 EET; 2min 1s ago
  Process: 26879 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
  Process: 26878 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
  Process: 26877 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)

nov   15 14:56:22 pc systemd[1]: Starting NFS server and services...
nov   15 14:56:22 pc exportfs[26877]: exportfs: Failed to stat /home/user/Sites/sitename.com/tre
nov   15 14:56:22 pc exportfs[26877]: exportfs: Failed to stat /home/user/Sites/sitename.com/sit
nov   15 14:56:22 pc systemd[1]: nfs-server.service: Control process exited, code=exited status=1
nov   15 14:56:22 pc systemd[1]: nfs-server.service: Failed with result 'exit-code'.
nov   15 14:56:22 pc systemd[1]: Stopped NFS server and services.

So now it turns out that nfs-server.service randomly has errors. Randomly - since I don’t recon making any changes to the host machine except for rebooting.