The Crane Has Landed


VirtualBox networking…finally!
August 24, 2008, 4:42 pm
Filed under: Ubuntu | Tags: , ,

I honestly never thought I’d see the day, but I’ve finally found a way that seems to work (touch wood!) to allow me to run virtual machines in VirtualBox on my Ubuntu host, and allow two-way access to the network with a bridged interface!

Translation: my virtual machines have an IP address on my internal network and act as if they were machines on my network.

To do this, I’ve hunted high and low and the best summary page I found was this one.  Basically:

  1. Install brctl and uml-utilities
  2. Create the following script in /etc/rc.local, replacing everything in [ ]:
    tunctl -t tap0 -u [username]
      chmod 0666 /dev/net/tun
      /usr/sbin/brctl addbr br0
      /sbin/ifconfig eth0 0.0.0.0 promisc
      /usr/sbin/brctl addif br0 eth0
      /sbin/dhclient br0
      /usr/sbin/brctl addif br0 tap0
      ifconfig tap0 [IP for virtual machine] tunctl -t tap0 -u [username]
      chmod 0666 /dev/net/tun
      /usr/sbin/brctl addbr br0
      /sbin/ifconfig eth0 0.0.0.0 promisc
      /usr/sbin/brctl addif br0 eth0
      /sbin/dhclient br0
      /usr/sbin/brctl addif br0 tap0
      ifconfig tap0 [IP for virtual machine] up
      bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp'
      route add -host [VirtualBox server/PC IP address] dev tap0
      arp -Ds [VirtualBox server/PC IP address] eth0 pub
    exit 0
  3. In VirtualBox, set the virtual machine to have “Attached to” set to “Host interface” and the “Interface Name” to “tap0″.

It just works!  :)   You should be able to add other taps for other machines…I think.



Change the menu background colour in Gnome
August 24, 2008, 4:31 pm
Filed under: Ubuntu | Tags: , ,

Long have I wondered this and, as usual, the answer is pretty simple.

To gain finer control over the colours used by Gnome for the menu and panels etc:

  1. Create a file in /home/username/.gnome2 called .gtkrc-2.0
  2. Define the “style” block that you’d like to apply to a GTK element – e.g.:

    style "menu_color"
    {
    fg[NORMAL] = "#000000"
    fg[SELECTED] = "#CCCCCC"
    fg[ACTIVE] = "#CCCCCC"
    fg[PRELIGHT] = "#CCCCCC"
    fg[INSENSITIVE] = "#7099CC"
    bg[NORMAL] = "#7099CC"
    bg[SELECTED] = "#7099CC"
    bg[ACTIVE] = "#7099CC"
    bg[PRELIGHT] = "#7099CC"
    }
  3. Then apply it to the element in question using one of the following statements:

    widget "*PanelWidget*" style "my_color"
    widget "*PanelApplet*" style "my_color"
    widget_class "*MenuItem*" style "my_color"
    widget_class "*ToolItem*" style "my_color"
    widget_class "*SeparatorMenuitem*" style "my_color"
    widget_class "*SeparatorToolitem*" style "my_color"
    widget_class "*ImageMenuitem*" style "my_color"
    widget_class "*RadioMenuitem*" style "my_color"
    widget_class "*CheckMenuitem*" style "my_color"
    widget_class "*TearoffMenuitem*" style "my_color"
    widget_class "*Menu*" style "menu_color"
  4. Type killall gnome-panel in a terminal and you’re good to go.

This link has more discussion and detail.