To build a Xen kernel (whether for the host or for the guest systems), use these instructions:
Getting Xen from the Debian repository
We now recommend that you use the Debian kernel if you are using Lenny. In that case, you should do:
On i386 machines:
apt-get install xen-linux-system-2.6.26-2-xen-686 libc6-xen xen-utils-3.2-1 xen-utils-common bridge-utils iproute bcc bin86
On 64 bits systems:
apt-get install xen-linux-system-2.6.26-2-xen-686 libc6-xen xen-utils-3.2-1 xen-utils-common bridge-utils iproute bcc bin86
On both system types, we recommend you to also do:
apt-get install make gcc libc6-dev zlib1g python python-twisted libcurl3 libcurl3 bzip2 module-init-tools transfig tgif libncurses5 patch libvncserver-dev libsdl-dev libjpeg62-dev bcc bin86 gawk pciutils-dev texinfo
You'll have to make a symlink to the python lib, as the Debian xen kernel doesn't provide it. A bug has been sent to the maintainer of the package, but he doesn't seem to care, unfortunately. Anyway, here's how:
ln -s /etc/alternatives/xen-default /usr/lib/xen
ln -s /usr/lib/xen-default/lib/python/xen /usr/lib/python2.5/site-packages/xen
Edit /boot/grub/menu.lst -- and set the first option to be something like this:
kernel /boot/xen-3.2.1.gz dom0_mem=393216
The only thing that you need to modify is the dom0_mem (why to set the mem to 384MB? some detailed information about this would be nice. would 256MB be enough?).
You might need to change this each time you install or upgrade a new kernel. Then you will also need to change a bit your /etc/xen/xend-config.sxp:
# Have the VNC listen on all interfaces
sed -i "s/#(vnc-listen '127.0.0.1')/(vnc-listen '0.0.0.0')/" /etc/xen/xend-config.sxp
# Set a default pass
gen_pass=`dd if=/dev/random bs=64 count=1 2>|/dev/null | md5sum | cut -d' ' -f1 | awk '{print substr($0,0,8)}'`
sed -i "s/(vncpasswd '')/(vncpasswd '${gen_pass}')/" /etc/xen/xend-config.sxp
# Increase the default dom0 min mem
sed -i "s/(dom0-min-mem 196)/(dom0-min-mem 384)/" /etc/xen/xend-config.sxp
# Set network-bridge and add anti-spoof to Xend
sed -i "s/(network-script network-dummy)/(network-script 'network-bridge antispoof=yes')/" /etc/xen/xend-config.sxp
and tweak a bit more your system:
echo "root: youremail@example.com" >>/etc/aliases
newaliases
/etc/init.d/postfix reload
mkdir /etc/xen/auto
That's about it for the Xen system part. If you wish to do everything from source, you can use the following, but it's quite outdated now:
Building Xen yourself
Once all this is done, you can proceed to from a DTC panel.