[vbox-dev] How-to get network statistics and guest IP addresses from python API ?

Alexey Eromenko al4321 at gmail.com
Wed May 18 16:19:52 GMT 2011


Hi,

I wanna implement VBox network statistics and guest IP addresses in
GNS3 network simulator.

I need the python equivalents of those:
1.
$ VBoxManage debugvm "Windows XP VM01" statistics
<Counter c="14785402" unit="bytes" name="/Drivers/IntNet-0/Bytes/Received"/>
2.
$ VBoxManage guestproperty enumerate "Windows XP VM01"
Name: /VirtualBox/GuestInfo/Net/2/V4/IP, value: 192.168.247.1, timestamp:...

Unfortunately, those functions are poorly documented (in SDK), and I
have no idea from which classes they are inherited, and how-to call
them.
vboxshell doesn't help either.
--------------------------------------------------------------
Example code:

from vboxapi import VirtualBoxManager
mgr = VirtualBoxManager(None, None)
vbox = mgr.vbox
name = "Windows XP VM01"
mach = vbox.findMachine(name)
session = mgr.mgr.getSessionObject(vbox)

progress = mach.launchVMProcess(session, "gui", "")
progress.waitForCompletion(-1)
--------------------------------------------------------------

1.
IMachineDebugger::dumpStats() ??? Is this correct ?
How to do this in python ?

2.
session.enumerateGuestProperties("") ??? (this doesn't work)
How to do this in python ?

Thanks in advance,
-- 
-Alexey Eromenko "Technologov"




More information about the vbox-dev mailing list