-1

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!

Simple.guy
  • 362
  • 3
  • 15
  • I don't have any Idea about Vagrant, but one question, did u try to mount the filesystem using another PC via NFS and using the same options, if yes and it is successful, then the problem is more likely coming from vagrant; – Mouin Mar 21 '21 at 09:27
  • @Mouin: thanks for your help :) Unfortunately, executing the same command to mount the filesystem from another computer gives the same error ```mount.nfs: requested NFS version or transport protocol is not supported```. [I had to change the IP address to connect to the host from another machine.] – Simple.guy Mar 21 '21 at 18:26

1 Answers1

0

I think I found the problem: the Linux kernel in the host and the guest was v5.10 and not v5.4, which is the default version for Ubuntu 20. The issues with NFS disappeared after I got back to kernel v5.4. I think it is related to kernel v5.6 disabling the UDP protocol support for NFS: https://cateee.net/lkddb/web-lkddb/NFS_DISABLE_UDP_SUPPORT.html

Simple.guy
  • 362
  • 3
  • 15