Discussion:
[Pearpc-devel] PearPC + VDE network configuration: success
Pierre Letouzey
2006-09-04 11:46:19 UTC
Permalink
Dear PearPC developers, dear VDE developers,

I'm glad to report that PearPC can use VDE (virtual distributed
ethernet, http://vde.sf.net) for networking between host and
virtual machine, and that without any change to the current version
0.4 of PearPC

Some time ago, in this messsage:
http://sourceforge.net/mailarchive/message.php?msg_id=14810891
I mentionned that I wasn't so happy with the way PearPC configures its
network, i.e. by allocating a tun/tap interface at each run and
configuring this interface via the setuid scripts/ifppc_up. At that
time I proposed another way, that is to allocate and configure once and
for all a tun interface, and patch PearPC for making use of this
static interface. Now, VDE allows to do exactly this, but without
the need for patching and recompiling PearPC. This is done by a
LD_PRELOAD trick, that redirects any use of tun/tap to the already
existing interface.

I've written some web pages where I describe how I use this VDE
network for both a PearPC OpenDarwin machine and other qemu images:

Main emulation page:
http://www.pps.jussieu.fr/~letouzey/emulator.en.html
Network configuration (static VDE interface, equipped with a dhcpd):
http://www.pps.jussieu.fr/~letouzey/emul_net.en.html
Page about OpenDarwin on PearPC:
http://www.pps.jussieu.fr/~letouzey/emul_darwin.en.html

Btw, an ready-to-run opendarwin image can be downloaded from this last
page. Additionally, since these pages are somewhat lengthy, here is a
quickstart for pearpc+vde on debian (should be similar on other distros):

1) install pearpc and vde
-------------------------
sudo apt-get install pearpc vde # this require a recent debian ( > sarge ? )
sudo adduser me vde-net # this way user me can play with vde networks

2) configure a tap0 interface
-----------------------------
in /etc/networks/interface add the following, and then run a ifup tap0:

auto tap0
iface tap0 inet static
address 192.168.0.1 # adapt to your needs !
netmask 255.255.255.0
vde-switch vde-net

3) launch the vde'd pearpc:
--------------------------
cd where_is_your_pearpc_stuff
# we don't need these nasty setuid scripts anymore, they should just still exist
mkdir scripts
ln -s /bin/true scripts/ifppc_up.setuid
ln -s /bin/true scripts/ifppc_down.setuid
export VDEALLTAP=/var/run/vde/tap0.ctl # or wherever is the vde tap0 control socket
export LD_PRELOAD=/usr/lib/libvdetap.so
ppc # or ppc.real on debian depending on where is your ppc.conf


Best regards,
Pierre Letouzey

Loading...