Posted by Steve on Mon 8 May 2006 at 07:21
Now that the Xen 3.0 packages have made it to Debians unstable distribution installation has become much more straightforward. Here we'll take a look at installing and getting started with it upon a generic unstable machine.
To start with we'll need to update our machine, so as root run:
apt-get update
Once you've got the most recent packages lists we can begin the work of installing the software properly. We'll need to install several packages:
Since the host I'm running upon has less than a gigabyte of memory I can use the normal Xen package. (Install xen-hypervisor-3.0-i386-pae if you need more memory.)
root@steve:~# apt-get install xen-hypervisor-3.0-i386 xen-utils-3.0
Once installed your next step depends on whether you're happy with the default kernel available in the Debian repository, or whether you'd like to install a kernel from scratch. I usually prefer using stock kernels, unless I need some specific hardware support that isn't available, so I'll just choose the default imag:
root@steve:~# apt-get install linux-image-2.6.16-1-xen-686Kernel Package Problem
The Xen kernel packages currently available in unstable don't create an initrd image when they are installed, so they fail to boot.
Create one by running the following command after installing the kernel:
mkinitrd -o /boot/initrd.img-2.6.16-1-xen-686 2.6.16-1-xen-686(Adjust the type from 686 if you're using a different flavour of the kernel such as k7)
Now that the kernel is installed and we have an initrd image we need to setup our bootloader to use it. Add something like the following to your /boot/grub/menu.lst file:
title Xen 3.0 / XenLinux 2.6 kernel /boot/xen-3.0-i386.gz noreboot module /boot/vmlinuz-2.6.16-1-xen-686 root=/dev/hda1 ro module /boot/initrd.img-2.6.16-1-xen-686
At this point you might wish to adjust the network settings that Xen will use. The xend daemon is configured via the file /etc/xen/xend-config.sxp, and this is commented pretty thoroughly.
For typical use the following are sufficient:
(network-script network-bridge) (vif-script vif-bridge)
Uncomment those lines and comment out any other settings for vif-script and network-script.
We should now be able to install the minor support tools and reboot into our new system. Get them by running:
root@steve:~# apt-get install bridge-utils iproute sysfsutils libc6-xen xen-tools
All being well a reboot now should succeed and allow you to boot into your Xen system. If you have problems consult any open bugs against the Debian packages, and if that doesn't give you joy please consider describing your problem upon the xen-users mailing list.
Assuming that you've got your new system booted correctly we can continue and create a new guest domain using the installed package xen-tools.
Create a directory to contain your guest files:
mkdir /home/xen
Now edit the file /etc/xen-tools/xen-tools.conf to match your setup:
# # /etc/xen-tools/xen-tools.conf # dir = /home/xen size = 2Gb memory = 128Mb swap = 128Mb fs = ext3 dist = sarge gateway = 192.168.1.1 netmask = 255.255.255.0 passwd = 1 initrd = /boot/initrd.img-2.6.16-1-xen-686 kernel = /boot/vmlinuz-2.6.16-1-xen-686 mirror = http://ftp.uk.debian.org/debian/
Here I've stripped out comments, but you should find sufficient explanation included in the file. The important things to setup are:
Once this is done you can create a new Xen guest image by executing the following command:
xen-create-image --hostname=test --ip=192.168.1.222 --passwd
Once the installation has finished, and you've been prompted to enter the new root password for the guest you can start the image by running:
xm create test.cfg -c
Press 'Ctrl+]' to exit from the console of the new system, and connect to it via SSH using the password specified when the image was created.
If you receive errors booting you might need to specify a ramdisk to the xen instance. Do that by editing the Xen configuration file /etc/xen/test.cfg and adding a line:
ramdisk = '/boot/initrd.img-2.6.16-1-xen-686'
The 1.4 release of xen-tools will do this for you automatically, however this might not have moved to sid yet.
Note: you don't need to use the xen-tools software to create new guest Xen domains. You can use debootstrap manually if you wish, or any other tools.
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
If you specify --dhcp then yes you'll need a DHCP server...
IP forwarding shouldn't matter so long as you editted the xend-config.sxp appropriately.
[ Parent ]
[ Parent ]
You still need to configure the IP address details of the new host in /etc/network/interfaces - did you do that?
[ Parent ]
ps. the example you gave isn't correct:
vif = ['ip = "160.6.1.39", bridge=xenbr0']
You should have:
vif = ['ip=160.6.1.39,bridge=xenbr0']
(The quoting is different. Also note that the IP must be on the same range as your host/bridge.)
[ Parent ]
Edit /etc/hostname on each new node - although if you're using xen-tools that should be handled automatically for you...
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
nvidia: Unknown symbol xen_tlb_flush
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
My sources.list file just contains:
# # /etc/apt/sources.list # # Unstable deb http://ftp.uk.debian.org/debian sid main contrib non-free deb-src http://ftp.uk.debian.org/debian sid main contrib non-free
If there are newer packages the names might have changed, eg.linux-image-2.6.16-1-xen-686 might be -2-xen-686 by now.
Running "apt-cache search [terms]" will probably help in that case.
[ Parent ]
[ Parent ]
[ Parent ]
Deny.
The xen-tools package is my software and the package is called simply xen-tools.
It doesn't conflict with anything either, so I'm not sure about the parent comment. (Unless it is xen-utils + xen-utils-3.0 conflict, in which case the solution is to unstall xen-utils-3.0.)
[ Parent ]
[ Parent ]
You are right the Debian "xen" package is for Xen 2.x, you don't want that.
Instead you want the xen-utils-3.0 + xen-hypervisor-3.0 packages as explained in this article.
I'm suprised you're seeing this problem with the xen-tools package though, since "Recommends" is only a suggestion, not a required package. Personally I use apt-get and ignore the recommended packages most of the time. Just don't install the recommended package and you'll be fine.
If you're using something else which automatically installs recommended packages I'd regard that as broken ..
(For what it is worth the version of Xen-tools in sid now recommends 'xen' or 'xen-hypervisor-3.0' - so this shouldn't be an issue anymore.)
[ Parent ]
[ Parent ]
title Xen 3.0 / XenLinux 2.6 kernel /xen-3.0-i386.gz noreboot module /vmlinuz-2.6.16-1-xen-686 root=/dev/hda1 ro module /initrd.img-2.6.16-1-xen-686Hope that saves someone some frustration!
[ Parent ]
This is your grub setup I think.
I'd guess that you have a seperate /boot partition? If so the images are relative to that - so the leading /boot isn't needed.
If you have a single root, like I do, then you need it.
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
Comments tend to keep growing for weeks/months after the time an article was originally written, and it would be an insane amount of work to update the text to cover every problem/mistake noted in the comments.
Especially when some of the articles describe software which has moved on, (eg. Apache 1.3 -> Apache 2.x). There might not be a sensible way of handling that short of rewriting the article from scratch!
In short: Comments correcting mistakes and offering additional tips are very useful, but updating the article text isn't likely to occur unless a very glaring mistake is noticed early on.
(I'll always update reported typos, or spelling errors though.)
Regarding your points:
[ Parent ]
[ Parent ]
If they're not listed in the configuration file for xen-tools they aren't supported by it - I assume that is what you mean?
You should be able to just "install into a file" using whatever means that system uses, and then start it up. Assuming Xen supports it of course.
Perhaps check the archives of the xen-users mailing list?
[ Parent ]
[ Parent ]
[ Parent ]
Please have a look at http://cyril.bouthors.org/blog/index/2006/08/17/16-xen-lilo for more information.
Thanks
[ Parent ]
[ Parent ]
[ Parent ]
# iptables -L modprobe: Can't open dependencies file /lib/modules/2.6.18-2-xen-686/modules.dep (No such file or directory) iptables v1.2.11: can't initialize iptables table `filter': iptables who? (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
[ Parent ]
Make sure you've copied the modules belonging to the kernel into the domU.
This error appears to be saying that /lib/modules/xxx in the domU doesn't have anything in it. Copy from the dom0.
[ Parent ]
xen1-test:~# iptables -L modprobe: QM_MODULES: Function not implemented modprobe: QM_MODULES: Function not implemented modprobe: Can't locate module ip_tables iptables v1.2.11: can't initialize iptables table `filter': iptables who? (do you needto insmod?) Perhaps iptables or your kernel needs to be upgraded. xen1-test:~# depmod -a depmod: QM_MODULES: Function not implemented xen1-test:~# logout
[ Parent ]
The only time I've seen that was when mixing 64bit dom0 and 32bit domU - since in that cases the modules didn't match.
If that isn't what you're I'd suggest reporting it on the xen-users mailing list, or searching google to see if there are any other obvious causes..
[ Parent ]
[ Parent ]
You should look at the xen logs to see what the error is coming from, then report it upon the xen-users mailing list.
Most likely you've not changed /etc/xen/xend-config.sxp to be a bridge, or a routed setup..
[ Parent ]
[ Parent ]
I can't guess the reason for the error, no.
There are lots of things that could cause it. I'd suggest you look at /var/log/xen*.log - possibly after updating xend-config.sxp to increase the debug levels.
But here isn't the place to get Xen help. The xen-users mailing list is the correct place; people there will be much better able to help you.
[ Parent ]
[ Parent ]
Has the xen code made it into the debian kernel source package? But what if I want to build a xen kernel with firmwares and other stuff that Debian rips out?
--
Anonimouse
[ Parent ]