centos7或者centos6.5安装xen教程(折腾了几天的心血)

centos7或者centos6.5安装xen教程(折腾了几天的心血)
2018-07-24 分类:学习笔记 阅读(1621) 评论(0)
这几天换了几个Linux系统,都装不了xen,今天换成centos7试一下,果然就成功了……开心0.0

第一步:

安装centos7(教程百度,官方的系统,官方的源)

系统的下载连接是:http://mirrors.163.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1804.iso

安装系统的时候要记住选择

第二步:

安装系统之后,使用命令更新一下系统软件包,命令如下(本文全部都是用root用户进行,如果没有root用户,请自觉切换)

yum update -y

第三步:

安装bridge-utils包。

yum install bridge-utils

第四步:(请根据自己的系统在下面的(1)和(2)进行选择)

(1)对于CentOS 6、SL6和RHEL 6的系统请执行下面的命令:

yum install http://au1.mirror.crc.id.au/repo/kernel-xen-release-el6-latest.noarch.rpm

(2)对于CentOS 7、SL7,和RHEL 7的系统请执行下面的命令:

yum install http://au1.mirror.crc.id.au/repo/kernel-xen-release-el7-latest.noarch.rpm

第五步:

选择您的Xen版本:(作者安装的是xen 4.7,建议安装xen4.7)

Xen 4.5

yum install xen45

ls -l /boot/xen.gz

lrwxrwxrwx 1 root root 12 Sep 10 02:54 /boot/xen.gz -> xen-4.5.0.gz

Xen 4.6

yum install xen46

ls -l /boot/xen.gz

lrwxrwxrwx 1 root root 12 Sep 10 02:54 /boot/xen.gz -> xen-4.6.0.gz

Xen 4.7

yum install xen47

ls -l /boot/xen.gz

lrwxrwxrwx 1 root root 12 Sep 10 02:54 /boot/xen.gz -> xen-4.7.0.gz

Xen 4.9

yum install xen49

ls -l /boot/xen.gz

lrwxrwxrwx 1 root root 12 Sep 10 02:54 /boot/xen.gz -> xen-4.9.0.gz

第六步:

安装kernel-xen包。注意:在安装Xen之后必须单独执行此步骤。如果你同时安装xen和kernel-xen,kernel-xen包可能会先安装。这将导致所需的grub.conf条目配置失败。

yum install kernel-xen

全部选y,默认安装

第七步:

禁用SELinux。虽然selinux是一个好东西,但它真的与Xen无关。如果有人想要通过selinux来启用并且仍然有Xen工作,请给我发电子邮件!同时,通过编辑以下文件vi /etc/sysconfig/selinux来禁用它。(将SELINUX=enforcing修改成SELINUX=disabled 其他不变 )

This file controls the state of SELinux on the system.

SELINUX= can take one of these three values:

enforcing – SELinux security policy is enforced.

permissive – SELinux prints warnings instead of enforcing.

disabled – No SELinux policy is loaded.

SELINUX=disabled

SELINUXTYPE= can take one of these two values:

targeted – Targeted processes are protected,

mls – Multi Level Security protection. SELINUXTYPE=targeted

第八步:

重启。使用命令重启系统,命令如下图所示

reboot

第九步:

使用命令测试一下xen是否安装成功

[root@localhost ~]# xl info
host : localhost.localdomain
release : 4.14.57-6.el7xen.x86_64
version : #2 SMP Mon Jul 23 00:39:15 AEST 2018
machine : x86_64
nr_cpus : 32
max_cpu_id : 31
nr_nodes : 2
cores_per_socket : 8
threads_per_core : 2
cpu_mhz : 1995
hw_caps : b7ebfbff:77bee3ff:2c100800:00000001:00000001:00000281:00000000:00000100
virt_caps : hvm hvm_directio
total_memory : 65413
free_memory : 63543
sharing_freed_memory : 0
sharing_used_memory : 0
outstanding_claims : 0
free_cpus : 0
xen_major : 4
xen_minor : 7
xen_extra : .6
xen_version : 4.7.6
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=0xffff800000000000
xen_changeset :
xen_commandline : placeholder dom0_mem=1024M cpufreq=xen dom0_max_vcpus=1 dom0_vcpus_pin console=tty0 console=com1 com1=115200,8n1
cc_compiler : gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
cc_compile_by : mockbuild
cc_compile_domain : xen.crc.id.au
cc_compile_date : Tue Jul 10 12:31:27 AEST 2018
build_id : 682d65176bd21b62186f80b9494395b6e499c9a5
xend_config_format : 4

如果出现以上信息证明安装成功。

ps:实验的环境是在物理机上面进行的,如果是虚拟机安装xen,重启之后,执行xl info命令会出现一下错误:

[root@localhost ~]# xl info
xencall: error: Could not obtain handle on privileged command interface: No such file or directory
libxl: error: libxl.c:116:libxl_ctx_alloc: cannot open libxc handle: No such file or directory
cannot init xl context

解决方案,装在物理机上面即可解决。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值