[[PageOutline]] {{{ #!html

Xen 4.0 Installation (Debian Lenny)

}}} ---- = 【安裝基本套件】 = {{{ $ sudo aptitude install bcc bin86 gawk bridge-utils iproute libcurl3 \ libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo \ texlive-latex-base texlive-latex-recommended texlive-fonts-extra \ texlive-fonts-recommended pciutils-dev mercurial build-essential \ make gcc libc6-dev zlib1g-dev python python-dev python-twisted \ libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev \ iasl libbz2-dev e2fslibs-dev git-core uuid-dev // 若是 64bit 系統還需安裝 $ sudo aptitude install gcc-multilib }}} ---- = 【安裝 Xen 4.0】 = == [法一:從 Debian 的套件庫安裝 Xen] == 因目前 Debian 官方維護的 Xen 套件版本較舊(Xen 3.2),Kernel 版本也較舊(2.6.26),若想使用最新版的 Xen 4.0 和較新的 Kernel 2.6.31 必須從 source 安裝 {{{ $ sudo aptitude install xen-linux-system-2.6.26-2-xen-amd64 xen-hypervisor-3.2-1-amd64 xen-tools }}} == [法二:從 Source 安裝 Xen] == {{{ $ cd /usr/src $ sudo wget http://bits.xensource.com/oss-xen/release/4.0.0/xen-4.0.0.tar.gz $ sudo tar zxvf xen-4.0.0.tar.gz $ cd xen-4.0.0/ $ make -j 4 world $ make install $ sudo mkinitramfs -o /boot/initrd.img-2.6.31.13 2.6.31.13 $ sudo update-grub }}} == [法三:從 Source 安裝 Xen 並自行設定 Kernel 選項] == * [http://pasik.reaktio.net/xen/pv_ops-dom0-debug/config-2.6.31.6-pvops-dom0-xen-master-x86_64 也可以下載官方的 Kernel 設定檔],或自己手動編輯 {{{ // Xen Hypervisior $ cd /usr/src $ sudo wget http://bits.xensource.com/oss-xen/release/4.0.0/xen-4.0.0.tar.gz $ sudo tar zxvf xen-4.0.0.tar.gz $ cd xen-4.0.0/ $ sudo make -j 4 xen tools stubdom $ sudo make install-xen $ sudo make install-tools $ sudo make install-stubdom // Xen Kernel $ cd /usr/src $ sudo git clone git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen $ cd linux-2.6-xen $ sudo make menuconfig $ sudo make -j 4 $ sudo make install $ sudo make modules_install $ sudo mkinitramfs -o /boot/initrd.img-2.6.31.13 2.6.31.13 }}} ---- = 【安裝其他工具】 = * xen-tools {{{ $ sudo aptitude install libtext-template-perl debootstrap $ wget http://xen-tools.noone.org/software/xen-tools/xen-tools-4.1.tar.gz $ tar zxvf xen-tools-4.1.tar.gz $ cd xen-tools-4.1 $ make install }}} ---- = 【問題】 = * ERROR Internal error: Could not obtain handle on privileged command interface {{{ #!sh ERROR Internal error: Could not obtain handle on privileged command interface (2 = No such file or directory) Traceback (most recent call last): File "/usr/sbin/xend", line 36, in from xen.xend.server import SrvDaemon File "usr/lib/python2.5/site-packages/xen/xend/server/SrvDaemon.py", line 26, in File "usr/lib/python2.5/site-packages/xen/xend/server/relocate.py", line 28, in File "usr/lib/python2.5/site-packages/xen/xend/XendDomain.py", line 36, in File "usr/lib/python2.5/site-packages/xen/xend/XendCheckpoint.py", line 20, in File "usr/lib/python2.5/site-packages/xen/xend/image.py", line 46, in xen.lowlevel.xc.Error: (1, 'Internal error', 'Could not obtain handle on privileged command interface (2 = No such file or directory)') }}} * 解法 {{{ # su root -c 'echo "none /proc/xen xenfs defaults 0 0" >> /etc/fstab' }}} ---- = 【Reference】 = * [http://wiki.xensource.com/xenwiki/Xen4.0 Xen4.0] * [http://www.cnblogs.com/ddr888/archive/2010/06/01/1746565.html Debian5 dom0上跑Xen Debian5 lenny domU&Xen ubuntu10.04 Lucid domU] * [http://www.vpsee.com/2010/04/install-xen-on-debian-from-source/ 在 Debian 上源码安装 Xen] * [http://bderzhavets.wordpress.com/2010/04/24/set-up-ubuntu-10-04-server-pv-domu-at-xen-4-0-dom0-pvops-2-6-32-10-kernel-dom0-on-top-of-ubuntu-10-04-server/ Set up Ubuntu 10.04 Server PV DomU at Xen 4.0 Dom0 (pvops 2.6.32.12 kernel) Dom0 on top of Ubuntu 10.04 Server] * [http://bderzhavets.wordpress.com/2010/05/18/set-up-libvirt-0-7-7xen-4-0-on-top-fedora-13-rc2/ Set up Libvirt 0.7.7&Xen 4.0 Dom0 (2.6.32.13 pvops) on top of Fedora 13 RC2]