The Perfect Xen Setup For Debian And Ubuntu - Page 2

3.1 Installing The Binary Package

Run the following commands:

apt-get remove exim4 exim4-base lpr nfs-common portmap pidentd pcmcia-cs pppoe pppoeconf ppp pppconfig
apt-get install screen ssh debootstrap python python2.3-twisted iproute bridge-utils libcurl3-dev

<-- Yes
<-- Yes
<-- Yes

3.1.1 Install Xen

Next do this:

cd /usr/src/
wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-2.0.7-install-x86_32.tgz

tar xvzf xen-2.0.7-install-x86_32.tgz
cd xen-2.0-install
./install.sh

mv /lib/tls /lib/tls.disabled

Now Xen is installed. In order to start the Xen services at boot time, do the following:

update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20

3.1.2 Configure The Bootloader And Reboot

Next we add the Xen kernel to Grub, our bootloader. Edit /boot/grub/menu.lst, and before the line ### BEGIN AUTOMAGIC KERNELS LIST add the following stanza:

title Xen 2.0 / XenLinux 2.6.11
kernel /xen.gz dom0_mem=64000
module /vmlinuz-2.6.11-xen0 root=/dev/hda6 ro console=tty0

Make sure that /dev/hda6 is your / partition. Keep in mind what I said about Grub and partitioning in chapter 1!

Now reboot the system:

shutdown -r now

At the boot prompt, Grub should now list Xen 2.0 / XenLinux 2.6.11 as the first kernel and boot it automatically. If your system comes up without problems, then everything is fine!

Share this page:

Suggested articles

3 Comment(s)

Add comment

Comments

By: Anonymous

In Ubuntu my ./install.sh failed due to i missing the twisted framework.

The error was;

Installing Xen from './install' to '/'...
All done.
Checking to see whether prerequisite tools are installed...
FAILED check_twisted
Checks failed. See /usr/src/xen-2.0-install/check/.chkinstall for details.
All done.

I fixed this by 'apt-get install python-twisted'

k31th

By: Anonymous

This is a great how-to and I only have a small addition:

If you want to run more than 4 virtual machines, you need to add a boot option for the dom0 kernel in order to permit enough file-backed virtual block devices. In the example above, the line

module /vmlinuz-2.6.11-xen0 root=/dev/hda6 ro console=tty0

in section 3.1.2 has to be modified to

module /vmlinuz-2.6.11-xen0 root=/dev/hda6 ro console=tty0 max_loop=X

where the X needs to be replaced by 2 times the number of virtual machines.

Of course, as the Xen manual points out, if you have heavy I/O taking places in your virtual machines, you may experience performace losses if you increase X much beyond the default value of 8.


Dirk Petry

By: Anonymous

as well as the max_loop=16 (or 2 x however many VMs you want)

you might need to make the loop devices eg /dev/loop8 /dev/loop9 etc

This helped me:

for i in $(seq 8 63) ; do mknod /dev/loop$i b 7 $i ; done

chmod 660 /dev/loop* ; chown 0.disk /dev/loop*

HTH Simon Faulkner