Merge pull request #9507 from briancain/fix-hyper-v-check
Fix Hyper-v and VirtualBox check
This commit is contained in:
commit
0b92123163
|
@ -1,3 +1,5 @@
|
|||
require 'vagrant/util/platform'
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderVirtualBox
|
||||
module Action
|
||||
|
@ -5,6 +7,7 @@ module VagrantPlugins
|
|||
class CheckVirtualbox
|
||||
def initialize(app, env)
|
||||
@app = app
|
||||
@logger = Log4r::Logger.new("vagrant::provider::virtualbox")
|
||||
end
|
||||
|
||||
def call(env)
|
||||
|
@ -13,6 +16,12 @@ module VagrantPlugins
|
|||
# which will break us out of execution of the middleware sequence.
|
||||
Driver::Meta.new.verify!
|
||||
|
||||
if Vagrant::Util::Platform.windows? && Vagrant::Util::Platform.windows_hyperv_enabled?
|
||||
@logger.error("Virtualbox and Hyper-V cannot be used together at the same time on Windows and will result in a system crash.")
|
||||
|
||||
raise Vagrant::Errors::HypervVirtualBoxError
|
||||
end
|
||||
|
||||
# Carry on.
|
||||
@app.call(env)
|
||||
end
|
||||
|
|
|
@ -78,12 +78,6 @@ module VagrantPlugins
|
|||
end
|
||||
end
|
||||
|
||||
if Vagrant::Util::Platform.windows? && Vagrant::Util::Platform.windows_hyperv_enabled?
|
||||
@logger.error("Virtualbox and Hyper-V cannot be used together at the same time on Windows and will result in a system crash.")
|
||||
|
||||
raise Vagrant::Errors::HypervVirtualBoxError
|
||||
end
|
||||
|
||||
# Fall back to hoping for the PATH to work out
|
||||
@vboxmanage_path ||= "VBoxManage"
|
||||
@logger.info("VBoxManage path: #{@vboxmanage_path}")
|
||||
|
|
Loading…
Reference in New Issue