Any teacher that can be replaced with a computer, deserves to be (David Thornburg)
Generally, old media don't die. They just have to grow old gracefully. Guess what, we still have stone masons. They haven't been the primary purveyors of the written word for a while now of course, but they still have a role because you wouldn't want a TV screen on your headstone. (Douglas Adams)
I love the poor. I feel that the poor are more sensible when you see the
antics of the rich. And for some reasons many Indians believe that
creating wealth is sinful.
Anyway although I have several physical machines with me I still prefer
not having to power them on, connect the power chord, the Ethernet
chord, use a switch/hub and so on.
How about a way to create a network without any of these?
But before that we need to know where I am coming from.
I am a networking geek and I make my living solving complex networking
problems. By that I mean really complex ones. In fact my product
SpamCheetah itself involves quite a bit of complex networking concepts.
The other thing that I want is use skype on OpenBSD, my favorite OS.
Skype runs on linux and FreeBSD using emulation. But I don't like
I don't want to run linux just for skype.
But there is an additional complication here. Audio has to work. But
for that I would have solved this problem long ago.
It turns out that qemu gives us this and much much more.
I am certain many of you know qemu already.
It is 100% open source and is a fabulous tool. It is fast. Real fast
even on incredibly low end hardware I use.
And it supports full networking using Qemu bridge mode or TUN/TAP mode of bridging computers together.
Every qemu instance forms part of the host bridge and it will behave
exactly like a computer attached to your switch/bridge.
Layer II bridging is great fun though I have only done qemu bridging and
never any physical bridging. I buy some cheapo non managed switch and I am
This article will deal with what you need to do to setup qemu bridging
so that you can run servers on your qemu instances.
I have this need.
All my products have web panels and I want to be able to access them
from qemu. By default qemu will only give you the ability to talk TCP to
the outside world and it will use the 10.0.0.0/8 network of the host.
This will suffice in many cases but not all.
Over a long period of time I have learned to use this switch when
starting qemu for bridge mode networking.
# qemu -net nic -net tap foo.bin
Be careful here. You are running as root. And you have to write to X. So
$ xhost +
on your host X server which most likely will run as a normal user.
It so turns out that qemu can do even more cool things.
Like audio for instance.
But before that I had another need.
I wanted my qemu instance to run far away and I did not know how to use
VNC or X from there. I did not want to , I know VNC Is not big deal.
It so turns out that qemu does brilliant serial port emulation and
OpenBSD also has excellent support for it. All I had to do is change the
OS to write to the serial port instead of the console. Under OpenBSD
this is done by
# cat > /etc/boot.conf
set tty com0
But on linux you need to do something different which I would not know.
And the way you start qemu is different(obviously).
$ qemu -nographic foo.bin
That is it.
It writes to the text mode terminal and it is fully functional in every
Now we come to audio.
Then finally wrap up this long and tedious article with how to do linux
bridging with bridge-utils and uml-utilities.
For audio, just type this.
$ qemu -audio-help
It prints a lot of stuff but we need only this line.
$ export QEMU_AUDIO_DRV=sdl
And start qemu with
$ qemu -soundhw all foo.bin
You get full audio support if your host has proper audio support.
I tested this with OpenBSD as host and slax linux as guest.