Friday, April 8, 2011

Installing Debian Squeeze (6.0) domU On CentOS 5.5 x86_64 dom0

This tutorial shows how to create a Debian Squeeze (6.0) domU on dom0 running CentOS 5.5 x86_64.

When installing Debian 6.0 domU on CentOS 5.5 x86_64 the following problems may arise:

Debian 6.0 uses Grub 2 and Xen 3.1.2 (default version on CentOS 5.5) will not be able to boot newly installed system using pygrub. When following official Debian documentation, the installed system may use wrong architecture and may not have Xen images installed at all.

The following command is used to launch the installation:

xm create -c /etc/xen/xm-debian.cfg install=true \
install-mirror=ftp://ftp.us.debian.org/debian \
install-installer=ftp://ftp.us.debian.org/debian/dists/squeeze/main/installer-amd64/20110106+b1/images

It will look for images in subdirectory netboot/xen. This directory also contains file xm-debian.cfg. Download this file and adjust disk, vif and other sections to suit your needs. This file is already filled with correct values for release (squeeze) and architecture (amd64). The file can also be adjusted to use preferred mirror.

After the system is installed and the domU is shut down, check if Xen kernel images have been installed and install them if necessary. After the images have been installed, copy them to /boot directory on dom0 and modify the Xen config to use custom kernel and ramdisk instead of pygrub.

kpartx -av /dev/data_vg/myvm-root
mount /dev/mapper/myvm-root1 /mnt
chroot /mnt
apt-get install linux-image-2.6.32-5-xen-amd64
exit
cp /mnt/boot/*xen* /boot
kpartx -d /dev/data_vg/myvm-root

Installing the xen kernel will generate the initrd image appropriate for domU.

The example Xen config:

name = "myvm" maxmem = 1024 memory = 1024 vcpus = 1 kernel = "/boot/vmlinuz-2.6.32-5-xen-amd64" root = "/dev/xvda1 ro" ramdisk = "/boot/initrd.img-2.6.32-5-xen-amd64" on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" disk = [ "phy:/dev/data_vg/myvm-root,xvda,w", "phy:/dev/data_vg/myvm-swap,xvdb,w"]

View the original article here


This post was made using the Auto Blogging Software from WebMagnates.org This line will not appear when posts are made after activating the software to full version.