diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f65def79..2b87b141e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Improve the SSH "ready?" check. [GH-841] - Human friendly error if connection times out for HTTP downloads. [GH-849] + - Detect when the VirtualBox installation is incomplete and error. [GH-846] ## 1.0.2 (March 25, 2012) diff --git a/lib/vagrant/driver/virtualbox.rb b/lib/vagrant/driver/virtualbox.rb index 9fecddb21..8c4009284 100644 --- a/lib/vagrant/driver/virtualbox.rb +++ b/lib/vagrant/driver/virtualbox.rb @@ -122,6 +122,12 @@ module Vagrant output = execute("--version") if output =~ /vboxdrv kernel module is not loaded/ raise Errors::VirtualBoxKernelModuleNotLoaded + # Check for installation incomplete warnings, for example: + # "WARNING: The character device /dev/vboxdrv does not + # exist. Please install the virtualbox-ose-dkms package and + # the appropriate headers, most likely linux-headers-generic." + elsif output =~ /Please install/ + raise Errors::VirtualBoxInstallIncomplete end parts = output.split("_") diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 1ec45c1ea..bd5b50516 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -388,6 +388,11 @@ module Vagrant error_key(:virtualbox_kernel_module_not_loaded) end + class VirtualBoxInstallIncomplete < VagrantError + status_code(79) + error_key(:virtualbox_install_incomplete) + end + class VMBaseMacNotSpecified < VagrantError status_code(47) error_key(:no_base_mac, "vagrant.actions.vm.match_mac") diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 03f8fbcd1..1d70599d0 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -184,6 +184,10 @@ en: VirtualBox is complaining that the kernel module is not loaded. Please run `VBoxManage --version` to see the error message which should contain instructions on how to fix this error. + virtualbox_install_incomplete: |- + VirtualBox is complaining that the installation is incomplete. Please + run `VBoxManage --version` to see the error message which should contain + instructions on how to fix this error. virtualbox_not_detected: |- Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed. Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires