Hey all!

I'm using the VirtualBox COM API to start/stop/control a bunch of VMs 
using a Python script.
A functionality I don't get to work is change the properties of a 
network interface programmatically while the VM is running.

The same functionality works using the commandline tool 'vboxmanage 
controlvm':
 > vboxmanage controlvm VMNAME setlinkstate1 off

In Python this code doesn't have any effect on the running machine:
    mgr = vboxapi.VirtualBoxManager(None, None)
    session = mgr.getSessionObject(vm.vbox)
    VBOX_INFO = VirtualBoxReflectionInfo(False)
    vm.machine.lockMachine(session, vboxapi.VBOX_INFO.LockType_Shared)
    adapter = session.machine.getNetworkAdapter(1)
    adapter.cableConnected = False
    session.unlockMachine()

Does this have something to do with the way the session I lock the 
session? I tried vboxshell.py with the same outcome.

Thanks in advance! :)

Armin

_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to