diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cf836e18..262d41390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ IMPROVEMENTS: - Better VBoxManage error detection on Windows systems. This avoids some major issues where Vagrant would sometimes "lose" your VM. [GH-1669] + - Better detection of missing VirtualBox kernel drivers on Linux + systems. [GH-1671] ## 1.2.2 (April 23, 2013) diff --git a/plugins/providers/virtualbox/driver/base.rb b/plugins/providers/virtualbox/driver/base.rb index e9267fa18..5e9f9afb2 100644 --- a/plugins/providers/virtualbox/driver/base.rb +++ b/plugins/providers/virtualbox/driver/base.rb @@ -303,7 +303,16 @@ module VagrantPlugins # Sometimes, VBoxManage fails but doesn't actual return a non-zero # exit code. For this we inspect the output and determine if an error # occurred. + + if r.stderr =~ /failed to open \/dev\/vboxnetctl/i + # This catches an error message that only shows when kernel + # drivers aren't properly installed. + @logger.error("Error message about unable to open vboxnetctl") + raise Vagrant::Errors::VirtualBoxKernelModuleNotLoaded + end + if r.stderr =~ /VBoxManage([.a-z]+?): error:/ + # This catches the generic VBoxManage error case. @logger.info("VBoxManage error text found, assuming error.") errored = true end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 999336f47..b5d423b0b 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -528,8 +528,8 @@ en: %{supported_versions} virtualbox_kernel_module_not_loaded: |- 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. + run `VBoxManage --version` or open the VirtualBox GUI 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