wiki:install_xen_domU

Version 12 (modified by Jamie McClelland, 11 years ago) (diff)

--

Install domU

Run the following command (modify as needed):

xen-create-image --size=1GB --memory=750MB --swap=512Mb --gateway=209.51.163.1 \
--netmask=255.255.255.224 --ip=209.51.163.6 --hostname=peltier

Create new LVM virtual volumes, for example:

lvcreate --size=5GB --name=peltier-var vg_gramsci0
lvcreate --size=3GB --name=peltier-usr vg_gramsci0
lvcreate --size=50GB --name=peltier-home vg_gramsci0

Then, edit /etc/xen/peltier.cfg, modifying the disk line to be something like this:

disk    = [ 'phy:vg_gramsci0/peltier-disk,sda1,w', 'phy:vg_gramsci0/peltier-swap,sda2,w', \
'phy:vg_gramsci0/peltier-var,sda3,w', 'phy:vg_gramsci0/peltier-usr,sda4,w', \
'phy:vg_gramsci0/peltier-srv,sda5,w']

Then, start the server with:

xm create -c peltier.cfg

Login as root (no password).

Set the password.

Then exit. To get rid of the login screen and return to the dom0, hit ctrl-].

If you want to encrypt any of the disks, check out encrypted filesystem page.

Then, ssh into the server and format the disks:

mkfs -t ext3 /dev/sda3
mkfs -t ext3 /dev/sda4
mkfs -t ext3 /dev/sda5

Switch the /var partition to the one you just created:

mkdir /mnt/var.temp
mount /dev/sda3 /mnt/var.temp
cp -a /var/* /mnt/var.temp
umount /mnt/var.temp
mv /var /var.orig; mkdir /var; mount /dev/sda3 /var
rm -rf /var.orig
rmdir /mnt/var.temp

Do the same for usr:

mkdir /mnt/usr.temp
mount /dev/sda4 /mnt/usr.temp
cp -a /usr/* /mnt/usr.temp
umount /mnt/usr.temp
mv /usr /usr.orig; mkdir /usr; mount /dev/sda4 /usr
rm -rf /usr.orig
rmdir /mnt/usr.temp

Then, add the following lines to fstab:

/dev/sda3     /var     ext3     defaults   0     2
/dev/sda4     /usr     ext3     defaults   0     2
/dev/sda5     /srv    ext3     defaults   0     2

Then, mount the last filesystem:

mount /srv

Install linux-modules-2.6.18-5-xen-vserver-686:

aptitude install linux-modules-2.6.18-5-xen-vserver-686