diff --git a/lib/vagrant/driver/virtualbox.rb b/lib/vagrant/driver/virtualbox.rb index 0278a3623..238238ee3 100644 --- a/lib/vagrant/driver/virtualbox.rb +++ b/lib/vagrant/driver/virtualbox.rb @@ -41,7 +41,9 @@ module Vagrant end # Instantiate the proper version driver for VirtualBox - @driver = VirtualBox_4_1.new(@uuid) + driver_klass = VirtualBox_4_1 + @logger.info("Using VirtualBox driver: #{driver_klass}") + @driver = driver_klass.new(@uuid) if @uuid # Verify the VM exists, and if it doesn't, then don't worry @@ -61,6 +63,7 @@ module Vagrant :export, :forward_ports, :halt, + :import, :read_forwarded_ports, :read_bridged_interfaces, :read_guest_additions_version, diff --git a/lib/vagrant/driver/virtualbox_4_1.rb b/lib/vagrant/driver/virtualbox_4_1.rb index 65a82a3fb..7307cd83e 100644 --- a/lib/vagrant/driver/virtualbox_4_1.rb +++ b/lib/vagrant/driver/virtualbox_4_1.rb @@ -7,6 +7,8 @@ module Vagrant # Driver for VirtualBox 4.1.x class VirtualBox_4_1 < VirtualBoxBase def initialize(uuid) + super() + @logger = Log4r::Logger.new("vagrant::driver::virtualbox_4_1") @uuid = uuid end @@ -343,7 +345,7 @@ module Vagrant end def vm_exists?(uuid) - raw("showvminfo", uuid).exit_code != 0 + raw("showvminfo", uuid).exit_code == 0 end end end diff --git a/lib/vagrant/driver/virtualbox_base.rb b/lib/vagrant/driver/virtualbox_base.rb index 8c8f81088..3b1aa6ce9 100644 --- a/lib/vagrant/driver/virtualbox_base.rb +++ b/lib/vagrant/driver/virtualbox_base.rb @@ -128,7 +128,7 @@ module Vagrant # @param [String] ovf Path to the OVF file. # @param [String] name Name of the VM. # @return [String] UUID of the imported VM. - def import + def import(ovf, name) end # Returns a list of forwarded ports for a VM.