I work with vagrant for several years, mostly creating and running Ubuntu 16/18 virtual machines (VMs). Recently, I tried to upgrade to Ubuntu 20 VMs and encountered the following error:
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.121.1:/home-local/some_user/vagrant_demo/tmp /home/vagrant/shared
Stdout from the command:
Stderr from the command:
mount.nfs: requested NFS version or transport protocol is not supported
A snippet from my Vagrantfile
:
Vagrant.configure("2") do |config|
...
config.vm.box = "generic/ubuntu2004"
...
config.vm.synced_folder ".", "/home/vagrant/shared", type: "nfs"
...
end
So I tried to specify a newer NFS version by adding nfs_version: 4
to my Vagrantfile
but still got the same error:
mount.nfs: requested NFS version or transport protocol is not supported
I also tried to fix the Vagrantfile
with nfs_version: 4, nfs_udp: true
but then got another error:
mount.nfs: an incorrect mount option was specified
Some more details: the host machine has Ubuntu 20 LTS and Vagrant 2.2.10. I'm asking here (rather than reporting a bug in the vagrant github repo) because it seems like an NFS configuration issue. Any help would be appreciated!