CentOS 6.4 Compiling Xen
一、准备(Prepare)
需要准备以下文件:
CentOS 6.4-x86_64(安装centos系统)
xen-4.1.2(xen内核源码文件)
linux-3.0.94(linux内核文件)
blktap2-3.0.patch(linux 内核补丁for xen,下载地址:ftp://ftp.enjellic.com/pub/xen/blktap2-3.0.patch)
安装CentOS的步骤此处略过。。。
二、安装
1.关闭SELinux(Disable SELinux)
# vim /etc/selinux/config
chage to SELINUX=disabled
# reboot
2.安装必要的库和软件(Pre-Requirements)
# yum groupinstall "Development tools" "Additional Development" "Debugging Tools" "System administration tools" "Compatibility libraries" "Console internet tools"
# yum install transfig wget texi2html libaio-devel dev86 glibc-devel e2fsprogs-devel gitk mkinitrd iasl xz-devel bzip2-devel pciutils-libs pciutils-devel SDL-devel libX11-devel gtk2-devel bridge-utils PyXML qemu-common qemu-img mercurial texinfo libuuid-devel
# yum install glibc-devel.i686
3.给linux内核打补丁(Patch blktap to kernel)
# cd /path/to/kernel
# patch -p1 < /path/to/patch
4.编译Dom0内核,这里我们用的是Linux(Compile the Dom0 kernel)
# cd path/to/kernel
# make clean
# make mrproper
# make menuconfig (also # vim .config)
下面是需要配置的项,其他项采用默认即可:
Device Drivers --->
[ * ] Block devices --->
<*> Block-device backend driver
Device Drivers --->
-*- Network device support --->
<*> Xen backend network device
Device Drivers --->
XEN driver support --->
[ * ] Xen memory balloon driver
[ * ] Scrub pages before returning them to system
<*> Xen /dev/xen/evtchn device
[ * ] Backend driver support
<*> Xen filesystem
[ * ] Create compatibility mount point /proc/xen
[ * ] Create xen entries under /sys/hypervisor
<*> userspace grant access device driver
General Setup --->
[ * ] Enable deprecated sysfs features to support old userspace tools
[ * ] Enable deprecated sysfs features by default
Device Drivers --->
[ * ] Block devices --->
<*> Blktap userspace devices
# make -j4
# make -j4 modules
# make -j4 modules_install
# make -j4 install
5.编译Xen内核(Compile Xen kernel)
# cd /xen/path
# make world
# make install
6.修改启动项(Configure grub configure)
# vim /etc/grub.conf
Like this:
title CentOS 3.0.94
root (hd0,0)
kernel /....
initrd /....
copy above four lines to before,like this:
title CentOS 3.0.94xen
root (hd0,0)
kernel /boot/xen-4.1.2.gz ( kernel /xen-4.1.2.gz, 看情况而定)
module /...
module /...
Add Xen to start configure:
# /sbin/chkconfig --add xend
# /sbin/chkconfig --add xencommons
# /sbin/chkconfig --add xendomains
# /sbin/chkconfig xend on
# /sbin/chkconfig xendomains on
# /sbin/chkconfig xencommons on
7.到这里安装完成,重启!