My assumptions here are that you have a free partition named /dev/hda5 which you can use for setting up a LVM partition.
The following values can offcourse be changed suited to your needs:
-L<value> at lvcreate to set size for your partitions
memory = <value> in /etc/xen/domu1 to set memory size for the domU
The domU uses kernel "/boot/vmlinuz-2.6.11-xenU", because this document was written with Xen 2.0.7 installed. This setup however also works up until the last Xen unstable (3.0) version. The domU kernel line changes into the kernel supplied by the Xen version of your choice.
- install the base system:
apt-get install lvm2 pvcreate /dev/hda5 vgcreate lvmxen /dev/hda5 lvcreate -L1G -n domu1 lvmxen lvcreate -L256M -n domu1-swap lvmxen mke2fs /dev/lvmxen/domu1 tune2fs -j /dev/lvmxen/domu1 mkswap /dev/lvmxen/domu1-swap mount /dev/lvmxen/domu1 /mnt debootstrap sarge /mnt <debianserver of your choice> # It can be possible that debootsrap spits out an error message # like: E: Couldn't find these debs: 33024830 # use the following command line for debootstrap if this is the case. # # debootstrap --resolve-deps sarge /mnt <debianserver of your choice> mv /mnt/lib/tls /mnt/lib/tls.disabled
put in /mnt/etc/network/interfaces:
auto lo iface lo inet loopback
put in /mnt/etc/fstab:
# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/hda1 / ext3 defaults,errors=remount-ro 0 1 /dev/hda2 none swap sw 0 0
- create ttys
cd /dev ./MAKEDEV tty1 tty2 tty3 tty4 tty5 tty6
- unmount the newly created domU
cd / umount /mnt
create a /etc/xen/domu1 file, for example:
# -*- mode: python; -*- kernel = "/boot/vmlinuz-2.6.11-xenU" memory = 128 name = "domu1" vif = [' bridge=xen-br0' ] disk = ['phy:/dev/lvmxen/domu1,hda1,w','phy:/dev/lvmxen/domu1-swap,hda2,w'] ip="192.168.2.103" netmask="255.255.255.0" gateway="192.168.2.1" hostname = "domu1" root = "/dev/hda1 ro" extra = "4"
start the domU with xm create domu1 -c
log in as root, run base-config, happy xenning
--
for a xen 3.0.0 source install, the /etc/xen/domu1 file must have the following values changed in /etc/xen/domu1:
- kernel = "/boot/vmlinuz-2.6.12-xen" vif = [' bridge=xenbr0' ]
otherwise
- the domU kernel won't boot
- you get "Error: Device 0 (vif) could not be connected. Backend device not found." because your bridge interface won't be found - I am not sure if the domU config really worked with xen below 3.0 - never tried that.
