Sha256: 96f8f83189933e3a56b563e4945b4a852a49c2d8a385a81a5b1e462c03ade008

Contents?: true

Size: 1009 Bytes

Versions: 33

Compression:

Stored size: 1009 Bytes

Contents

require 'vagrant/util/platform'

module VagrantPlugins
  module ProviderVirtualBox
    module Action
      # Checks that VirtualBox is installed and ready to be used.
      class CheckVirtualbox
        def initialize(app, env)
          @app = app
          @logger = Log4r::Logger.new("vagrant::provider::virtualbox")
        end

        def call(env)
          # This verifies that VirtualBox is installed and the driver is
          # ready to function. If not, then an exception will be raised
          # 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
      end
    end
  end
end

Version data entries

33 entries across 29 versions & 4 rubygems

Version Path
vagrant-unbundled-2.3.3.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.3.2.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.19.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.18.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.16.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.14.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.10.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.9.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.8.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.7.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.6.2 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.6.1 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.6.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.5.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.4.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.3.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.2.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.2.0.0 plugins/providers/virtualbox/action/check_virtualbox.rb
vagrant-unbundled-2.1.4.0 plugins/providers/virtualbox/action/check_virtualbox.rb