Bridge Networking?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
BassKozz
Posts: 58
Joined: 4. Dec 2007, 18:30
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: XP & Win7

Bridge Networking?

Post by BassKozz »

I followed the following directions to setting up a Bridge Network:
https://help.ubuntu.com/community/VirtualBox wrote:Networking
To start, NAT is by far the easiest way to get your guests connected to the interweb, but you may want to use the guests as servers, for this you need Host Networking. You will need to install bridge-utils and uml-utilities so that you can make a tap device and add it to a bridge.

Code: Select all

sudo apt-get install bridge-utils uml-utilities 
Now make a bridge, and put your current interface into it:

Code: Select all

sudo tunctl -t tap1 -u fred #where fred is the user you will be running vbox as 
sudo chown root.vboxusers /dev/net/tun
sudo chmod g+rw /dev/net/tun
Set the permission to persist across reboots, by editing as root /etc/udev/rules.d/20-names.rules and changing:

Code: Select all

KERNEL=="tun",                          NAME="net/%k" 
to

Code: Select all

KERNEL=="tun",                          NAME="net/%k",  GROUP="vboxusers",     MODE="0660" 
Make a new bridge called br0:

Code: Select all

sudo brctl addbr br0 
Put your current interface (in this case eth0) into promiscuous mode, then add it to the bridge and give the bridge a dhcp address.

Code: Select all

sudo ifconfig eth0 0.0.0.0 promisc 
sudo brctl addif br0 eth0
dhclient br0
Add the new tap1 device to the bridge

Code: Select all

sudo brctl addif br0 tap1 
You should now be able to use host networking in vbox, just change "attached to" to "host interface" and add the interface name of tap1 in your networking settings. Read the manual as well, there are some other nifty ways to do this. Do not forget to use the root account when doing this. Also reboot your computer afterwords.
But it's not working for me, when I boot up the guest VM, it shows limited to no connectivity in XP :(
And after I rebooted Ubuntu, I tried to run my VM and I was presented with the following error:
Image
I tried to read the bridge networking directions in the users manual, but they went right over my head, can someone lend me a hand?
BassKozz
Posts: 58
Joined: 4. Dec 2007, 18:30
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: XP & Win7

Post by BassKozz »

NM, I re-read section 6.5.1.1 Debian and Ubuntu hosts of the Users Manual and I was able to get it working :oops:

The part of the manual that confused me was after step #4 it reads:
To set up a host interface using Debian and Ubuntu’s native methods, do the following
instead of step 4 above:
And then proceeds to go over 4 new steps...
  1. So which is better "native methods" or the other method (which I used - first 4 steps)?
  2. Also if I want to run 2 VM at the same time I would need to go thru the steps in the users manual again, but instead this time change br0 to br1 correct? or can I simply just create a vbox1 and attach it to br0 ?
BassKozz
Posts: 58
Joined: 4. Dec 2007, 18:30
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: XP & Win7

Post by BassKozz »

:BUMP:
BassKozz wrote:
  1. So which is better "native methods" or the other method (which I used - first 4 steps)?
  2. Also if I want to run 2 VM at the same time I would need to go thru the steps in the users manual again, but instead this time change br0 to br1 correct? or can I simply just create a vbox1 and attach it to br0 ?
Post Reply