Bridged networking with virtualbox, ubuntu and static ips

Thu, 2008-08-07

This is a little howto where I explain how I configured bridged networking for virtualbox with static ips on an Ubuntu host in order to make the virtual machine accessible from outside the host system.

sudo aptitude install bridge-utils uml-utilities

sudo adduser $USER uml-net

Login again so the change takes effect.

Modify /etc/network/interfaces so it has the following content:

auto lo
iface lo inet loopback

iface eth0 inet static

auto eth0

auto tap0
iface tap0 inet manual
up ifconfig $IFACE up
down ifconfig $IFACE down
tunctl_user david

auto br0
iface br0 inet static
bridge_ports eth0 tap0

Restart networking:

sudo /etc/init.d/networking restart

Open virtualbox. Click on settings and choose network. Where it says “Attached to” select Host Interface. In the text field labeled “Interface Name” insert tap0.

Boot your guest OS and configure networking under your guest OS the same way you would configure any other machine on your local LAN.

Chapter 6, Virtual Networking, from the Virtualbox User Manual