diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index eb0f78d0b..4204369f1 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -460,6 +460,10 @@ module Vagrant error_key(:nfs_no_valid_ids) end + class NFSNotSupported < VagrantError + error_key(:nfs_not_supported) + end + class NFSClientNotInstalledInGuest < VagrantError error_key(:nfs_client_not_installed_in_guest) end diff --git a/plugins/synced_folders/nfs/synced_folder.rb b/plugins/synced_folders/nfs/synced_folder.rb index fd10930e0..bcb9c7fd8 100644 --- a/plugins/synced_folders/nfs/synced_folder.rb +++ b/plugins/synced_folders/nfs/synced_folder.rb @@ -30,14 +30,9 @@ module VagrantPlugins if !machine.config.nfs.functional return false end - - # We don't currently support NFS on Windows - if Vagrant::Util::Platform.windows? - return false - end - - # NFS is always available - true + return true if machine.env.host.capability(:nfs_installed) + return false if !raise_error + raise Vagrant::Errors::NFSNotSupported end def prepare(machine, folders, opts) diff --git a/templates/locales/en.yml b/templates/locales/en.yml index a666fcbce..979b58372 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -813,6 +813,12 @@ en: No valid IDs were given to the NFS synced folder implementation to prune. This is an internal bug with Vagrant and an issue should be filed. + nfs_not_supported: |- + It appears your machine doesn't support NFS, or there is not an + adapter to enable NFS on this machine for Vagrant. Please verify + that `nfsd` is installed on your machine, and try again. If you're + on Windows, NFS isn't supported. If the problem persists, please + contact Vagrant support. nfs_client_not_installed_in_guest: |- No NFS client was detected as installed in your guest machine. This is required for NFS synced folders to work. In addition to this, Vagrant