diff --git a/lib/vagrant/action/vm/halt.rb b/lib/vagrant/action/vm/halt.rb index 2f6a13d14..4f4d8f7cd 100644 --- a/lib/vagrant/action/vm/halt.rb +++ b/lib/vagrant/action/vm/halt.rb @@ -13,7 +13,7 @@ module Vagrant if env[:vm].state != :poweredoff env[:ui].info I18n.t("vagrant.actions.vm.halt.force") - env[:vm].vm.stop + env[:vm].driver.halt end # Sleep for a second to verify that the VM properly diff --git a/lib/vagrant/driver/virtualbox.rb b/lib/vagrant/driver/virtualbox.rb index 21e8b1379..7db83b423 100644 --- a/lib/vagrant/driver/virtualbox.rb +++ b/lib/vagrant/driver/virtualbox.rb @@ -87,6 +87,11 @@ module Vagrant execute("modifyvm", @uuid, *args) end + # Halts the virtual machine. + def halt + execute("controlvm", @uuid, "poweroff") + end + # Imports the VM with the given path to the OVF file. It returns # the UUID as a string. def import(ovf, name)