These instructions are for using a virtual machine in VirtualBox using a bridged network connection instead of a NAT connection. This makes the virtual machine behave more like a regular machine on your network, using its own IP from your network, etc. These instructions assume static ip addresses. These changes will remain in place after the machine is rebooted.
1. If you don’t have VirtualBox installed yet, install it. You can download it here, the Fedora 7 RPM installed correctly for me on Fedora 8. I downloaded it, then installed it with this command:
$ su -
# yum --nogpgcheck install VirtualBox-1.5.2_25433_fedora7-1
2. Install the bridge-utils package from Yum:
$ su -
# yum install bridge-utils
3. Create a configuration file for the bridge (br0):
# gedit /etc/sysconfig/network-scripts/ifcfg-br0
Enter the following in this file and save it:
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.100.2 #enter the IP you use for the host machine here
NETMASK=255.255.255.0 #enter the correct subnet mask for your network
GATEWAY=192.168.100.1 #enter the correct default gateway for your network
DELAY=0
STP=off
4. Add your NIC card (eth0 for me) to the bridge:
# gedit /etc/sysconfig/network-scripts/ifcfg-eth0
Add this to the end of the file and save it:
# BRIDGE=br0
Adding this line results in the eth0 interface being added to the br0 bridge whenever the host machine boots.
5. As root, create a permanent virtual interface for the virtual machine to use and add it to the bridge:
# VBoxAddIF vbox0 YOURUSERNAME br0
Replace YOURUSERNAME with your username that you log into Linux as.
6. Restart the network and vboxnet services:
# service network restart
# service vboxnet restart
7. In your virtual machine settings in Virtual Box, in the Network section, choose ‘Host Interface’. The Interface Name is vbox0.
8. If you are using Windows XP in your virtual machine, boot into it, go into the TCP/IP settings, and specify the IP address, Default Gateway, and DNS servers as if you are adding a normal client to your network.
You should now be able to access your WIndows XP virtual machine as if it were a normal machine on your network. Note that you may have to disable or modify the Windows XP firewall for some network activities.
Comments
Thanks for posting this. This almost worked for me on Fedora 9, x86_64; I had to add a step before it would all work. I had to add ‘br0′ as a trusted interface in the firewall. I used the ‘system-config-network’ gui to do this.
Thanks!
I tried to do this 2 months
and never can do it,
and now I could.
you are the best it has explained.
Thank you very much.
2 meses buscando en google y en ningún lado
encontré como crear bien el puente
para la Interfaz Anfitrión en Fedora.
Saludos
Thank you very much. It works. Took me so long to find out how to solve the problem.
But I have to change the sequence of step 5 and 6.
Step 5:
# service network restart
Step 6:
# VBoxAddIF vbox0 YOURUSERNAME br0
# service vboxnet restart
Thanks for your info…
But how about..
A. I’m using a HOST computer with *FIXED* IP …and
B. Using GUEST OS with DHCP …
what should I set?
Did not quite work for me. here was my solution
VirtualBox Host Interface on FC7 HOST with a static IP on the VBox Guest OS
============================================================================
HOST
——
#uname -a
Linux localhost.localdomain 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:35:01 EDT 2007 i686 i686 i386 GNU/Linux
# rpm -qa | grep VirtualBox
VirtualBox-1.6.4_33808_fedora7-1
We are going to use eth1 on the Host with br0
We are going to use eth1 on the Guest
1. (HOST) – edit /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
DELAY=0
STP=off
2. (HOST) – edit /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BRIDGE=br0
3. (HOST) – restart the network on the HOST
/etc/init.d/network restart
4. (HOST) – find the userid of the process that will run VirtualBox
ps -ef | grep -i virtual
5. (HOST) – add ther Virtual Inteface that the Guest will use
VBoxAddIF vbox0 userid br0
6. (HOST) – change permission on the tunnel device
sudo chmod 0666 /dev/net/tun
7. (Guest) – start virtualbox
8. (Guest) – edit a FC7 Virtual Machine
Machine -> Settings ->Network ->Adapter 1
[x] Enable Network Adapter
Atached to: Host Interface
[x] Cable connected
Adapter Type: (Leave it)
MAC Address (leave it or generate it)
Interface Name
vbox0
OK
9. (Guest) – start the FC7 Virtual Machine
10. (Guest) – Login and edit /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
HWADDR=00:16:17:8e:13:50
IPADDR=192.168.15.99 # or whaterver you want
NETMASK=255.255.255.0 # or whatever you want
GATEWAY=1921.68.15.1 # or whatever
11. (Guest) – edit DNS info /etc/resolv.conf
nameserver 192.168.15.1 # or whatever you DNS servers are
12. (Guest) – edit the zeroconf network /etc/sysconfig/network
(add the following line)
NOZEROCONF=yes
13. (Guest) – restart the network
/etc/init.d/network restart
perfectly working with winxp as well as win98. any body have any idea about win98 display driver for virtual box.
Raj
suse 11.1 host / winxp guest
1. No manual configuration required.
2. Set up network bridge during OS installation.
3. Configure br0 IP, bind to eth0; leave eth0 unconfigured.
4. Install VBox 2.2.2 or later.
5. In Vbox guest network settings, select bridge option, select br0 interface.
6. In guest OS, set static ip to same subnet as host, or use auto ip if dhcp server is present on your network.
Hi
I am beginner and need some help in making inter networking between host and virtual machine.On my machine these software are installed
1. ubuntu 9.04 (Host)
2. virtual Box 3.0.8
3. ubuntu 9.04 (virtual machine)
i have assigned the IP to host eth0 using file /etc/networking/interfaces. while on virtual machine eth0 ip assigned by VirtualBox. i am replacing this IP with same class which assigned host.
The problem is that, when i was send a ping command from host to virtual machine or virtual machine to host , then response is unreached host.
any tutorial or web link that helpful for me.thanks for advanced.







very good and i did and it worked thanks