centos源码安装Xen

本文详细介绍了如何在 CentOS 6.4 上从源码编译 Xen 和 Linux 内核的过程,包括安装必要软件、禁用 SELinux、打补丁、配置内核选项等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

一定要保持联网!!xen make期间会下载一些更新或者与当前版本配套的包,不下载,会出现各种错误,导致不成功!

安装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(原先的kernel改成module) /...
module (原先的initrd改成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.到这里安装完成,重启!

转载于:https://www.cnblogs.com/jiangyunmenglong/p/4099411.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值