diff --git a/config/default.rb b/config/default.rb index 23bdb0361..ea076c664 100644 --- a/config/default.rb +++ b/config/default.rb @@ -26,6 +26,7 @@ Vagrant::Config.run do |config| config.nfs.map_uid = :auto config.nfs.map_gid = :auto + config.nfs.version = 3 config.package.name = 'package.box' end diff --git a/lib/vagrant/config/nfs.rb b/lib/vagrant/config/nfs.rb index f7aed1f42..9b005b157 100644 --- a/lib/vagrant/config/nfs.rb +++ b/lib/vagrant/config/nfs.rb @@ -3,6 +3,7 @@ module Vagrant class NFSConfig < Base attr_accessor :map_uid attr_accessor :map_gid + attr_accessor :version end end end diff --git a/lib/vagrant/guest/linux.rb b/lib/vagrant/guest/linux.rb index 5df45063c..36096a09e 100644 --- a/lib/vagrant/guest/linux.rb +++ b/lib/vagrant/guest/linux.rb @@ -60,7 +60,7 @@ module Vagrant # Do the actual creating and mounting @vm.channel.sudo("mkdir -p #{real_guestpath}") - @vm.channel.sudo("mount #{ip}:'#{opts[:hostpath]}' #{real_guestpath}", + @vm.channel.sudo("mount -o vers=#{opts[:version]} #{ip}:'#{opts[:hostpath]}' #{real_guestpath}", :error_class => LinuxError, :error_key => :mount_nfs_fail) end