Category: Open Source


In this post I’ll show how to configure a VirtualBox appliance with bridge network on a Gentoo linux.

First, we’ll need tunctl to create a TUN/TAP device and brctl to setup a ethernet bridge:

emerge sys-apps/usermode-utilities
emerge net-misc/bridge-utils

Now, just add the lines bellow to your /etc/conf.d/net:

####################
# VirtualBox Bridge
####################
config_eth0="null"

tuntap_vbox0="tap"
tunctl_vbox0="-u <user>"
config_vbox0="null"

rc_need_br0="net.vbox0"
bridge_br0="vbox0 eth0"
config_br0="172.16.1.2/24"
routes_br0="default via 172.16.1.1"

brctl_br0="setfd 0 sethello 0 stp off"
  • Change “<user>” by the your user, i.e., the user that will use the VirtualBox.
  • The host machine (your Gentoo linux) will assume the IP address 172.16.1.2
  • If you have more than one vbox appliance that you want to use in bridge mode, just create an additional interface (vbox1, vbox2, etc)  configuration to each vbox host and include these interfaces to the variable bridge_br0

Create a symbolic link to these new interfaces (vbox0 and br0):

ln -s /etc/init.d/net.lo /etc/init.d/net.vbox0
ln -s /etc/init.d/net.lo /etc/init.d/net.br0

Start the new interfaces:

/etc/init.d/net.vbox0 start
/etc/init.d/net.br0 start

Check if the following lines are included in /etc/modules.autoload.d/kernel-2.6:

vboxdrv
vboxnetflt
vboxnetadp

After all infrastructure configuration, now we’ll configure the vbox appliance. Open the VirtualBox program, select the appropriate appliance, go to “Settings“  and change its newtork settings:

Attached to: Bridged Adapter
Name: vbox0

It’s exemplified in figure bellow:

click to enlarge

Now, you can boot the appliance and configure its IP address inside the range (172.16.1.3-172.16.1.254) and access it from the host machine (your Gentoo linux).

Note: this procedure was tested only on VirtualBox 3.1.6


These days I began to develop a new feature to Google Chromium and fix some ones (certain problems in Chromium gets me angry…very angry!!! =P).

I resolved to write this post because in the official build guide there is not mention how to workaround the problem with gcc-4.4 and the WebKit bug (you can see it here).

The problem resides in the file:

$CHROMIUM_ROOT/src/third_party/WebKit/WebCore/WebCore.gyp/webcore.target.mk

If you don’t apply this patch you will see various erroneous lines saying that there are undefined references into file libwebcore.a as these bellow:

undefined reference to findColor
undefined reference to findEntity
undefined reference to findValue

Pay attention: you have to apply the patch after synchronize your code with the remote repository and run the command “gclient runhooks –force” inside $CHROMIUM_ROOT/src or else the changes will be overwritten!

To apply the patch, just do it:

cd $CHROMIUM_ROOT
patch -p0 < /path/to/patch.doc

Some informations:

  • ccache statistics:

  • time compilation:
~  1h56m08s
  • target machine:
2.6.32-gentoo-r4-fx #1 SMP PREEMPT x86_64 Intel(R) Core(TM)2 Duo CPU T5250 @ 1.50GHz
  • tools:
  • gcc 4.4.3 / ccache 2.4

    Extra informations:

    • if you desire compile the code with ccache just change the Makefile inside $CHROMIUM_ROOT/src
    • all object code and binaries are put into directory $CHROMIUM_ROOT/src/out, if you wanna run a “make distclean” just remove this directory…this Makefile (from h3ll) does not have a distclean target!!!

    In the next article I will explain how to compile Google Chromium with LLVM/Clang ;)

    GNU’s 25th birthday party

    Happy Birthday GNU !!!

    In Setember 1983 was born a plan that later became GNU…

    Download the video Happy Birthday to GNU (Stephen Fry) and see the history behind GNU and the Richard Stallman’s plan.

    That’s all folks. =)

    Follow

    Get every new post delivered to your Inbox.