Page 1 of 1
guest cable connection status follow host adapter?
Posted: 15. Jun 2010, 13:43
by mikewse
Question:
When using bridged networking, how can I have VBox automatically inform VMs that the physical network cable has been disconnected? (ie, have the virtual network cable's connection status follow the physical network cable)
Background:
In my current setup (Ubuntu 10.4, VBox 3.2.4, Windows guests), the network cable connection status follows only what is configured in Settings > Network > Advanced > Cable connected, and not the physical connection. This causes manual steps when disconnecting the laptop, moving, and connecting to another subnet, as the host will automatically update its DHCP IP address, but guests will not.
Re: guest cable connection status follow host adapter?
Posted: 15. Jun 2010, 21:06
by Sasquatch
You can create a script that will check for interface changes (cable connected or not) and pass that in a controlvm setlinkstate script using VBoxManage. E.g. like this, when the cable is pulled on the host, let it execute this as YOUR user, else the VM won't be known:
Code: Select all
VBoxManage controlvm setlinkstate1 off
Set it to 'on' when the cable it plugged back in. It's probably somewhere in /etc/network/if<state> folder or something. Google is your friend to find out how to run scripts that act on NIC changes.
Re: guest cable connection status follow host adapter?
Posted: 16. Jun 2010, 09:40
by mikewse
Many thanks, that sounds doable! The /etc/network/ifup.d | ifdown.d directories seem like a good match to put my "react on cable connect/disconnect" scripts, and then looping over the vms in
doing
Code: Select all
VBoxManage controlvm <vm> setlinkstate1 <state>
for each of them.
Do you think this feature qualifies for the "Suggestions" section, to be added as a native feature in VBox?
Re: guest cable connection status follow host adapter?
Posted: 17. Jun 2010, 23:01
by Sasquatch
Maybe, depends on how it will be implemented, or how you want it to be. I'd say that it must be an option, not a given default without modification possible. Sometimes you MUST have a connection on the Guest, not matter what. You also need to have this done ONLY when you use Bridged, nothing else. Next to the physical cable, you have to consider wireless too. I would personally hate it if the VM gets a cable disconnect when I'm switching access-points and thus loose wifi for a second. Applications might not have an issue with it on the Host, but the Guest could get some problems instead.
Re: guest cable connection status follow host adapter?
Posted: 22. Jun 2010, 09:32
by mikewse
Re: guest cable connection status follow host adapter?
Posted: 23. Jun 2010, 21:46
by Sasquatch
Bugtracker (separate account needed) is a better place for that.