[vbox-dev] Setting linkstate using API?
karolinehaus at yahoo.de
Thu Jul 24 08:29:29 UTC 2014
No I'm pretty sure I'm getting the right machine object and the session is valid as well. I can change other properties.
Do I have to call saveSettings() after changing cableConnected, or will it have immediate effect without calling saveSettings()?
Klaus Espenlaub <klaus.espenlaub at oracle.com> schrieb am 18:56 Mittwoch, 23.Juli 2014:
On 23.07.2014 16:34, Karoline Haus wrote:
> Hi if I use VBoxManage I can disconnect a VM's virtual network cable
> using controlvm setlinkstate while the VM is running but I do not seem
> to be able to do that via the API/SDK. I don't seem to find the right
> commands to set. I tried to set cableConnected of INetworkAdapter but it
> does not allow me to change this while the VM is in running state. How
> can I unplug the cable via the API whilst the VM is running?
This means you're using the wrong Machine object, or completely lack the
session handling... it works fundamentally the same way as if the VM
isn't running: create a session, get a shared lock (an exclusive one
isn't possible while the VM is running), and use the Machine reference
associated with this session.
That one is writable.
> Basically I'm trying to simulate a network connection loss to the VM so
> that it then tries to obtain a new IP address via DHCP.
vbox-dev mailing list
vbox-dev at virtualbox.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vbox-dev