The Art of Xen

xen.png
In order to install Zimbra without issues I had to setup Xen on my server. This was actually a good thing because I had been thinking of doing so for a while after experimenting with it last year.

Setting up Xen on OpenSUSE is relatively straightforward if you follow the Xen howto on the Wiki: http://en.opensuse.org/Installing_Xen3

The latest Xen OpenSUSE 10 files can be downloaded from here:
http://www.suse.de/~garloff/linux/xen/RPMs-100/

For my setup I have used the following /etc/fstab file on my virtual server:

/dev/hda1       /                reiserfs acl,user_xattr      1 1
/dev/hda2       swap         swap     defaults              0 0
proc               /proc          proc       defaults              0 0
sysfs              /sys           sysfs      noauto                0 0
usbfs             /proc/bus/usb        usbfs      noauto              0 0
tmpfs             /dev/shm             tmpfs      defaults              0 0
devpts            /dev/pts             devpts     mode=0620,gid=5       0 0
/dev/shm        /opt/zimbra/amavisd-new-2.3.3/tmp       tmpfs   defaults,users,size=150m,mode=777     0 0

I did initally have a lot of trouble setting up the network on the virutal instance but after a lot of experimenting with different Xen packages and configuration options I finally settled on the following file (/etc/xen/zimbra):

#  -*- mode: python; -*-

# configuration name:
name     = "zimbra"

# usable ram:
memory   = 512

# kernel und initrd:
kernel   = "/boot/vmlinuz-xen"
ramdisk  = "/boot/initrd-xen"

# boot device:
root     = "/dev/hda1"

# boot to run level:
extra    = "3"

# network
nics=1
vif = [ 'mac=aa:00:00:50:02:f0, bridge=xenbr0' ]
dhcp ="dhcp" 
hostname="zimbra"

# storage devices:
disk     = [ 'phy:system/mail,hda1,w','phy:system/mailswap,hda2,w' ]

One last thing is that the Xen howto modifies the virtual server's mtab file with the following line:

sed -e "s/^[1-6]:/#\\0/" < ./etc/inittab > ./etc/inittab.new

This command also commented out the default console as well as the other terminal consoles which meant that after installation there was no login prompt. In order to correct this edit the /etc/inittab file on the virtual server (whilst it is still mounted on the host system) and uncomment the following line:

1:2345:respawn:/sbin/mingetty --noclear tty1