From ced99edd59293e364569c4794ba2e234911e1c4b Mon Sep 17 00:00:00 2001 From: Russ Garrett Date: Wed, 16 Nov 2011 11:28:10 +0000 Subject: [PATCH] Allow user to choose NFS protocol version, defaulting to 3 NFSv4 has siginificant added complexity in the form of ID-mapping which can cause problems with applications without extra setup. Best to force version 3 unless the user requests it. Conflicts: lib/vagrant/systems/linux.rb --- config/default.rb | 1 + lib/vagrant/config/nfs.rb | 1 + lib/vagrant/guest/linux.rb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) 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