Archive

Archive for February, 2006

QEMU and the network bridge

February 18th, 2006

QEMU’s user networking won’t do UDP out of the box, so I poked around online for a solution. What’s out on the web is a hodge-podge of tutorials, all of them different, and most of them for a non-current (read: not QEMU 0.8.0) release. This is a (equally poor) guide to get bridged networking working. FYI, my distro du jour is Ubuntu 5.10, and I hope to revise these instructions should the need arise to re-configure my setup.

First, check out How to install QEmu on Ubuntu Linux (Breezy) for some aptly named instructions.

From the tun/tap on ubuntu thread on Ubuntu Forums (probably not necessary?):

# apt-get install uml-utilities
# tunctl

From qemu ‘networking howto’:

# ifconfig eth0 down
# brctl addbr br0
# ifconfig eth0 0.0.0.0 promisc up
# ifconfig tun0 0.0.0.0 promisc up
# ifconfig br0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255 up
# brctl stp br0 off
# brctl setfd br0 1
# brctl sethello br0 1
# brctl addif br0 eth0
# brctl addif br0 tun0
# route add default gw 192.168.1.1

From djw’s qemu network bridge page, modify your /etc/qemu-ifup to something like:

#!/bin/sh echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
sleep 2

Finally, what they never tell you is how to start up QEMU. Little did I know that when you connect TAP to a VLAN, it doesn’t create the NIC for you. I wasted about a hour until I realized you need to append another `-net nic`. Here’s how I start QEMU:

qemu debian.img -kernel bzImage-2.6.14 -append "root=/dev/hda1" -net tap -net nic

Voila, mon ami. C’est tout!

Update: You’ll want to chmod 666 /dev/net/tun, and make sure you have the bridge-utils package.

Update 2: I have kernel config files for Linux 2.4.20, 2.6.11 (found these first two online), and 2.6.14. These build decently small kernels without modules that boot up in QEMU.

Computers, General, Linux ,

SCALE 4X

February 12th, 2006

After a couple years of putting it off, I can finally say I’ve gone to the Southern California Linux Expo (SCALE). I spent this weekened listening to a handful of really interesting speakers. Here were my highlights:

  • Zend’s Andi Gutmans talked about PHP 5 and the future of PHP. I haven’t done significant PHP work since 4 was released, so I found a lot of the new stuff pretty amazing. I was espeically impressed by a 2-line example of accessing the Google API via SOAP. TWO LINES.
  • David Schachter from Sleepycat (the makers of Berkeley DB) talked about how pervasive Berekley DB is in Linux systems. One thing I definitely walked away with was that a lot of people (myself previously included) myopically think relational databases are the only kind of databases around. Obviously, they’re not. I wish this was ingrained in me a couple years back.
  • Adam Leventhal, a Solaris kernel guy, talked about using DTrace to find hotspots in Linux apps. DTrace is purely a Solaris thing, but by running your Linux app in Solaris’ Linux sandbox, you get most of the interesting metrics.

And of course, Dan Kegel and Chris Dibona had interesting things to say.

Computers, General, Linux

RSI

February 12th, 2006

When I used OS X full time, I found a nifty little tool named AntiRSI. True to its name, it prevents you from working too long on the computer by eclipsing your screen and forcing you to take a break.

Fast forward about a year, and today I found out about Workrave. It reminds you to take breaks just like AntiRSI, but improves on the idea by giving suggestions of stretches. Even better, all it took was an `apt-get install workrave`:)

Postscript: Also saw this short article: Alleviate RSI the Hacker Way

Computers, General, Linux

Three orders of business…

February 11th, 2006
  1. This quarter was supposed to be a piece of cake–just three classes and work. But now I find it’s 2:32am, and I’m up hacking for this Linux/TCP project I’m hoping to finish by May. Let me rephrase that: I have to finish by May. In about 6 hours, I’m gonna force myself out of bed and over to SCALE 4X, the So Cal Linux Expo. Nine hours after that, I need to go to the airport, go home and find my way back for SCALE on Sunday. Oh, did I mention two midterms on Monday?
  2. I returned the Nokia 770 last weekend. I couldn’t get the VPN working 100% on campus, so it was 100% pointless to keep. Jerry and Brian were talking about betting how many days I’d actually keep/use it; I can’t believe they don’t have faith in my…attention span. Not only that, they’ven’t ceased ridiculing me about an external drive I bought at the Apple store.
  3. Lastly, I got an admissions email from Berkeley today, and it’s looking like I have another option as to what I’ll be doing next year. This better not be a mistake.

General