[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


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

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

Unfortunately, those functions are poorly documented (in SDK), and I
have no idea from which classes they are inherited, and how-to call
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", "")

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

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