wiki:Xen_Installation

Version 9 (modified by jazz, 17 years ago) (diff)

--

Xen Installation


Installation

  • Our OS is Debian etch, we use deb package to install Xen
    $ sudo aptitude install xen-linux-system-2.6.18-6-xen-686
    (you can refer to our installation log in attache file)
    
    $ sync ; sudo reboot
    (reboot system and choose xen-enable kernel)
    
  • Check our Xen system
    $ uname -a
    Linux one 2.6.18-6-xen-686 #1 SMP Sun Feb 10 22:43:13 UTC 2008 i686 GNU/Linux
    
  • Configure our Xen environment
    $ vim /etc/xen/xend-config.sxp
    71:    network-script network-bridge
    87: #network-script netwok-dummy
    
    $ xend restart
    $ xm list
    



Xen Operation

Install Guest OS (DomU)

  • To create simple Guest OS, try xen-create-image which is included in xen-tools
    $ man xen-create-image
    
  • Install Guest OS
    $ sudo mkdir /home/xen_img
    $ sudo dd if=/dev/zero of=/home/xen_img/etch.img bs=1G count=5
    $ sudo dd if=/dev/zero of=/home/xen_img/etch.swap bs=514MB count=1
    $ sudo /home/xen_img/mkfs.ext3 etch.img
    $ sudo /home/xen_img/mkswap etch.swap
    $ sudo mount -o loop etch.img /mnt
    $ sudo debootstrap --arch i386 etch /mnt/ http://free.nchc.org.tw/debian
    
  • Config Guest OS
    $ sudo vim /etc/fstab
    /etc/fstab
    /dev/hda1    /          ext3      defaults 0 1
    /dev/hda2   swap    swap      defaults 0 0
    proc             /proc   proc      defaults 0 0
    
    $ sudo vim /etc/hostname
    etch
    
    $ sudo vim /etc/hosts
    $ sudo vim /etc/network/interfaces
    $ sudo cp /etc/apt/sources.list /mnt/etc/apt/
    $ sudo cp -r /lib/modules/2.6.18-6-xen-686/ /mnt/lib/modules/
    
    $ sudo chroot /mnt
    $ passwd root
    $ adduser rock
    $ sudo umount /mnt
    
  • Edit Guest OS configuration
    $ sudo vim /home/xen_img/etch.cfg
    # Kernel image
    kernel = "/boot/vmlinuz-2.6.18-6-xen-686"
    ramdisk = "/boot/inird.img-2.6.18-6-xen-686"
    # Domain name
    name = "etch"
    # 0achine information
    vcpus = 4
    memory = 256
    disk = ['file:/home/xen_img/etch.img,hda1,w','file:/home/xen_img/etch.swap,hda2,w']
    vif = ['mac=00:00:00:00:00:01,bridge=xenbr1']
    
  • Guest OS problem
    $ mount /home/xen_img/etch.img /mnt
    $ chroot /mnt
    
    Guest booting Error: 4gb seg fixup, process init (pid 1), cs:ip 73:b7e192fc
    $ aptitinstall libc6-xen
    
    locale problem:
    $ aptitinstall install locales
    $ dpkg-reconfigure -a locale
    $ tzxonfig
    



Refrenece