I am trying to run a VirtualBox machine using the python sdk.
I ran the following commands (based on the documentation page 32):
from vboxapi import VirtualBoxManager
manager = VirtualBoxManager(None, None)
vbox = manager.vbox
name = "myVM"
mach = vbox.findMachine(name)
session = manager.mgr.getSessionObject(vbox)
progress = mach.launchVMProcess(session, "gui", "")
progress.waitForCompletion(-1) #successfully fires up myVM w/ GUI
manager.closeMachineSession(session) #error, see below
The error I get is:
raise AttributeError, "XPCOM component '%s' has no attribute '%s'" % (self._object_name_, attr) AttributeError: XPCOM component '@virtualbox.org/Session;1' has no attribute 'close'
I am trying to shutdown and close the VM from python.
Question:
How can I resolve this error and shut down the VM using python?