VBoxAddIF no longer in Virtualbox 2.1.x

In Virtualbox 2.1.x. available network modes are:

  • NAT which allows guest to see the Internet but no to be seen by the host
  • Host network which give the guest a public IP
  • Internal network which allows several virtual machines to see each other, but still not to be seen by the host

The VBoxAddIF as disappeared so network between host and guest is no longer supported as a native option of Virtualbox 2.1.x. It easy to replace it by a TUN/TAP interface. Here is a /etc/network/interface example to do so:

iface eth0 inet dhcp
#allow routing for vmware and vbox
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE

iface tap0 inet static
pre-up tunctl -t tap0 -u xrunhprof

The virtual machine must then be configured to use a static IP from the 192.168.0.x range.