如何在CentOS下使用yum安装xen4.2.-成都快上网建站

如何在CentOS下使用yum安装xen4.2.

本篇内容主要讲解“如何在CentOS下使用yum安装xen 4.2.”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“如何在CentOS下使用yum安装xen 4.2.”吧!

成都创新互联是专业的正宁网站建设公司,正宁接单;提供网站设计、成都做网站,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行正宁网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

1.下载kernel-xen repo镜像

代码如下:

wget http://us3.mirror.crc.id.au/el6/x86_64/kernel-xen-release-6-4.noarch.rpm
rpm -ivh kernel-xen-release-6-4.noarch.rpm

2 安装xen 内核及其相关软件

代码如下:

yum install-y xen kernel-xen xen-libs python-virtinst bridge-utils
reboot

3.重新编译libvirtrpm包,因为CentOS 6 中的libvirt去掉了对xen支持

代码如下:

mkdir-p /root/src/
cd/root/src
wget ftp://ftp.redhat.com/pub/redhat/Linux/enterprise/6Server/en/os/SRPMS/libvirt-0.8.1-27.el6.src.rpm
rpm -i libvirt-0.8.1-27.el6.src.rpm
wget http://pasik.reaktio.net/xen/patches/libvirt-spec-rhel6-enable-xen.patch
cd/root/rpmbuild/SPECS
cp-a libvirt.spec libvirt.spec.orig
patch -p0 < ~/src/libvirt-spec-rhel6-enable-xen.patch
yum installebtables libcgroup lzop iscsi-initiator-utils lvm2 DNSmasq xen-devel nfs-utils libnl-devel xhtml1-dtds libudev-devel libpciaccess-devel yajl-devel libpcap-devel avahi-devel parted-devel device-mapper-devel numactl-devel netcf-devel python-devel autoconf automake libtool libxml2-devel readline-devel ncurses-devel gnutls-devel cyrus-sasl-devel libcap-ng-devel libcurl-devel
rpmbuild -bb libvirt.spec
/root/rpmbuild/RPMS/x86_64
rpm -Uvh --force libvirt-0.8.1-27.el6.x86_64.rpm libvirt-client-0.8.1-27.el6.x86_64.rpm libvirt-python-0.8.1-27.el6.x86_64.rpm

4. 配置网卡为桥接模式

例如:

代码如下:

cd/etc/sysconfig/network-scripts/
cp-a ifcfg-eth0 ifcfg-br0
ifcfg-br0 内容为
DEVICE="br0"
BOOTPROTO="none"
HWADDR="6C:92:BF:00:40:CA"
NM_CONTROLLED="yes"
IPADDR=172.19.10.21
ONBOOT="yes"
type="Bridge"
NETMASK="255.255.255.0"
#UUID="a833937d-9306-44d3-a011-b941d4c4dd7b"

ifcfg-eth0修改如下

修改完毕重启网卡

代码如下:

service network restart

5.最后修改/boot/grub/grub.conf

代码如下:

grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda8
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.6.7-1.el6xen.x86_64)
root (hd0,0)
kernel /xen-4.2.gz dom0_mem=4096M
module /vmlinuz-3.6.7-1.el6xen.x86_64 ro root=UUID=1b782dd8-0693-4336-b3b3-512f8f1ed548 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
module /initramfs-3.6.7-1.el6xen.x86_64.img
title CentOS (2.6.32-279.14.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.14.1.el6.x86_64 ro root=UUID=1b782dd8-0693-4336-b3b3-512f8f1ed548 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-279.14.1.el6.x86_64.img
title CentOS (2.6.32-279.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=UUID=1b782dd8-0693-4336-b3b3-512f8f1ed548 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-279.el6.x86_64.img

6.重启linux

到此,相信大家对“如何在CentOS下使用yum安装xen 4.2.”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!


分享题目:如何在CentOS下使用yum安装xen4.2.
本文网址:http://kswjz.com/article/iehheg.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流