<div dir="ltr">Hi,<div><br></div><div>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: </div>
<div><br></div><div><div>from vboxapi import VirtualBoxManager</div><div>vbox_mgr = VirtualBoxManager(None, None)</div><div>vm = machByName(vbox_mgr, "win64") </div><div>snap = vm.findSnapshot("1")</div>
<div>session = vbox_mgr.mgr.getSessionObject(vbox_mgr.vbox)</div><div>vm.lockMachine(session, 2);</div><div># session.console == None here</div><div><br></div></div><div>I've also tried to restore a snapshot using vboxshell frontend, and I get the same result:</div>
<div><br></div><div>'NoneType' object has no attribute 'restoreSnapshot'<br></div><div><br></div><div>I've tried it on 4.3.12 and on 4.3.14 - same result. </div><div><br></div><div>For a running VM the console object is there and everything works fine. I can also start VMs using "lauchVMProcess".</div>
<div><br></div><div>Is it a bug or is it a problem of my installation?</div><div><br></div><div>Thanks in advance,</div><div>Mikhail</div></div>