diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ed0ae148..fcff49a92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ BUG FIXES: - Error message if private key for SSH isn't owned by the proper user. [GH-1503] - Don't error too early when `config.vm.box` is not properly set. + - Show a human-friendly error if VBoxManage is not found (exit + status 126). [GH-934] ## 1.1.4 (March 25, 2013) diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 58cf99887..6f2bc79c9 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -427,6 +427,10 @@ module Vagrant error_key(:vboxmanage_error) end + class VBoxManageNotFoundError < VagrantError + error_key(:vboxmanage_not_found_error) + end + class VirtualBoxInvalidVersion < VagrantError error_key(:virtualbox_invalid_version) end diff --git a/plugins/providers/virtualbox/driver/base.rb b/plugins/providers/virtualbox/driver/base.rb index 36c4df22f..22dcfe96d 100644 --- a/plugins/providers/virtualbox/driver/base.rb +++ b/plugins/providers/virtualbox/driver/base.rb @@ -288,6 +288,8 @@ module VagrantPlugins if r.exit_code != 0 if @interrupted @logger.info("Exit code != 0, but interrupted. Ignoring.") + elsif r.exit_code == 126 + raise Vagrant::Errors::VBoxManageNotFoundError else raise Vagrant::Errors::VBoxManageError, :command => command.inspect end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index ea79dd3ea..3ce80cbe0 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -387,6 +387,11 @@ en: For more information on the failure, enable detailed logging by setting the environment variable VAGRANT_LOG to DEBUG. + vboxmanage_not_found_error: |- + The "VBoxManage" command or one of its dependencies could not + be found. Please verify VirtualBox is properly installed. You can verify + everything is okay by running "VBoxManage --version" and verifying + that the VirtualBox version is outputted. virtualbox_invalid_version: |- Vagrant has detected that you have a version of VirtualBox installed that is not supported. Please install one of the supported versions