Xen 3.0.4
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.
The following HOWTO is based on XenOnUbuntuEdgy document but adapted for amd64 platform and has typos corrected.
Hypervisor and Dom0
- Install network-bridge utils
sudo apt-get install bridge-utils python-pam
- 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
- Download Xen 3.0.4 tarball for AMD64 platform, unpack it and in dist directory run
sh ./install.sh
- Add the following section 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 - Create initrd image:
sudo mkinitramfs -o /boot/linux-2.6.16.33-xen.initrd.img 2.6.16.33-xen
- Reboot using XEN/2.6.16 kernel.
Configure XEN by editing file /etc/xen/xend-config.sxp as follows
(xend-unix-server yes)
(network-script network-bridge) # using default network device
# (network-script 'network-bridge netdev=eth1')
(dom0-min-mem 3072) # Assuming 4G RAM, if 2 GM, set to 1024
(dom0-cpus 0)
(vncpasswd '')- Start Dom0:
/etc/init.d/xend start
When this works, create symbolic links to rc2.d
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
Execute (to fix hotblug setup failure)
ln -s -f /bin/sh /bin/bash
Test DomU fiasco
Let us check that XEN works in our hardware. For that we install edgy as follows
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/ /mnt/sda1/lib/modules
# fix apt/sources.list, network/interfaces, hostname, hosts files under /mnt/sda1/etc/
Create the following /mnt/sda1/etc/fstab file:
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/sda1 / ext3 defaults,errors=remount-ro 0 1
/dev/sda3 none swap sw 0 0
Create the following /mnt/sda1/etc/network/interfaces file:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 172.17.4.169
netmask 255.255.0.0
network 172.17.0.0
broadcast 172.17.255.255
gateway 172.17.0.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 172.17.0.10
dns-search kybi
Fix hostname:
echo fiasco > /mnt/sda1/etc/hostname
When done, do unmount
sudo umount /mnt/sda1
To configure the DomU fiasco, create a file /etc/xen/edgy-fiasco.cfg containing
kernel = "/boot/vmlinuz-2.6.16.33-xen"
builder='linux'
memory = 512
name = "fiasco"
vcpus = 1
vif = [ 'bridge=xenbr0' ]
disk = [ 'phy:cens_vg/cens_root,sda1,w',
'phy:cens_vg/cens_home,sda2,w',
'phy:cens_vg/cens_swap,sda3,w']
root = "/dev/sda1 ro"
#extra = "init=/bin/bash" # uncomment to set root password in the first boot
To run DomU fiasco with console login, run
xm create edgy-fiasco.cfg -c
Additional notes
- When creating DomU cens when Dom0 has multiple network interfaces, check that cens sees only one of them.