diff --git a/lib/vagrant/action/vm/discard_state.rb b/lib/vagrant/action/vm/discard_state.rb index 9fe58d779..408b4580f 100644 --- a/lib/vagrant/action/vm/discard_state.rb +++ b/lib/vagrant/action/vm/discard_state.rb @@ -11,7 +11,7 @@ module Vagrant def call(env) if env[:vm].state == :saved env[:ui].info I18n.t("vagrant.actions.vm.discard_state.discarding") - env[:vm].vm.discard_state + env[:vm].driver.discard_saved_state end @app.call(env) diff --git a/lib/vagrant/driver/virtualbox.rb b/lib/vagrant/driver/virtualbox.rb index c850a80c5..0a1786aa8 100644 --- a/lib/vagrant/driver/virtualbox.rb +++ b/lib/vagrant/driver/virtualbox.rb @@ -107,6 +107,11 @@ module Vagrant end end + # Discards any saved state associated with this VM. + def discard_saved_state + execute("discardstate", @uuid) + end + # Executes a raw command. def execute_command(command) raw(*command)