Xen - 安装

Xen - 安装


1,一台64位的主机 + debain 9 (scrath,也就是稳定版) + xen 4.11.0
Note1:经过无数次测试,debian系统源码编译安装xen会遇到的问题很少,所以推荐,当然如果你熟悉其他操作系统你也可以尝试。而xen的版本选择看自己,可以直接git最新版本,不过老版本对一些机器可能会有硬件上的不支持,这里的问题有待挖掘。
Note2:在 /etc/apt/sources.list 挂载一个合适的国内源
debian8 stable
deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

debian8 testing
deb http://mirrors.163.com/debian/ testing main non-free contrib
deb http://mirrors.163.com/debian/ testing-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ testing main non-free contrib
deb-src http://mirrors.163.com/debian/ testing-updates main non-free contrib
deb http://mirrors.163.com/debian-security/ testing/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ testing/updates main non-free contrib

debian8 unstable(sid)
deb http://mirrors.163.com/debian sid main contrib non-free

debian9 stable
deb http://mirrors.163.com/debian/ stretch main non-free contrib
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib

输入命令 # apt-get update 完成

2,安装依赖(以下都是以debian 为例子安装的,这里建议联合官网指导进行部署)
官网指导:https://wiki.xenproject.org/wiki/Compiling_Xen_From_Source
# apt-get install build-essential
# apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif
# apt-get install texinfo texlive-latex-base texlive-latex-recommended texlive-fonts-extra texlive-fonts-recommended pciutils-dev mercurial
# apt-get install make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev
# apt-get install iasl libbz2-dev e2fslibs-dev git-core uuid-dev ocaml ocaml-findlib libx11-dev bison flex xz-utils libyajl-dev
# apt-get install gettext libpixman-1-dev libaio-dev markdown pandoc libssl-dev
# apt-get build-dep xen

3,下面开始下载xen 并安装
$ git clone git://xenbits.xen.org/xen.git
$ cd xen
$ ./configure
$ make xen
$ make tools
$ sudo make install-xen
$ sudo make install-tools
$ sudo dpkg-divert --divert /etc/grub.d/08_linux_xen --rename /etc/grub.d/20_linux_xen
$ sudo update-grub

4,安装完后要启动服务
sudo service xendomains start
sudo service xencommons start or restart
sudo update-rc.d xencommons defaults 19 18
sudo update-rc.d xendomains defaults 21 20

5,这时候可以执行 xl list 确认是否安装成功,如果出现domain0的信息,则成功

Note3:如果显示缺少lib 使用 ldconfig 命令 刷新链接,并重启xen服务

你可能感兴趣的:(xen)