[vbox-dev] Fail to restore snapshot remotely

Alex alex.lavoro.propio at gmail.com
Tue Aug 10 15:00:23 GMT 2010

I try to restore the snapshot of a Saved/PowerDown machine but fail.

The VM has a snapshot called 'snapshot' before it's powered on. The VM has
powered on by IVirtualBox::openRemoteSession().

  // 'manager' is a IWebSessionManager objec
  // 'vbox' is a IVirtualBox object
  ISession session = manager.getSesscionObject(vbox);
  // machine
  vbox.openExistingSession(session, machine.getId());
  ISnapshot snapshot1 = machine.findSnapshot("snapshot1");
  IProgress progress = session.getConsole().saveState();
  long result = progress.getResultCode();

Error from vboxwebsrv.exe:

  API return code:            0x80BB0002 (VBOX_E_INVALID_VM_STATE)
  COM error info result code: 0x80BB0002
  COM error info text:        The virtual machine is being powered down

Several notes:
* Even if I do powerDown() instead of saveState(),restoreSnapshot() still
* I call ISession::getState() before restoreSnapshot(), and it's CLOSED.
This confuse me. The documentations says restoreSnapshot() cannot be
executed on a running machine, so I power it down first, but after powering
down, the session is *closed*, meaning that I cannot use the session object
to restore the snapshot.
* I notice that phpvirtualbox doesn't use IWebSessionManager and neither
openRemoteSession(). Instead it uses openSession() to open a direct session.
I cannot do this since I am doing every operations remotely instead of
writing a

Alex Barna.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100810/04dd6c2f/attachment.html>

More information about the vbox-dev mailing list