Managing Xen With Xen-Tools, Xen-Shell, And Argo

Version 1.0
Author: Falko Timme

This guide describes how to install and use xen-tools, xen-shell, and Argo on a Debian system. All three packages provide useful tools for the administration of virtual Xen machines. Xen-tools is a collection of Perl scripts that allow you to easily create, update, and delete Xen guest domains. The xen-shell provides a command-line interface to owners of Xen domains so that they can manage their Xen domains without the help of the server administrator. And with Argo, you can control Xen domains through a web interface or through a menu on the command line. All three packages were developed for Debian systems, but might work on other distributions as well.

I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!


1 Preliminary Note

I assume you have already installed Xen 3 on your Debian system (it doesn't work with Xen 2!), for example from the sources as shown in chapter 4 of this tutorial: I couldn't get xen-tools to work with the binary Xen installation (shown in chapter 5), but it might work for you. But xen-tools work like a charm for me on a Xen installation from the sources.

The hostname of my Xen dom0 domain is in this tutorial, its IP address is, and the gateway is I want to store my guest domains in the /vserver/images directory. These values might be different for you.

Please make sure you have a line like this one in /etc/hosts:

vi /etc/hosts
[...] server1


2 Xen-Tools

Although there are Debian packages for xen-tools and xen-shell available on, I decided to install xen-tools and xen-shell from the sources because the xen-tools Debian package wrote invalid Xen configuration files for me which didn't happen when I used the sources.

First we install some prerequisites for xen-tools:

apt-get install libtext-template-perl perl-doc

Then we install xen-tools like this:

cd /tmp
tar xvfz xen-tools-2.7.tar.gz
cd xen-tools-2.7
make install

Next we edit /etc/xen-tools/xen-tools.conf. This file contains the default values that are used by the xen-create-image script unless you specify other values on the command line. I changed the following values and left the rest untouched:

vi /etc/xen-tools/xen-tools.conf
gateway   =
netmask   =

passwd = 1

kernel = /boot/vmlinuz-2.6-xenU
#initrd = /boot/initrd.img-2.6.16-2-xen-686

mirror =

The passwd = 1 line makes that you can specify a root password when you create a new guest domain. In the kernel line you must specify the domU kernel that you want to use for your guest domains. If your guest domains don't need a ramdisk to boot up, comment out the initrd line (I had to do this on my installation), otherwise specify the correct ramdisk. In the mirror line specify a Debian mirror close to you.

Make sure you specify a gateway and netmask. If you don't, and you don't specify a gateway and netmask on the command line when using xen-create-image, your guest domains won't have networking even if you specified an IP address!

Now let's create our first guest domain,, with the IP address

xen-create-image --ip= \
--netmask= --gateway= --dir=/vserver/images \
--dist=sarge --debootstrap

The --netmask and --gateway switches are unnecessary here because we specified the same details in /etc/xen-tools/xen-tools.conf but it shows that you can specify the desired settings either on the command line or in /etc/xen-tools/xen-tools.conf.

This command will now create the guest domain with Debian Sarge in it by using Debian's debootstrap tool. This will take some minutes so be patient. In the meantime you can open up another shell window and run

tail -f /var/log/xen-tools/

to see what's happening behind the scenes.

After the new guest domain has been created, check /etc/xen/ It should now look like this (I've stripped out the comments here):

vi /etc/xen/
kernel  = '/boot/vmlinuz-2.6-xenU'
memory  = '128'
root    = '/dev/sda1 ro'
disk    = [ 'file:/vserver/images/domains/,sda1,w', 'file:/vserver/images/domains/,sda2,w' ]
name    = ''
vif  = [ 'ip=' ]
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'

We can start our new virtual machine like this:

xm create -c /etc/xen/

With the xen-create-image command, you can specify almost all settings on the command line. Have a look at

man xen-create-image

to find out more. Here's another example:

xen-create-image --size=2Gb --swap=128Mb \
--ip= --netmask= --gateway= --dir=/vserver/images \
--dist=sarge --debootstrap --fs=ext3 --kernel=/boot/vmlinuz-2.6-xenU --memory=32Mb \
--image=sparse --mirror= --passwd

This will create the virtual domain /etc/xen/ should look like this afterwards (again, I've stripped out the comments):

vi /etc/xen/
kernel  = '/boot/vmlinuz-2.6-xenU'
memory  = '32'
root    = '/dev/sda1 ro'
disk    = [ 'file:/vserver/images/domains/,sda1,w', 'file:/vserver/images/domains/,sda2,w' ]
name    = ''
vif  = [ 'ip=' ]
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'

You can start the new virtual machine like this:

xm create -c /etc/xen/

There are also three other scripts that come with xen-tools:

xen-update-image lets you update the packages in guest domains, e.g. like this:

xen-update-image --dir=/vserver/images

xen-list-images shows all guest domains that were created with xen-create-image:


The output looks like this:

server1:~# xen-list-images
Memory: 128
Memory: 32

With xen-delete-image you can remove guest domains that were created with xen-create-image:

xen-delete-image --dir=/vserver/images
Share this page:

1 Comment(s)