0

How can I prevent and bring the internet back in my VirtualBox virtual machine when switching between Wifi networks or ethernet networks?

Currently Host OS is W7 and linux is my guest os.

I've tried the following with no success.

sudo ifconfig eth0 down
sudo ifconfig eth0 up

I've also tried disabling and enabling the internet in Network Sharing -> Advanced Settings.

EDIT: So I have tried both the following commands and using a usb wifi card(which doesn't work when you sleep). About bridge adapters

Useful links http://pastebin.com/raw.php?i=YGiu7S6s

William
  • 1,438

2 Answers2

1

So I never found a solution to this bug. I ultimately gave up and used VMWare.

I believe this might be only a Windows 7 bug but I'm not 100% sure.

William
  • 1,438
1

One easy way out of this is to bridge your vbox machine to your pysical network adapters manually. Like this.

enter image description here

Set adapter 1 to whichever you use more (ethernet or wifi) for good measure, and then adapter 2 to the other one. Now your virtual machine will have direct access to your host's network via a bridge. This creates a slight security hole by directly connecting your guest to your host (meaning some strains of malicious software may be able to infect your host through your guest more easily), but if you're not planning on test running viruses on the machine all the time you're good. This time when your host switches network adapters, depending on your configuration, the guest should reconnect as your host does automatically.

You would do well reading this too just to understand the differences.

Cestarian
  • 1,997