Thist page is under clonstruction, just putting available information together without special care for order.


Xen allows one to run several operating systems on one computer in parallel. It is a perfect testbed for this tutorial, since you can set up a whole network of several computers on your desktop without the need for hardware.

Xen is also faster then Qemu, which acomplishes a similar task.

Xen is tied to Linux, so you need a Linux computer. If you have not yet set up Linux or will test on a new computer I recommend using Debian Gnu/Linux, Testing distribution, since it should be the least hassle to set up and maintain without consuming the enourmous amounts of resources several other Linux distribution require.

Only Xen 3.x configuration is considered for this tutorial. I used the xen-hypervisor-3.0.3-1-i386 and xen-hypervisor-3.0.3-1-i686 apt package on a Pentium II and a Pentium IV PC respectively, and the linux-image-2.6.17-2-xen-686 as kernel.

The following is my /etc/xen/xend-config.sxp:

(loglevel NOTICE)
(xend-http-server yes)
(xend-port 3456)
(xend-address '')
(console-limit 2048)
(network-script network-bridge)
(vif-script vif-bridge)
(dom0-min-mem 64)
(dom0-cpus 0)

This is not especially elaborated, but rather the standard Debian setup. Memory requirements are reduced to grant more memory to Plan9 and the console-limit ist increased to be able to paste more lines from Linux to Plan9.



  • raw disks
  • disc images
  • /etc/xen/auto links After setting up the Xen instance configuration file you can start installation as the root user with:

    • xm create plan9inst -c
      If everything works right this will give you a console to a Plan9 kernel starting up, follow the procedure outlined in the Plan9 Wiki for Plan9 installation with Xen 3.0

However you may want to make a "p91inst" and a "p92inst" configuration file, sharing ro access to the cdrom drive, since the loopback access is dead slow, and you rather want to install the two Xen instances in parallel.

Be prepared to wait for hours for copying the distribution, however the resulting Plan9 computers are rather fast.

Also note, that you can do all this from the X-Windows-System, where you can copy and paste from this tutorial into the Plan9 console.

Mac Address

The virtual interfaces of Xen need to be given an ethernet or MAC address. I use :

  • vif = ['mac=50:6c:61:6e:39:xx']
    where xx is different for every machine in the network. The 50:6c:61:6e:39 is the string "Plan9` ascii/hexcoded. This is however arbitrary chosen, just be sure to use MAC addresses which do not conflict with other network adapters on your net.

Xen configuration

I use two different configurations for each Plan9 Xen instance: one for setup and another for the "production" system.

Installation / Maintenance

I had no luck accessing the cdrom drive or the cdrom image directly from within Xen. However I succeeded to use each of them after mounting them with the loopback device. Here is how to setup the loopback:

  • with the cdrom drive:
    losetup /dev/loop0 /dev/hdb
  • with the cdrom image:

    losetup /dev/loop0 /usr/xen9/plan9.iso
    Be sure to use a free loopback device, here is how to load the module if it is not yet loaded into the linux kernel, how to list the next available loopback device and how to deconfigure a used loopback device:

  • modprobe loop
    losetup -f
    losetup -d /dev/loop0

    Finally the Xen domU configuration file for installation

cat -> /etc/xen/plan9inst <<EOF
# LEG15112006
# /etc/xen/plan9inst
# Xen 3.0 domU config for Plan9 Installations

kernel = "/usr/xen9/9xeninst.gz"
memory = 96
name = "plan9inst"
#vif = [ 'mac=50:6c:61:6e:39:02' ]
# The first line is the install destination
# Change it!
# The second line is the CDROM image
disk = [ 'phy:hda3,sda,w',
          'phy:loop0,sdb,r' ]
restart = 'never'
# plan9.ini commands go here:


cat -> /etc/xen/porticus <<EOF
# LEG15112006
# /etc/xen/porticus
# Xen 3.0 domU config for Plan9 authserver

# Terminal kernel, for maintenance
#kernel = "/usr/xen9/9xenpcf.gz"

# CPU kernel, for production use
kernel = "/usr/xen9/9xenpccpuf.gz"
memory = 64
name = "porticus"
vif = [ 'mac=50:6c:61:6e:39:02' ]
disk = [ 'phy:hda3,sda,w']
restart = 'never'
# plan9.ini commands go here:
file & cpuserver
cat -> /etc/xen/schiefer <<EOF
# LEG15112006
# /etc/xen/schiefer
# Xen 3.0 domU config for Plan9 fileserver

# Terminal kernel, for maintenance
#kernel = "/usr/xen9/9xenpcf.gz"

# CPU kernel, for production use
kernel = "/usr/xen9/9xenpccpuf.gz"
memory = 110
name = "schiefer"
vif = [ 'mac=50:6c:61:6e:39:01' ]
disk = [ 'phy:hdc,sda,w' ]
restart = 'never'
# plan9.ini commands go here:

Xen Caveats

When the Hard disk is very busy the network connections get stalled on my test setup. However they seem to reover when the disk stops working.

Since this does not occur on Linux domU's I suppose it is either a problem with the Xen9 kernel, or with my hardware at home.