Installing Xen on Ubuntu 7.10 Gutsy Gibbon Server

This install guide is based on the HowToForge article. First, install Ubuntu Server. Then, install xen like this:
  • apt-get install ubuntu-xen-server
Edit /etc/xen/xend-config.sxp:
  • comment out (network-script network-dummy)
  • add (network-script network-bridge)
Edit /etc/modules to increase the number of available loop-devices:
  • loop max_loop=64
create a dir for the images:
  • mkdir /data/xen
The version of xen-tools installed by apt is outdated (3.5), so get a new version from Steve Kemp's apt-get repository In my case, I used xen-tools_3.8-2etch1_all.deb
  • dpkg -i xen-tools_3.8-2etch1_all.deb
    It will complain about libtext-template-perl not being installed, so
  • apt-get install libtext-template-perl
Edit /etc/xen-tools/xen-tools.conf
  • dir = /data/xen
  • memory = 512Mb
  • swap = 512Mb
  • gateway = 192.168.x.x adjust to your own situation
  • netmask = 255.255.255.0
  • broadcast = 192.168.x.255 adjust to your own situation
  • passwd = 1 but maybe better to leave this out
  • mirror = http://ftp.nl.debian.org/debian/
  • serial_device = xvc0 we seem to be using a 'newer' kernel (>2.6.20)
  • disk_device = xvda
Reboot. There seems to be a problem with the hwclock on Debian DomU. Which figures as there is no hw. Copy hwclock.sh to the skeleton-dir and edit it:
  • mkdir /etc/xen-tools/skel/etc/init.d
  • cp /etc/init.d/hwclock.sh /etc/xen-tools/skel/etc/init.d
  • vi /etc/xen-tools/skel/etc/init.d/hwclock.sh
    • put exit 0 below the #!/bin/sh line to disable the script altogether
Optionally, put your public ssh-key in /etc/xen-tools/skel/root/.ssh/authorized_keys. Don't forget to chmod 600 it, and chmod 700 the .ssh-dir. Create an image with:
  • xen-create-image --hostname=virt01.func.nl --role=udev (this takes a while)
Edit the configfile /etc/xen/virt01.func.nl.cfg to get the right console:
  • put extra 'xencons=xvc console=xvc0' below the memory = '512' line.
  • put vcpus = '2' to get more cpu's for your vm.
Even better: edit /etc/xen-tools/xm.tmpl and put the two lines below the memory-declaration there. Start the DomU:
  • xm create -c /etc/xen/virt01.func.nl
  • ssh 192.168.x.x
Extra packages: If you complete the above, you'll be left with a very minimal system. Things like ntp, locales, and less are not installed by default. Luckily xen-tools provides for a way to install arbitrary packages. Scripts are provided in /etc/xen-tools/role.d. Just copy the udev script, which only installs udev, and adjust it as you see fit. For me. it came down to adding a few lines: installDebianPackage ${prefix} vim installDebianPackage ${prefix} less installDebianPackage ${prefix} postfix installDebianPackage ${prefix} rsync Now, just add the name(s) of the script(s) you need to the --role parameter, separating them with comma's.

Trackback URL for this post:

http://www.func.nl/trackback/58

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".