diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b9ea731..0e7d9612d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ BUG FIXES: - guests/arch: use systemd way of setting host names. [GH-2041] - guests/debian: Force bring up eth0. Fixes hangs on setting hostname. [GH-2026] + - hosts/bsd: Nicer error if can't read NFS exports. [GH-2038] - hosts/fedora: properly detect later CentOS versions. [GH-2008] - providers/virtualbox: VirtualBox 4.2 now supports up to 36 network adapters. [GH-1886] diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 05898297a..791e2bcc4 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -335,6 +335,10 @@ module Vagrant error_key(:not_found, "vagrant.actions.vm.host_only_network") end + class NFSCantReadExports < VagrantError + error_key(:nfs_cant_read_exports) + end + class NFSNoGuestIP < VagrantError error_key(:nfs_no_guest_ip) end diff --git a/plugins/hosts/bsd/host.rb b/plugins/hosts/bsd/host.rb index bbff34041..ea72ff9d0 100644 --- a/plugins/hosts/bsd/host.rb +++ b/plugins/hosts/bsd/host.rb @@ -129,6 +129,8 @@ module VagrantPlugins end end end + rescue Errno::EACCES + raise Vagrant::Errors::NFSCantReadExports end protected diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 0f9d7f74b..b23e09fd9 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -365,6 +365,10 @@ en: A multi-vm environment is required for name specification to this command. multi_vm_target_required: |- This command requires a specific VM name to target in a multi-VM environment. + nfs_cant_read_exports: |- + Vagrant can't read your current NFS exports! The exports file should be + readable by any user. This is usually caused by invalid permissions + on your NFS exports file. Please fix them and try again. nfs_no_guest_ip: |- No guest IP was given to the Vagrant core NFS helper. This is an internal error that should be reported as a bug.