Update : With CentOS 5.6, you need updated rinse package. You can pick up version >= 1.8.1 from Debian Testing repository. Otherwise, you can add libuser, passwd and python-libs to /etc/rinse/centos-5.packages inside dom0 and run “cp /etc/modprobe.d/modprobe.conf.dist /etc/modprobe.conf” inside domU, just before the mkinitrd step.
Here are some hints for setting up Xen dom0 (server) on Debian Squeeze and running CentOS domU (guest in Xen terminology) on it. This procedure makes use of rinse tool, a debootstrap equivalent for CentOS.
First, follow this Debian wiki page for basic setup of the server. Debian recommmends to set up a network bridge by following the instructions in the manpage for bridge-utils-interfaces(5) instead of uncommenting
(network-script network-bridge)
in /etc/xen/xend-config.sxp.
You are now ready to create the image:
xen-create-image --hostname hostname.yourdomain --ip 192.168.0.1 --scsi --vcpus 2 --pygrub\ --install-method=rinse --dist centos-5
You can now mount the xen domU partition, I will assume you use LVM for domU:
mount /dev/vg_xen/hostname.yourdomain-disk /mnt
We also need those pseudo file systems:
mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys
Then, chroot into it:
chroot /mnt touch /etc/mtab touch /etc/fstab
Install CentOS Xen kernel:
yum install kernel-xen
Rebuild initrd with required Xen driver (block and network device)
mkinitrd --with=xenblk --with=xennet --preload=xenblk --preload=xennet\ -f /boot/initrd-2.6.18-194.26.1.el5xen.img 2.6.18-194.26.1.el5xen
Create /boot/grub/menu.lst:
# WARNING : Don't forget to update this when you upgrade kernel ! # You can also exclude kernel-xen from updates by putting # exclude=kernel-xen in in [main] in yum.conf default=0 timeout=5 title CentOS (2.6.18-194.26.1.el5xen) kernel /boot/vmlinuz-2.6.18-194.26.1.el5xen initrd /boot/initrd-2.6.18-194.26.1.el5xen.img
Open the inittab file and add the following line to it
co:2345:respawn:/sbin/mingetty console
and comment the following lines as shown below.
#1:2345:respawn:/sbin/mingetty tty1 #2:2345:respawn:/sbin/mingetty tty2 #3:2345:respawn:/sbin/mingetty tty3 #4:2345:respawn:/sbin/mingetty tty4 #5:2345:respawn:/sbin/mingetty tty5 #6:2345:respawn:/sbin/mingetty tty6
If that does not work, try replacing tty with console to the line specifying getty or mingetty like given below.
5:2345:respawn:/sbin/mingetty console
Set correct timezone:
ln -sf /usr/share/zoneinfo/Europe/Brussels /etc/localtime
Install root bash config files:
cp -p /etc/skel/.* /root
Exit chroot:
<Ctrl-D>
Unmount domU file systems:
umount /mnt/proc umount /mnt/sys umount /mnt
Boot the domU with “-c” option to open console:
xm create -c /etc/xen/hostname.yourdomain.cfg
You can exit console with “Ctrl + ]”.
You can enter console again with
xm console hostname.yourdomain
Install important missing packages:
yum install bind-utils file glibc man man-pages iptables mailx mc openssh-clients tcpdump telnet\ traceroute sysklogd zip unzip wget vixie-cron xauth
Enable and start syslog:
chkconfig syslog on /etc/init.d/syslog start
Enable and start crond:
chkconfig crond on /etc/init.d/crond start
You can install optionnal package groups as needed:
yum grouplist yum groupinstall "Development Libraries" "Development Tools" "X Software Development"\ "Legacy Software Development"
To list Xen dom:
xm list
To stop domU:
xm destroy hostname.yourdomain