DTC-Xen Installation

DTC-Xen / Dom0 Howtos

DTC-Xen / DomU Howtos


DTC Howtos




Devel docs

Wiki - i18n

Wiki - Meta

Upgrade your system to use a Xen Kernel

This page is part 2/6 in our A server with DTC-Xen tutorial.
(Make sure you follow the step one after the other)

To build a Xen kernel (whether for the host or for the guest systems), use these instructions:

Getting Xen from the Debian repository

We now recommend that you use the Debian kernel if you are using Lenny. In that case, you should do:

On i386 machines:

   apt-get install xen-linux-system-2.6.26-2-xen-686  libc6-xen xen-utils-3.2-1 xen-utils-common bridge-utils iproute bcc bin86

On 64 bits systems:

   apt-get install xen-linux-system-2.6.26-2-xen-amd64  xen-utils-3.2-1 xen-utils-common bridge-utils iproute bcc bin86

On both system types, we recommend you to also do:

   apt-get install make gcc libc6-dev zlib1g python python-twisted libcurl3 bzip2 module-init-tools transfig tgif libncurses5 patch libvncserver-dev libsdl-dev libjpeg62-dev bcc bin86 gawk pciutils-dev texinfo

Suggested Order: You might like to install the recommendations first then your choice of xen components (above) second. Some users have found installation in this order can be less problematic.

Version Notes: If you're using Squeeze the xen version is different. You should use apt-cache search xen-linux-system and apt-cache search xen-utils to get the current version numbers. As a suggestion you might install xen-utils-common bridge-utils iproute bcc bin86 then get xen-linux-system. As for Debian Squeeze, xen-linux-system seems to install xen-utils for you.

Bug Fix Symlinks

You'll have to make a symlink to the python lib, as the Debian xen kernel doesn't provide it. A bug has been sent to the maintainer of the package, but he doesn't seem to care, unfortunately. Anyway, here's how:

   ln -s /etc/alternatives/xen-default /usr/lib/xen
   ln -s /usr/lib/xen-default/lib/python/xen /usr/lib/python2.5/site-packages/xen

Edit /boot/grub/menu.lst -- and set the first option to be something like this:

   kernel          /boot/xen-3.2.1.gz dom0_mem=393216
  • ToDo: Need to explain what to do with version 4 kernal, and explain how to test and how to set correct kernel as default for start up and error message users will get if it's wrong...
  • Not sure how to set this mem thing in grub2, need to talk to Thomas to find out right instructions to update this - don - 28 June 2012

Squeeze uses GRUB version 2, so the file to edit is /etc/default/grub, change the GRUB_DEFAULT value and then run update-grub to change the /boot/grub/grub.cfg file.

The only thing that you need to modify is the dom0_mem (why to set the mem to 384MB? some detailed information about this would be nice. would 256MB be enough?).

You might need to change this each time you install or upgrade a new kernel. Then you will also need to change a bit your /etc/xen/xend-config.sxp:

   # Have the VNC listen on all interfaces
   sed -i "s/#(vnc-listen '')/(vnc-listen '')/" /etc/xen/xend-config.sxp
   # Set a default pass
   gen_pass=`dd if=/dev/random bs=64 count=1 2>|/dev/null | md5sum | cut -d' ' -f1 | awk '{print substr($0,0,8)}'`
   sed -i "s/(vncpasswd '')/(vncpasswd '${gen_pass}')/" /etc/xen/xend-config.sxp
   # Increase the default dom0 min mem
   sed -i "s/(dom0-min-mem 196)/(dom0-min-mem 384)/" /etc/xen/xend-config.sxp
   # Set network-bridge and add anti-spoof to Xend
   sed -i "s/(network-script network-dummy)/(network-script 'network-bridge antispoof=yes')/" /etc/xen/xend-config.sxp

(WARNING: If you copy and paste this you might get the wrong information if lines wrap. Also note there are ' and `.)

and tweak a bit more your system:

   echo "root:" >>/etc/aliases
   /etc/init.d/postfix reload
   mkdir /etc/xen/auto

That's about it for the Xen system part. If you wish to do everything from source, you can use the following, but it's quite outdated now:

Building Xen yourself

Once all this is done, you can proceed to from a DTC panel.

Small warning: dom0_mem setting on the xen command line is broken through some linux kernel versions. Xen will limit the memory, but the dom0 will not. Refer to the xen-devel archives for workarounds. Basically all pvops kernels up to 3.0.2 are affected.

Useful commands:

  xm create -c xen01

  xm destroy xen01

  su xen01

  xm console xen01
Page last modified on July 24, 2013, at 03:00 AM EST