I am attempting to control a virtual machine through the VirtualBox XPCOM API. The goal is to start the machine at a known checkpoint, run it for a while, then stop it and return it to the same checkpoint. Starting it works, but stopping it sometimes fails with the output:

Assertion failed: [RT_SUCCESS (rc)] at '/home/vbox/vbox-2.2.4/src/ VBox/Main/MachineImpl.cpp' (7030) in nsresult Machine::saveStorageControllers(settings::Key&).
  Unknown Status 0x80070005 (-2147024891) - Unknown Status 0x80070005.
  Please contact the product vendor!

The VM starts in the Running state.  The failing code fragment is:

        result = false;

        /* should not be necessary according to manual,
           but VBoxConsoleWnd does this */
        {
          nsCOMPtr<IProgress> progress;
          rc = console->PowerDownAsync(getter_AddRefs(progress));
          if (NS_FAILED(rc))
            printf("PowerDown failed, rc=0x%x\n", rc);
          else
            progressReport(progress, "PowerDown");
        }
        {
          nsCOMPtr<IProgress> progress;
          rc = console->DiscardCurrentState(getter_AddRefs(progress));
          if (NS_FAILED(rc))
            printf("Error, discard current state failed! rc=0x%x\n", rc);
          else if (progressReport(progress, "DiscardCurrentState"))
            result = true;
        }

where progressReport awaits completion of the operation and prints any error message. The PowerDown operation succeeds, but DiscardCurrentState sometimes fails.

It appears that the problem has to do with the prior existence of a file {yadayadayada}.sav in the .VirtualBox/Machines/<machine name>/ Snapshots/ directory. After a failure, the various stock frontends also fail to revert to the current snapshot until this file is removed.

This failure happens with several recent versions of VirtualBox, including 2.2.4. The host is Ubuntu jaunty, the guest is Windows XP.

Am I doing something wrong, or have I run into a bug? If the latter, is there a known workaround? I can't find anything relevant in the recent forums or mail lists.

John Howard


_______________________________________________
vbox-users mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-users

Reply via email to