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
This commit is contained in:
Russ Garrett 2011-11-16 11:28:10 +00:00 committed by Mitchell Hashimoto
parent f095939800
commit ced99edd59
3 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -3,6 +3,7 @@ module Vagrant
class NFSConfig < Base
attr_accessor :map_uid
attr_accessor :map_gid
attr_accessor :version
end
end
end

View File

@ -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