[vbox-dev] Unable to get a session - lockMachine

Bikram Gupta bikramkgupta at gmail.com
Mon Jan 16 22:45:29 PST 2012


Hi,

I've tried all possible options so far, but no avail. Running the following:

- Ubuntu host 11.10
- Virtualbox 4.1.8
- Vbox SDK 3.2.12

I've made sure no other process (like virtualbox) is running on the system.
My goal is to just get a session and it doesn't work.

+++++++++++

bikram at bikram-S3210SH:~/Cuckoo$ VBoxManage list vms
"cuckoo1" {800dad3e-165b-47ee-877a-5a58dbac3156}
"cuckoo2" {a7c01ad4-082e-4800-a911-56aebac8af2e}

bikram at bikram-S3210SH:~/Cuckoo$ VBoxManage showvminfo cuckoo1 | grep -i
state
State:           saved (since 2012-01-17T03:26:24.000000000)

bikram at bikram-S3210SH:~/Cuckoo$ cat test.py
import sys
import vboxapi

vbc = vboxapi.VirtualBoxReflectionInfo(False)
vb_mgr = vboxapi.VirtualBoxManager(None, None)
vbox = vb_mgr.vbox
mgr = vb_mgr.mgr

name = "cuckoo1"
machine = vbox.findMachine(name)
print "Found the machine"

session = mgr.getSessionObject(vbox)

try:
        machine.lockMachine(session, vbc.LockType_Shared)
except Exception, why:
        print "Unable to lock machine:",why
        #sys.exit(-1);
        raise

print "Never reached here!"
session.unlockMachine()

bikram at bikram-S3210SH:~/Cuckoo$

bikram at bikram-S3210SH:~/Cuckoo$ python test.py
Found the machine
Unable to lock machine:
Traceback (most recent call last):
  File "test.py", line 24, in <module>
    machine.lockMachine(session, vbc.LockType_Shared)
  File
"/usr/local/lib/python2.7/dist-packages/vboxapi/VirtualBox_constants.py",
line 710, in __getattr__
    raise AttributeError
AttributeError
bikram at bikram-S3210SH:~/Cuckoo$

++++++++++++++++++++++++

How do I debug what went wrong? All I need is a session using vboxapi.

Thanks for any suggestion/help.

Regards,
Bikram
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20120116/c261daa4/attachment-0001.html 


More information about the vbox-dev mailing list