Bridged network: why choose specific adapter?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Juggalo
Posts: 40
Joined: 27. Jul 2008, 20:45

Bridged network: why choose specific adapter?

Post by Juggalo »

I got a cable and wireless network connection on my notebook (the host machine for my VMs). Depending on where I am, I use either cable or wifi.

Now, in my VMs, I use Bridged Adapter for the network connections. But I have to explicitly select either the cabled or wireless adapter (I mean here). So every time I switch my laptop to a different connection, I have to shutdown all VMs, change their network settings, and restart them.

Is there a way around this? If not, perhaps it's a good idea to make VBox use "the default or currently active connection"? Or add that option to the list of network adapters to choose from?


(This is especially inconvenient because for some reason you can't change any settings while the VM is running.. I can understand some settings (ram or cpu features) but NO settings at all..?)
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Bridged network: why choose specific adapter?

Post by vbox4me2 »

Your best solution would be to make a small VM proxy server or buy a 20$ router.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Bridged network: why choose specific adapter?

Post by Perryg »

You should be able to setup (2) adapters in the VBox settings and set one for the wired and one for the Wifi. Leave them both active and see if it will continue to run. You might get one that argues at start up but it would be a trade off if it works. You will need to set this up in the guest as well.
Juggalo
Posts: 40
Joined: 27. Jul 2008, 20:45

Re: Bridged network: why choose specific adapter?

Post by Juggalo »

vbox4me2 wrote:Your best solution would be to make a small VM proxy server or buy a 20$ router.
What do you mean with VM proxy server?
I do have a router (my laptop, as well as several other machines in my LAN, are behind a router). How would that help here?
Perryg wrote:You should be able to setup (2) adapters in the VBox settings and set one for the wired and one for the Wifi.
Oh, right.. Didn't think of that. Pretty good idea actually, I'll give that a try, thanks :)
Juggalo
Posts: 40
Joined: 27. Jul 2008, 20:45

Re: Bridged network: why choose specific adapter?

Post by Juggalo »

Small followup: it works OK with two virtual network cards, one binded to my wired connection, the other to wifi.

However, I frequently have one only of them in use, and then the other is disabled. If I then start the VM, VBox gives an error saying it cannot find network adapter X (the one that's disabled).
It's pretty inconvenient that I can't override that error. If I enable both connections in my host (even while one of them is still disconnected), then start the VM, and then disable the unused connection again, everything runs fine, so refusing to start the VM is really overkill.

Better yet, if it's still possible to somehow change the binded network card dynamically (while VM is running) that'd be great. It's just a retarded limitation.

Just to be sure: vbox4me2: what did you mean with VM proxy server or router? (how does that apply here?)

Tnx in advance.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Bridged network: why choose specific adapter?

Post by vbox4me2 »

Juggalo wrote:Just to be sure: vbox4me2: what did you mean with VM proxy server or router? (how does that apply here?)

Tnx in advance.
As simple as its says, make a VM to act as a router, hook the bridge to it as all other VM's, set cable connect to enable, issue addresses from the router VM. The router VM can then resolve adapters and such. Its sort of an open lan that routes via the VM router.
Juggalo
Posts: 40
Joined: 27. Jul 2008, 20:45

Re: Bridged network: why choose specific adapter?

Post by Juggalo »

But, then.. I'd still have the same problem for the router VM, right?

Simply put, my host machine does NOT always have the same connection enabled. Sometimes wired, sometimes wifi. And VBox can't switch runtime. Or do I miss your point?
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Bridged network: why choose specific adapter?

Post by vbox4me2 »

Correct, but a VM router(linux) is build do deal with multiple links that go up and down, setting the bridge to be up all the time for the router VM and for example a guest only lan to serve access via the router. In effect a 2 lan network.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Bridged network: why choose specific adapter?

Post by Perryg »

OK I may be missing something here but from what I understand you have a wireless router and the ability to connect via cable or wireless and this works on the host.
Only that you have a problem using this on the guest, and you were switching it manually by selecting one at a time what you wanted to use to connect to the network.
  • I suggested that you setup a second adapter in VBox and tell it to use the Eth0 and leave the first adapter to use the Wlan0.
  • Then you open the guest and let it autodetect that you have (2) Nic's installed and configure them to use Bridged and DHCP.
  • Now the part that is causing you problems is you say that you turn off, or disable it. That will not work. Once you pull the Nic from the system it is a bear to get it back without a reboot. You can remove the cable from the laptop and it will still be connected to the system just no signal. Same thing with the wireless. You can move away from the signal and it will loose connection but the physical hardware is still connected.
I have this exact setup on my laptop and it works. The only thing that I occasionally need to do is a (dhclient -r for Ubuntu)(ipconfig /renew on Vista) on the guest to renew a lease once the host has picked up a new connection to a different Wireless Access Point.

So if I am not getting this just disregard what I am saying. It has been a long weekend little sleep but the client is satisfied. :wink:
Post Reply