[vbox-dev] Using python API bindings on Windows

Mikhail Kovalev mikhail.kovalev at gmail.com
Wed Jul 30 15:23:59 GMT 2014


I am trying to use Python API bindings on Windows to control virtualbox. I
have the following problem: when I create a session and lock a non-running
VM with this session, I do not get a reference to the console object. As a
result, I cannot control the non-running VM (e.g., I cannot restore a
snapshot). I've tried to use the following code:

from vboxapi import VirtualBoxManager
vbox_mgr = VirtualBoxManager(None, None)
vm = machByName(vbox_mgr, "win64")
snap = vm.findSnapshot("1")
session = vbox_mgr.mgr.getSessionObject(vbox_mgr.vbox)
vm.lockMachine(session, 2);
# session.console == None here

I've also tried to restore a snapshot using vboxshell frontend, and I get
the same result:

'NoneType' object has no attribute 'restoreSnapshot'

I've tried it on 4.3.12 and on 4.3.14 - same result.

For a running VM the console object is there and everything works fine. I
can also start VMs using "lauchVMProcess".

Is it a bug or is it a problem of my installation?

Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20140730/bdb149e2/attachment.html>

More information about the vbox-dev mailing list