1.内核下载:
# uname -a 发现我的内核为3.13.0-32-generic,从
https://www.kernel.org/pub/linux/kernel/v3.0/下载3.13.1.tar.gz内核文件。
# tar xvf Linux.3.13.1.tar.gz
# cd Linux.3.13.1
2.内核配置、编译、安装
2.1配置
# make menuconfig //由于内核默认支持xen很多内容不需要改,但是看某一英文安装过程,说Dom0应关闭TPM的支持,这个应该是属于后来对TPM的研究,由于版本问题,选项都变了些,不过真不好找。我也不知道这样对不对。。看原文:
DISABLE TPM SUPPORT (this is a critical step- dom0 should not have access to the TPM).
For that purpose, we exclude the TPM driver in the dom0 kernel:
Device Drivers —> Character devices —>< > TPM Hardware Support
看我的图:
看到没TPM Hardwart Support 是_*_然后进去
我就改成这个样子了,第二个好像改不了的,先这样保存退出。
2.2 编译安装
# make modules_prepare
# make
# make modules_install
# make install
# cd /boot
# mkinitramfs -o initrd.img-3.13.1 3.13.1
# update-grub
重启系统运行:
#uname -a 发现内核已经是3.13.1了
#service xencommons start出错,#xl list 也出错。如下:
# xl list 可能出错,xl: error while loading shared libraries: libxlutil.so.4.4: cannot open shared object file: No such file or directory
等类似错误。是因为 Xen 相关的软件库被安装到了 /usr/local/lib 目录,系统找不到。所以你自己要做一些链接比如:
# cd /usr/lib
# ln -s /usr/local/lib/libxlutil.so.4.4.0 libxlutil.so.4.4
然后你再运行还有其他错误,缺少什么,你就链接一下就好。(好像提示3-4个链接的错误)
最后运行下:
# ldconfig
如果连接完还有问题:(以下是参考的:http://blog.csdn.net/sdulibh/article/details/39319671)
# xl info xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error libxl: error: libxl.c:99:libxl_ctx_alloc: cannot open libxc handle: No such file or directory cannot init xl context
是因为没有挂载 xenfs 的缘故,挂载一下就可以了:
# modprobe xenfs # mount -t xenfs xenfs /proc/xen # ls /proc/xen/ capabilities privcmd xenbus xsd_kva xsd_port # xl info host : localhost.localdomain release : 3.15.4 version : #1 SMP Fri Jul 11 09:37:12 SAST 2014 machine : x86_64 nr_cpus : 4 max_cpu_id : 3 nr_nodes : 1 cores_per_socket : 2 threads_per_core : 2 cpu_mhz : 2195 hw_caps : bfebfbff:28100800:00000000:00003f00:15bae3bf:00000000:00000001:00000000 virt_caps : hvm total_memory : 3959 free_memory : 127 sharing_freed_memory : 0 sharing_used_memory : 0 outstanding_claims : 0 free_cpus : 0 xen_major : 4 xen_minor : 5 xen_extra : -unstable xen_version : 4.5-unstable 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 : Wed Jul 9 13:30:54 2014 +0100 git:7579169-dirty xen_commandline : cc_compiler : gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16) cc_compile_by : root cc_compile_domain : localdomain cc_compile_date : Fri Jul 11 08:49:06 SAST 2014 xend_config_format : 4
记得启动 xencommons 哦,以前旧版本的 xend 已经被 xencommons 替代了:
# /etc/init.d/xencommons start Starting C xenstored... Setting domain 0 name and domid... Starting xenconsoled... Starting QEMU as disk backend for dom0 # xl list Name ID Mem VCPUs State Time(s) Domain-0 0 3779 4 r----- 105.5
我的是:
Xen 从 4.1 版本开始引入了新版工具集 xl/libxl,并在后续的版本中逐步替代旧的 xm/xend,在 4.5 版本中已经完全删除了 xm/xend.