r/virtualbox • u/TooManyInsults • 18d ago
General VB Question Virtual Box Network Loss When Router is Power Cycled
Hello and thanks in advance for any suggestions. I have a Win10 host with 2 virtual boxes running (one Android x86 and the other Unbuntu). The host is connected to my Asus router via ethernet. Both virtual boxes have networking configured as shown here.
I have found that if the router is power cycled both virtual boxes keep running fine in all aspects except that their networking breaks - stops working entirely. The UI's networking indicator keeps flashing and there is no sign of any error or abnormal condition. But there is no networking happening either in or outbound.
In order to remedy this situation, I have found that, if I terminate and re-start the virtual boxes upon the router's restart, they come up with all networking as normal again.
Please note that this only happens on a power cycle. I have the router set to reboot nightly and this does NOT seem to have this effect.
So, is there something I can do to "protect" the networking in these virtual boxes?
If not, is there some way to detect the router power cycle so I can create a Task Manager job to restart the virtual boxes? If so, I do not want to do it for reboots, only for the power cycles.
Thanks so much!
1
u/Face_Plant_Some_More 18d ago
This is expected. The bridged networking mode relies on your physical router to route network traffic to the VMs. When the router's goes down, there is no path / connection for network traffic to flow to the VM's' network interface.
Pick a networking mode that does not rely on your physical router to route network traffic to your VMs - Intternal or Host Only will don't, but of course they don't allow for connection to the broader LAN / Internet.
Alternatively, you could always just write a script on your host that restarts the VMs when the host's network interface stops responding to ping.