10 steps to a Xen domU
Here’s a quick and easy way to get a CentOS Xen dom0 and domU up and running
1 - Boot using the CentOS CD
2 - When prompted for the package bundle selection just choose “Virtulization”
3 - Log into your new CentOS install as root
4 - Install the ftp server vsftpd. We’ll use this to install CentOS on our domU
service vsftpd start
5 - Mount our CentOS CD so we can access it via FTP
6 - Download the xen boot kernel (required for initial boot of domU)
cd /boot/xen
wget "http://mirror.centos.org/centos/5/os/i386/images/xen/initrd.img"
wget "http://mirror.centos.org/centos/5/os/i386/images/xen/vmlinuz"
mv vmlinuz vmlinuz-xen-install
mv initrd.img initrd-xen-install
7 - Create a 15GB domU virtual disk
dd if=/dev/zero of=/srv/xen/domu-test.img oflag=direct bs=1M seek=2047 count=15000
8 - Create the file /etc/xen/domu-test to look like this -
ramdisk = "/boot/xen/initrd-xen-install"
name = "domu-test"
memory = "256"
disk = [ 'tap:aio:/srv/xen/domu-test.img,xvda,w', ]
vif = [ 'bridge=xenbr0', ]
vcpus=1
on_reboot = 'destroy'
on_crash = 'destroy'
9 - Create and connect to your domU
You should now see your domU booting and can use your dom0’s FTP server to install CentOS
10 - After you have installed Xen on your domU and rebooted it you must change the file /etc/xen/domu-test to look like this this before restarting the domU again with “xm create -c domu-test”
memory = "256"
disk = [ 'tap:aio:/srv/xen/domu-test.img,xvda,w', ]
vif = [ 'bridge=xenbr0', ]
bootloader="/usr/bin/pygrub"
vcpus=1
on_reboot = 'destroy'
on_crash = 'destroy'
And that’s it. You should now have a working dom0 and domU!
Related posts:

Leave a comment