2021-05-12 14:32:11
Fedora 20原始碼安裝Xen4.3.0
1.環境介紹
Linux: Fedora 20 X86_64
Xen: Xen 4.3.0
2.安裝Fedora
官網上下載映象,U盤引導,完成安裝。
詳細問題見:Fedora 20系統安裝及設定 http://www.linuxidc.com/Linux/2015-04/116552.htm
3.安裝所需要的工具包
執行命令時都是在root許可權下的。
3.1更新yum
# yum update
3.2開發包
# yum groupinstall "Development Tools"
# yum install hmaccalc ncurses-devel zlib-devel openssl-devel Python-devel
# yum install bridge-utils libtool-ltdl xorg-x11-drv-evdev xorg-x11-drv-fbdev
# yum install xorg-x11-drv-i810-devel xorg-x11-drv-via-devel xorg-x11-proto-devel
# yum install xorg-x11-server-sdk xorg-x11-xtrans-devel libuuid-devel
# yum install readline-devel gcc gcc-gfortran gcc-c++ flex pcre-devel
# yum install blas-devel lapack-devel curl-devel bison gperf gnuplot
# yum install texinfo-tex tetex-dvips
註:
1. 在執行上面的命令時,xorg-x11-drv-i810-devel和xorg-x11-server-sdk沒有,我也沒有單獨去下,發現後面也不影響。後面編譯會要求用到這兩個包:(我直接按照教學上裝了,不知道不裝會不會有影響)
2. 後面安裝Xen設定時提示:沒有as86。那是是因為在這一步沒有安裝gcc-c++
3.3 dev86
給出網址:http://rpmfind.net/linux/rpm2html/search.php?query=dev86
下載:dev86-0.16.19-3.fc19.x86_64.rpm
安裝:
# rpm -ivh dev86-0.16.19-3.fc19.x86_64.rpm
3.4 Intel ACPI CA
到主頁下載:http://acpica.org/downloads
下載原始碼,解壓,並安裝:
# tar zxvf acpica-unix-20150204.tar.gz
# cd acpica-unix-20150204
# make
# make install
4.安裝Xen 4.3.0
官網下載地址:http://www.xenproject.org/downloads/xen-archives/supported-xen-43-series/xen-430.html
4.1編譯安裝
# tar zxvf xen-4.3.0.tar.gz
# cd xen-4.3.0
# make clean
# ./configure
# make xen tools stubdom
# make install-xen install-tools install-stubdom
註:
我的Xen是直接官網下載然後安裝的,執行這些命令時幾乎沒有出現什麼問題。有同學拷貝了別人現成的Xen原始碼,然後安裝遇到了一些問題主要是在make環節出現的,下面把有可能遇到的問題貼出來:1.出現比較多的一個問題是許可權不夠,這是由於xen-4.3.0是拷貝過來,一些許可權發生了變化。例如:
錯誤:make[3]: execvp: /home/chenchao/xen-4.3.0/tools/include/../../tools/cross-install: 許可權不夠
解決方法:進入到相應的目錄,修改相應檔案的許可權即可。2.編譯引數不被識別
錯誤:cc: 錯誤:unrecognized command line option ‘-combine’
解決方法:/home/chenchao/xen-4.3.0/tools/firmware/seabios-dir-remote/Makefile中去掉編譯引數-combine3.編譯出錯
錯誤:Traceback (most recent call last):
File “./tools/layoutrom.py”, line 630, in
main()
File “./tools/layoutrom.py”, line 607, in main
info16 = parseObjDump(infile16, ‘16’)
File “./tools/layoutrom.py”, line 538, in parseObjDump
relocsection = sectionmap[sectionname]
KeyError: ‘.text.asm.out/../src/smp.c.77’
解決方法:加LC_ALL=C make編譯,上網查到的原因是:語言設定為UTF-8。4.缺少標頭檔案庫
錯誤:/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
# include < gnu/stubs-32.h>
解決方法:64bit系統編譯32bit程式,遇到的問題,終端執行
sudo yum install glibc-devel.i686
sudo yum install libgcc.i6865.編譯命令not find
錯誤:/bin/sh: line 1: patch: command not found
解決方法:sudo yum install patch.x86_646.缺少lib庫
錯誤:glib-2.12 required to compile QEMU
解決方法:sudo yum install glib2-devel.x86_647.沒有該檔案
錯誤:/tmp/qemu-conf-5475-3115-17647.c:1:17: fatal error: SDL.h: No such file or directory
#include < SDL.h>
解決方法:sudo yum install SDL-devel.x86_648.ERROR: pixman not present. Your options:
(1) Prefered: Install the pixman devel package (any recent
distro should have packages as Xorg needs pixman too).
(2) Fetch the pixman submodule, using:
git submodule update –init pixman
libxl_json.h:18:27: fatal error: yajl/yajl_gen.h: No such file or directory
#include < yajl/yajl_gen.h>
解決方法: sudo yum install yajl-devel.x86_64./configure時錯誤:
No package ‘glib-2.0’ found
解決辦法:
sudo yum install libgnomeui-devel
4.2新增啟動項
# /sbin/chkconfig --add xend
# /sbin/chkconfig --add xencommons
# /sbin/chkconfig --add xendomains
# /sbin/chkconfig xend on
# /sbin/chkconfig xendomains on
# /sbin/chkconfig xencommons on
5.更新Grub
更新Grub,使用Xen來引導,終端執行以下命令:
# grub2-mkconfig -o /boot/grub2/grub.cfg
重新啟動,用Xen引導進入Fedora,進入root許可權,驗證Xen:
# xm list
一堆錯誤:
錯誤:
Traceback (most recent call last):
File “/usr/local/sbin/xm”, line 5, in from xen.xm import main
ImportError: No module named xen.xm解決辦法:
# sudo yum install xen-devel.x86_64 仍報上述錯誤
# sudo yum install xen-devel.i686 仍報上述錯誤
# sudo yum install xen.x86_64這裡又報錯:
Error: Unable to connect to xend: No such file or directory. Is xend running?執行:
# xend start錯誤:
xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error xend/image.py: Error connecting to hypervisor進入xen根目錄下執行:
# make clean錯誤:
FATAL BUILD ERROR:Xen requires at least gcc-4.1安裝gcc:缺少gcc
# yum install gcc再次執行:
# make clean
# ./configure
# make xen tools stubdom錯誤:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
# include < gnu/stubs-32.h>解決方法:64bit系統編譯32bit程式,遇到的問題,終端執行
# sudo yum install glibc-devel.i686
# sudo yum install libgcc.i686
再次執行:
# make xen tools stubdom
# make install-xen install-tools install-stubdom
然後再次新增啟動項,其中xen和xendomains提示需要開啟相應的服務,按照提示開啟就OK了
更新grub
重新啟動,用Xen引導進入Fedora,進入root許可權,驗證Xen:
# xm list
成功了:
Name ID Mem VCPUs State Time(s)
Domain-0 0 3788 4 r----- 64.9
XenServer VM物理CPU使用策略 http://www.linuxidc.com/Linux/2013-08/88698.htm
CloudStack編譯環境XenServer啟動系統虛擬機器失敗 http://www.linuxidc.com/Linux/2013-08/88694.htm
禁止CloudStack刪除XenServer原有虛擬機器 http://www.linuxidc.com/Linux/2013-08/88693.htm
XenServer中設定Linux VM從光碟機引導 http://www.linuxidc.com/Linux/2013-07/87699.htm
開啟並設定Citrix XenServer的SNMP服務 http://www.linuxidc.com/Linux/2013-01/78487.htm
重置XenServer本地磁碟LVM為EXT3格式 http://www.linuxidc.com/Linux/2013-11/92282.htm
在 Debian 上安裝和設定 Xen http://www.linuxidc.com/Linux/2010-04/25351.htm
相關文章