wiki:Xen_Installation/Xen4

Version 7 (modified by rock, 14 years ago) (diff)

--

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 insatll

$ sudo mkinitramfs -o /boot/initrd.img-2.6.31.13 2.6.31.13
$ sudo update-grub

[法三:從 Source 安裝 Xen 並自行設定 Kernel 選項]

  • 也可以下載官方的 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
    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 <module>
        from xen.xend.server import SrvDaemon
      File "usr/lib/python2.5/site-packages/xen/xend/server/SrvDaemon.py", line 26, in <module>
      File "usr/lib/python2.5/site-packages/xen/xend/server/relocate.py", line 28, in <module>
      File "usr/lib/python2.5/site-packages/xen/xend/XendDomain.py", line 36, in <module>
      File "usr/lib/python2.5/site-packages/xen/xend/XendCheckpoint.py", line 20, in <module>
      File "usr/lib/python2.5/site-packages/xen/xend/image.py", line 46, in <module>
    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】

Attachments (2)

Download all attachments as: .zip