# -*- coding: latin-1 -*-
import vboxapi

vbm = vboxapi.VirtualBoxManager("WEBSERVICE",
                                {"url":"http://192.168.1.10",
                                 "user":"fred",
                                 "password":"abracadabra"})
vb = vbm.vbox

vms = vbm.getArray(vb, 'machines')
for vm in vms:
    print vm.name
    print vm.description
    print vm.id
    print vm.OSTypeId
    print "Nb de Cpu:", vm.CPUCount
    print "Memoire:", vm.memorySize
    print "Memoire video", vm.VRAMSize
    print

mgr = vbm.mgr
session = mgr.getSessionObject(vb)
# one can also start headless session with "vrdp" 
progress = vb.openRemoteSession(session, "f7da9c62-bb0f-4561-8353-d279d4396d49", "gui", "")
progress.waitForCompletion(-1)
session.close()


