Page 1 of 1

Unable to discard snapshot while VM is running

Posted: 12. Jun 2009, 15:51
by xsc0rchx
I don't know if this is just me or if anyone else has had this issue. If I start my VM are vrdp I am unable to discard the snapshot from the GUI. When I try and discard form the CLI I get the following error message.

VBoxManage snapshot Websense discardcurrent --state

VirtualBox Command Line Management Interface Version 2.2.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Cannot discard the current state of the running machine (nachine state: 4)
Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component Console, interface IConsole, callee nsISupports
Context: "DiscardCurrentState(progress.asOutParam())" at line 171 of file VBoxManageSnapshot.cpp

VBoxManage snapshot Websense discard PreSQL

VirtualBox Command Line Management Interface Version 2.2.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Cannot discard a snapshot of the running machine (machine state: 4)
Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component Console, interface IConsole, callee nsISupports
Context: "DiscardSnapshot(guid, progress.asOutParam())" at line 133 of file VBoxManageSnapshot.cpp

If I start the VM through the GUI and discard in the GUI it works when the VM is running.

Do I actually have to stop the VM before I can discard the Snapshot on the CLI? If so then what command is being used in the GUI that allows this to happen when the VM is running?

I have VirtualBox installed on xubuntu.

Re: Unable to discard snapshot while VM is running

Posted: 12. Jun 2009, 18:24
by TerryE
xsc0rchx wrote:Do I actually have to stop the VM before I can discard the Snapshot on the CLI? If so then what command is being used in the GUI that allows this to happen when the VM is running?
(i)Yes you do. (ii) There isn't a command.

If you think about it taking a snapshot is bumpless, or almost so. Rolling back is definitely not.

If you want to discard the current, then just power off, discard and restart the VM. I have a little script to do this, so on my server this takes about 15 seconds for my LAMP VMs.