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

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 .




Related posts:
  1. KVM virtualization – text only CentOS guest install
  2. Remove all ZFS snapshots
  3. PXE boot WinPE 2 (Vista) using Linux as the PXE Server



SysAdminMan provides virtual PBX hosting based on Asterisk and Freeswitch.
Avaialble systems include FreePBX, PBX-in-a-Flash, Elastix, A2Billing and FusionPBX.
More details and prices can be found at sysadminman.net


2 Comments

  1. Create CentOS DomU on CentOS Dom0:

    [...] reference: http://wiki.centos.org/HowTos/Xen/InstallingCentOSDomU http://sysadminman.net/blog/2008/10-steps-to-a-xen-domu-39 [...]

  2. xentutorial.com:

    Quickstart guide to setting up Xen on CentOS…

    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 se…

Leave a comment