diff --git a/CHANGELOG.md b/CHANGELOG.md index 47fb34b59..2424e3c6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Fix issue where VM import sometimes made strange VirtualBox folder layouts. [GH-669] - Call proper `id` command on Solaris. [GH-679] + - More accurate VBoxManage error detection. ## 0.9.3 (January 24, 2012) diff --git a/lib/vagrant/driver/virtualbox_base.rb b/lib/vagrant/driver/virtualbox_base.rb index ed1227e2e..2826362ae 100644 --- a/lib/vagrant/driver/virtualbox_base.rb +++ b/lib/vagrant/driver/virtualbox_base.rb @@ -260,6 +260,14 @@ module Vagrant else raise Errors::VBoxManageError, :command => command.inspect end + else + # 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 =~ /VBoxManage: error:/ + @logger.info("VBoxManage error text found, assuming error.") + raise Errors::VBoxManageError, :command => command.inspect + end end # Return the output, making sure to replace any Windows-style