Personal tools
You are here: Home Local SysAdmin Xen
Document Actions

Xen

by Pearu Peterson last modified 2007-01-29 13:36

How to install Xen 3.0.3 to edgy for amd64.

Ubuntu edgy Xen 3.0.3 Linux 2.6.17-6 craches!! We will use Xen 3.0.4 Linux 2.6.16.33 from xensource. See Xen 3.0.4 instructions instead.

INSTRUCTIONS BELOW ARE NOT USED!

The following HOWTO is based on XenOnUbuntuEdgy document but adapted for amd64 platform and has typos corrected.

Hypervisor and Dom0


  1. To insall Xen hypervisor, the kernel used by the guest host and guest domains, the userspace utilities used for working with Xen domains, and network-bridge utils, run
    sudo apt-get install xen-hypervisor-3.0-amd64 \
    xen-image-xen0-2.6.17-6-generic-xen0 xen-utils-3.0 xen-ioemu-3.0 \
    bridge-utils
  2. If /lib/tls/ exists then to disable TLS  with XenLinux 2.6 kernel (see Xen user guide section 2.5.3). run
    sudo mv /lib/tls /lib/tls.disabled
    If libc6-xen will be available for amd64, then install it.
  3. To create Xen kernel initrd image, run
    sudo mkinitramfs -o /boot/xen0-linux-2.6.17-6-generic-xen0.initrd.img 2.6.17-6-generic-xen0
  4. To setup grub, add the following lines to /boot/grub/menu.lst file:
    title           XEN/2.6.17
    root            (hd0,0)
    kernel          /xen-3.0-amd64.gz
    module          /xen0-linux-2.6.17-6-generic-xen0 root=/dev/mapper/cens_vg-kev_root ro
    module          /xen0-linux-2.6.17-6-generic-xen0.initrd.img
  5. To bridge network traffic, uncomment the following line in /etc/xen/xend-config.sxp:
    (network-script network-bridge)
  6. To configure Xen, consider changing the following lines in /etc/xen/xend-config.sxp:
    #(xend-http-server no)
    (xend-unix-server yes)
    #(xend-port 8000)
    #(xend-relocation-port 8002)
    #(xend-address localhost)
    # (network-script 'network-bridge netdev=eth1')
    (dom0-min-mem 196)
    (dom0-cpus 0)
  7. To activate Xen, reboot and use XEN/2.6.17 boot option.

Result: Kernel CRASH!!

Solution: use kernel from http://www.xensource.com/download/index_3.0.4.html. For that copy the kernel from /boot (skip symbolic links) and /lib/modules/2.6.16.33-xen/ in the xen tar-ball to system, create initrd image:

sudo mkinitramfs -o /boot/linux-2.6.16.33-xen.initrd.img 2.6.16.33-xen

and add the following lines to /boot/grub/menu.lst:

title           XEN/2.6.16 (from XENSOURCE)
root            (hd0,0)
kernel          /xen-3.0.4-1.gz
module          /vmlinuz-2.6.16.33-xen root=/dev/mapper/cens_vg-kev_root ro
module          /linux-2.6.16.33-xen.initrd.img

and reboot. This worked.. When using the new server, try XEN/2.6.17 again.

DomU

Create file systems and swap:

sudo mkfs -t ext3 /dev/cens_vg/cens_root
sudo mkfs -t ext3 /dev/cens_vg/cens_home
sudo mkswap /dev/cens_vg/cens_swap

The idea is to rsync the current cens server to the above partitions and be done with setting up the new cens.
First, we rsync cens homes to /dev/cens_vg/cens_home partitions:

sudo mkdir /mnt/sda2 && sudo mount /dev/cens_vg/cens_home /mnt/sda2
sudo rsync -avz cens:/home/ /mnt/sda2 # enter first sudo pw and then cens root pw when asked
sudo umount /mnt/sda2

However, let's check that XEN works in our hardware.

sudo mkdir /mnt/sda1 && sudo mount /dev/cens_vg/cens_root /mnt/sda1
sudo debootstrap edgy /mnt/sda1
sudo cp -a /lib/modules/2.6.16.33-xen/ /media/sda1/lib/modules
# fix apt/sources.list, network/interfaces, hostname, hosts files under /mnt/sda1/etc/
sudo umount /mnt/sda1

Configure the guest, create a file /etc/xen/edgy-guest.cfg containing

kernel = "/boot/vmlinux-2.6.16.33-xen"
ramdisk = "/boot/linux-2.6.16.33-xen.initrd.img"
builder='xensource'
memory = 1024
name = "fiasco"
vcpus = 1
vif = [ 'bridge=xenbr0' ]
disk = [ 'phy:/dev/cens_vg/cens_root,ioemu:sda1,w',
         'phy:/dev/cens_vg/cens_home:sda2,w']
root = "/dev/sda1 ro"



Powered by Plone, the Open Source Content Management System