I spent some time recently trying to figure out how to go about installing Debian Lenny as a Xen domU (guest) virtual machine on a CentOS 5.5 dom0. I found Andy’s article on the process, but had trouble getting it to work. I also found another article by Tom on how to install Xen and libvirt on Debian Lenny. If you skip down to the section “On to installing a virtual machine!”, we see how to install debian with the virt-install command.
Once this is done we can install our first virtual machine:
# virt-install \ --name=test-debian-install \ --ram=1024 \ --file-size=10 \ --nographics \ --paravirt \ --file=/var/lib/xen/images/test-debian-install.img \ --location=http://ftp.belnet.be/debian/dists/lenny/main/\ installer-i386
As it turns out, this command works out of the box on CentOS as well! You do need to install the libvirt package first, of course, but after that it just works. As a handy tip, the –location parameter can be set to your favorite debian mirror. I used http://ftp.ca.debian.org/debian/dists/lenny/main/installer-i386/, and that works just as well.
I prefer to use logical volumes instead of disk image files for my servers. Just create a new logical volume and change the –file parameter like this:
# lvcreate -L20G -n xenvm00 VolGroup00 # virt-install \ --name=test-debian-install2 \ --ram=1024 \ --file-size=10 \ --nographics \ --paravirt \ --file=/dev/VolGroup00/xenvm00 \ --location=http://ftp.ca.debian.org/debian/dists/lenny/main/\ installer-i386
Using the above instructions greatly simplifies the process of installing Debian Lenny as a Xen Guest under CentOS 5.5. Once the virt-install command completes, you will be presented with the standard Debian installer, and everything will proceed normally from there.