1,[root@localhost ~]# yum install xen kernel-xen

2,[root@localhost ~]# vim /etc/grub.conf

default=0 #change 1 to 0
timeout
=5
splashp_w_picpath
=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title
CentOS (2.6.18-238.12.1.el5xen)
        root
(hd0,0)
        kernel
/xen.gz-2.6.18-238.12.1.el5
       
module /vmlinuz-2.6.18-238.12.1.el5xen ro root=LABEL=/ rhgb quiet
        module /
initrd-2.6.18-238.12.1.el5xen.img
title
CentOS (2.6.18-194.el5)
        root
(hd0,0)
        kernel
/vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb quiet
        initrd /
initrd-2.6.18-194.el5.img

3,Close selinux and iptables
iptables
-F
iptables
-X
iptables
-Z

4, mount centos iso

[root@localhost ~]# mount -o loop /home/weekface/CentOS-5.5-i386-bin-DVD.iso /home/weekface/data/iso

5, start nfs
[root@localhost ~]# vim /etc/exports
/home/weekface/data/iso *(ro)

[root@localhost ~]# service portmap start
[root@localhost ~]# service nfs start

6, install

virt
-install -n vm01 -f /home/weekface/data/vm01.img -s 10 -r 512 nographics -l nfs:192.168.241.129:/home/weekface/data/iso

#virsh undefine vm01

7, 关闭domain0iptables
vim
/etc/xen/xend-conf.sxp
(network-script network-nat)
(vif-script vif-nat)

vim
/etc/xen/vm01
vif
= [ 'mac=00:16:3e:38:75:47, ip=10.0.0.101' ]
dhcp
="off"

8,在domainU
/etc/sysconfig/network-scripts/ifcfg-eth0
# Xen Virtual Ethernet
DEVICE
=eth0
HWADDR
=00:16:3e:38:75:47
ONBOOT
=yes
NETMASK
=255.255.255.0
IPADDR
=10.0.0.101
GATEWAY
=10.0.0.254
TYPE
=Ethernet

vim
/etc/resolv.conf
nameserver
211.91.88.129

vim
/etc/sysconfig/network
HOSTNAME
=vm01

/etc/init.d/network restart

做LVS实验之前,最好将Directer和RealServer的iptables全部关掉。