Detect when the VirtualBox installation is incomplete and error

This commit is contained in:
Hunter Morris 2012-03-29 15:22:31 +01:00 committed by Mitchell Hashimoto
parent 9f6bc9ee03
commit db6cd14f9e
4 changed files with 16 additions and 0 deletions

View File

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

View File

@ -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("_")

View File

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

View File

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