Using the Host Interface in VirtualBox
For my reference, I take a copy of the article at http://www.samlesher.com/fedora/bridge-network-interface-on-virtualbox-in-fedora-8/
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-12. Install the bridge-utils package from Yum:
$ su -
# yum install bridge-utils3. Create a configuration file for the bridge (br0):
# gedit /etc/sysconfig/network-scripts/ifcfg-br0Enter 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=off4. Add your NIC card (eth0 for me) to the bridge:
# gedit /etc/sysconfig/network-scripts/ifcfg-eth0Add this to the end of the file and save it:
# BRIDGE=br0Adding 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 br0Replace YOURUSERNAME with your username that you log into Linux as.
6. Restart the network and vboxnet services:
# service network restart
# service vboxnet restart7. 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.