10 steps to a Xen domU

Last updated on

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

yum install vsftpd
service vsftpd start

5 – Mount our CentOS CD so we can access it via FTP

mount /dev/cdrom /var/ftp

6 – Download the xen boot kernel (required for initial boot of domU)

mkdir /boot/xen
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

mkdir /srv/xen
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 -

kernel = "/boot/xen/vmlinuz-xen-install"
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

xm create -c domu-test

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”

name = "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!

Last updated by .

2 thoughts on “10 steps to a Xen domU

  1. Pingback: Create CentOS DomU on CentOS Dom0

  2. Pingback: xentutorial.com

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>