Installing Xen 3.0 upon Debian Unstable, with a custom Kernel

Posted by Steve on Wed 28 Dec 2005 at 06:14

Tags: , ,

Recently we demonstrated the process of installing a binary release of Xen 3.0 on Sarge, since the packages on Debian Unstable are not yet available for Xen 3.0 we're now going to look at installing it via the packages provided by Ralph Passgang. This also includes building a custom Xen kernel from source.

The advantage to building the Xen kernel from source is that you can add, or remove, drivers - so the kernel is utterly customised for your system.

This is useful as I had problems with the binary kernel release upon my Sarge server, when booting Xen I lost access to my sound-card! When building the kernel from source this isn't a problem, as I can compile in the driver I need. (Or have it otherwise available as a module.)

Currently the Xen package in Debian's unstable release, sid, is a little behind the curve, so we're going to use a well-tested external source for our installation:

To get started we'll need to add the relevant lines to our /etc/apt/sources.list file. I've added:

#
# Xen 3.0 packages by Ralph Passgang
#
deb     http://packages.debianbase.de/sid/i386/xen3/  ./
deb-src http://packages.debianbase.de/sources/xen3 ./

(Note that packages are also available for Sarge, and Etch.)

Once the lines have been added update your APT lists by running:

root@itchy:~# apt-get update

Now we can install the software with the following command:

root@itchy:~# apt-get install xen
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  fxload hotplug libxen-python libxen3.0
Suggested packages:
  ifrename
The following NEW packages will be installed:
  fxload hotplug libxen-python libxen3.0 xen
0 upgraded, 5 newly installed, 0 to remove and 8 not upgraded.
Need to get 0B/1093kB of archives.
After unpacking 3304kB of additional disk space will be used.
Do you want to continue [Y/n]? 

The installation will install the xen hypervisor and userspace tools, as well as the required libraries for your system which might be different to those shown above.

Once the packages have been installed we're ready to start building a kernel to use for the server. To do that we need to install the Xen patch:

root@itchy:~# apt-get install linux-patch-xen

This patch is applied to the source code of a Linux kernel, so we'll need to fetch the kernel sources too - and also the required packages to build it. We'll get those first:

root@itchy:~# apt-get install kernel-package libncurses-dev wget

Once we have these packages installed we should be able to successfully fetch and build the kernel for our Xen installation. Firstly we'll fetch the code, and extract it:

root@itchy:~# wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.tar.bz2
root@itchy:~# tar -xjf linux-2.6.12.tar.bz2
root@itchy:~# cd linux-2.6.12

Now we can apply the patch, from within the kernel source directory:

root@itchy:~/linux-2.6.12# /usr/src/kernel-patches/i386/apply/xen
START applying xen patch (xen kernel patch)
Testing whether "xen kernel patch" patch for 2.6.12 applies
"xen kernel patch" patch for 2.6.12 succeeded
Removing empty files:
Done.
END applying xen patch
root@itchy:~/linux-2.6.12#

To configure the kernel to our liking we can use the menuconfig option, making sure we specify that the kernel is being built for the Xen platform:

root@itchy:~/linux-2.6.12# make ARCH=xen menuconfig

Running the menuconfig target will save a configuration file which we need to build. So make sure you run that even if you don't intend to make any changes to the standard configuration.

Once the kernel has been configured to your liking you may use the make-kpkg command, included in the kernel-package package, to build a Debian package of the Xen kernel:

root@itchy:~/linux-2.6.12#  make-kpkg --revision skx1 \
   --append-to-version .6-xen \ 
   --arch xen
   kernel_image

The "--revision skx1" argument will give your kernel package a unique name. Typically the --append-to-version flag isn't needed, but in this case it is required as the Xen patch silently updates the kernel to 2.6.12.6 - so we need to reflect this.

Eventually your new kernel should be successfully built. Once the build process has completed you should find the .deb file in the parent directory:

root@itchy:/home/xen/tmp/linux-2.6.12# cd ..
root@itchy:/home/xen/tmp# ls *.deb
linux-xen0-2.6.12.6-xen_skx1_i386.deb

Install the kernel with:

root@itchy:/home/xen/tmp# dpkg --install linux-xen0-2.6.12.6-xen_skx1_i386.deb

Once you've installed the kernel the next step is to build the initrd image, but before doing that you must disable TLS upon your host system:

root@itchy:~/linux-2.6.12# cd
root@itchy:~# mv /lib/tls /lib/tls.disabled
root@itchy:~# mkinitrd -o /boot/xen-modules-2.6.12.6-xen 2.6.12.6-xen

(Disabling the TLS libraries speeds up Xen, so it is a recommended option. However if you do it after building the initrd image Xen will be fooled into thinking that those libraries are still active and will complain. So we disable them beforehand to avoid this problem.)

Now that we've installed the Xen package, built and installed our custom kernel, we've only one thing left to do: Update the grub bootloader, and reboot!

Add the following to your /boot/grub/menu.lst file:

title Xen 3.0 / XenLinux 2.6
kernel /boot/xen-3.0.gz
module /boot/xen-linux-2.6.12.6-xen root=/dev/hda1 ro console=tty0
module /boot/xen-modules-2.6.12.6-xen

Note: make sure you adjust the root parameter which is the root filesystem.

Once you've rebooted you should be ready to create and install a new Xen instance. I wrote some simple software to automate this [which is available in Sid] - but you can use debootstrap to create your own image manually if you wish.

If you're running a Debian Sid system you can create and boot a new instance of Debian Sarge, which will obtain its networking details via DHCP, by running:

root@itchy:~# apt-get install xen-tools
root@itchy:~# mkdir -p /home/xen
root@itchy:~# xen-create-image --dir=/home/xen --hostname=test.my.flat --dhcp \
    --fs=ext3 --size=2Gb --swap-128Mb --kernel=/boot/xen-modules-2.6.12.6-xen
root@itchy:~# xm create test.my.flat.cfg -c

For alternative options, (such as a static IP address, or different distribution of Debain), please see the manpage.

 

 


Posted by Anonymous (193.158.xx.xx) on Wed 28 Dec 2005 at 22:39
Hi Steve and all other authors.
This page is really rocks. You people seem to read my mind. A lot of what I really want/need to know appears just magically at the right time here.
Thank you very very much for all those great articles.

Can't wait putting some Xen DomUs into production...
Great stuff.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Wed 28 Dec 2005 at 23:25
[ View Steve's Scratchpad | View Weblogs ]

Thanks!

If you have any tips on using it for real feel free to submit them here - there are a lot of cool things that Xen, and related technologies, can manage and we've barely scratched the surface yet.

Steve

[ Parent | Reply to this comment ]

Posted by Anonymous (62.142.xx.xx) on Thu 29 Dec 2005 at 10:49
I think some other people might be wondering this as well:

Is it possible to run a Xen kernel that's been patched with Grsecurity?

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Thu 29 Dec 2005 at 11:59
[ View Steve's Scratchpad | View Weblogs ]

I'm afraid I don't know. If you try it you can let us know!

Steve

[ Parent | Reply to this comment ]

Posted by lool (82.127.xx.xx) on Tue 17 Jan 2006 at 16:09
The first problem I encountered when trying to use both Xen and Grsec was to find a kernel suitable for both:
- the linux-patch-xen described here is meant for 2.6.12 (vanilla, but holds 2.6.12.6 changes) and won't apply on anything past 2.6.12 since the 2.6.12 -> 2.6.12.6 changes were of course applied in the later kernels
- Debian ships grsec 2.1.7 which only supports 2.6.11 or 2.6.14, forcing it against 2.6.12 results in lots of rejections

It seems neither Grsec nor Xen are able to support all released kernels so one has to choose one for now, or hand-apply the patches.

--
Loïc Minier

[ Parent | Reply to this comment ]

Posted by Anonymous (65.193.xx.xx) on Fri 30 Dec 2005 at 04:28
Does the linux-patch-xen below

root@itchy:~# apt-get install linux-patch-xen

Come from official Debian or custom repository?

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 30 Dec 2005 at 13:15
[ View Steve's Scratchpad | View Weblogs ]

The same custom repository.

Steve

[ Parent | Reply to this comment ]

Posted by Anonymous (65.193.xx.xx) on Fri 30 Dec 2005 at 04:34
The post to the xen-user list says

add: "deb-src http://packages.debianbase.de/sources/xen3 ./"
to /etc/apt/sources.list and type: "apt-get update && apt-get source xen".

I think there is a typo in where the source packages are located.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Wed 11 Jan 2006 at 18:23
[ View Steve's Scratchpad | View Weblogs ]

I made a mistake, and the source line has been fixed now.

Steve

[ Parent | Reply to this comment ]

Posted by Anonymous (207.118.xx.xx) on Fri 6 Jan 2006 at 20:56
Great article. Unfortunately, though, there don't seem to be any AMD64 packages for any of the Debian releases, contrary to what the article says.

[ Parent | Reply to this comment ]

Posted by Anonymous (81.173.xx.xx) on Wed 11 Jan 2006 at 18:23
there are amd64 packages for sid and sarge now... etch is missing for amd64.

[ Parent | Reply to this comment ]

Posted by shufla (83.16.xx.xx) on Thu 12 Jan 2006 at 14:35
Hello,

I've tried to adapt that guide for Debian Sarge (I've tried that one before: http://www.debian-administration.org/articles/304) but in both ways I've got same result: after compiling kernel and installing it, makeing changes to /boot/grub/menu.lst and restarting system "hangs" after I choosed Xenized kernel (it shows, that it loaded both supplied Xen modules and wait inifite without any message - system was left for 12h).

What could it be? Too old machine? (model name:AMD-K6(tm) 3D processor, cpu MHz: 334.138, MemTotal: 256968 kB) The most weird thing is that article 304 was implemented by me succesfully on Ubuntu on more powerfull machine (PIII, half gig of RAM), and I've double check that I didn't make any mistakes...

By the way, thanks for so much articles about virtualization - it's great to have so much information and discussion.

Best regards,
Luke Nowak

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Thu 12 Jan 2006 at 14:40
[ View Steve's Scratchpad | View Weblogs ]

I'm honestly not sure. The best I can say is that it worked for me!

I think your best bet would probably be to post a message upon the xen-users mailing list, describing your hardware and your problem(s).

There you'll have a lot of people who are capable of debugging, and diagnosing problems.

Steve

[ Parent | Reply to this comment ]

Posted by shufla (83.16.xx.xx) on Tue 24 Jan 2006 at 13:50
Hello,

I was using P5-compatibile, not P6 and Xen require P6. Now all runs fine :)

Best Regards,
Luke

[ Parent | Reply to this comment ]

Posted by Anonymous (216.254.xx.xx) on Sat 14 Jan 2006 at 03:06
How would I build the xenu image using make-kpkg? Or would I use dpkg-buildpackage?

[ Parent | Reply to this comment ]

Posted by lool (82.127.xx.xx) on Thu 19 Jan 2006 at 09:21
You should "make ARCH=xen menuconfig" again, select a non-privileged guest, you might want to turn off physical device access too, and finally make-kpkg with a different name (eg. "--append-to-version .6-xenu").

--
Loïc Minier

[ Parent | Reply to this comment ]

Posted by Anonymous (80.109.xx.xx) on Sat 21 Jan 2006 at 13:14
Hello!

Installed and run exactly as mentioned in this article, kernel compiles fine but i'm unable to build a debian package. The only stuff i added is:

included 'make mrproper' and 'make ARCH=xen oldconfig' before 'make ARCH=xen menuconfig'

Is there something missing?

thx, Chris

====== making target debian/linux-i386-2.6.12.xen0 [new prereqs: ]======
install -p -d -m 755 /usr/src/linux-2.6.12-vanilla/debian/linux-i386-2.6.12.xen0/DEBIA N
sed -e 's/=V/2.6.12.xen0/g' -e 's/=IB//g' \
-e 's/=ST/linux/g' -e 's/=R//g' \
-e 's/=K/vmlinuz/g' -e 's/=L/grub/g' \
-e 's/=I//g' -e 's,=D,/boot,g' \
-e 's/=MD//g' \
-e 's@=MK@@g' -e 's@=A@i386@g' \
-e 's@=M@@g' -e 's/=OF//g' \
-e 's/=S//g' -e 's@=B@xen@g' \
./debian/pkg/virtual/xen/postinst > /usr/src/linux-2.6.12-vanilla/debian/linux-i386-2.6.12.xen0/DEBIA N/postinst
chmod 755 /usr/src/linux-2.6.12-vanilla/debian/linux-i386-2.6.12.xen0/DEBIA N/postinst
sed -e 's/=V/2.6.12.xen0/g' -e 's/=IB//g' \
-e 's/=ST/linux/g' -e 's/=R//g' \
-e 's/=K/vmlinuz/g' -e 's/=L/grub/g' \
-e 's/=I//g' -e 's,=D,/boot,g' \
-e 's/=MD//g' \
-e 's@=MK@@g' -e 's@=A@i386@g' \
-e 's@=M@@g' -e 's/=OF//g' \
-e 's/=S//g' -e 's@=B@xen@g' \
./debian/pkg/virtual/xen/prerm > /usr/src/linux-2.6.12-vanilla/debian/linux-i386-2.6.12.xen0/DEBIA N/prerm
chmod 755 /usr/src/linux-2.6.12-vanilla/debian/linux-i386-2.6.12.xen0/DEBIA N/prerm
dpkg-gencontrol -DArchitecture=i386 -isp \
-plinux-i386-2.6.12.xen0 -P/usr/src/linux-2.6.12-vanilla/debian/linux-i386-2.6.12.xen0/
dpkg-gencontrol: error: package linux-i386-2.6.12.xen0 not in control info
make[1]: * [debian/linux-i386-2.6.12.xen0] Fehler 255
make[1]: Leaving directory `/usr/src/linux-2.6.12-vanilla'
make: * [binary/linux-i386-2.6.12.xen0] Fehler 2
root@joysn:/usr/src/linux-2.6.12-vanilla#

[ Parent | Reply to this comment ]

Posted by Anonymous (87.78.xx.xx) on Sat 21 Jan 2006 at 14:59
looks like an make-kpkg error. not all versions of make-kpkg in sid/etch can compile a xen kernel successfull.

if you are using sid, then the upgrade to the latest version of "kernel-package". make-kpkg should work then. for etch I don't know exactly what version is used there now and if it's ok.

what is your "kernel-package" version? you can find that information by running: "dpkg -l kernel-package"

or just install the binary kernel image that is available for your debian box by simply running: "apt-get install linuix-xen0-2.6" and follow the instructions that are shown then.

--Ralph

[ Parent | Reply to this comment ]

Posted by ChrisJoelly (80.109.xx.xx) on Sat 21 Jan 2006 at 17:04
Hello Ralph,

thanks for your hint. i have kernel-package 10.019 and there's
10.032 in sid now. i'll try when my actual compile run fail's once more ;-)

Chris

[ Parent | Reply to this comment ]

Posted by ChrisJoelly (80.109.xx.xx) on Sat 21 Jan 2006 at 18:09
yesyes, that's it. the new 10.032 kernel_package does it ;-)

thx a lot,

Chris


[ Parent | Reply to this comment ]

Posted by yeti (84.133.xx.xx) on Tue 24 Jan 2006 at 00:48
[ View yeti's Scratchpad ]
...after lotsa fun with uml I am curious so see netbsd and linux side by side in domUs...

Are there some experiences with putting domU gests on separate harddisks, one hd per guest? Or on LVs?

I got a dual p3@1000 and lots of 4G uw-scsi disks to experiment...

[ Parent | Reply to this comment ]

Posted by yeti (84.133.xx.xx) on Tue 24 Jan 2006 at 02:19
[ View yeti's Scratchpad ]
Some clicks later... one question remains after flying over some docs: What about xen-3 and smp?

[ Parent | Reply to this comment ]

Posted by Anonymous (84.17.xx.xx) on Wed 25 Jan 2006 at 12:36
Good article,

i'm up with debian and xen3 but you build 1 kernel, is this good for both dom0 and domU?

I'm using it in both and it work but in domU i must ifconfig eth0 manually to get networking runs ok. is this correct?

Thank's
Giorgio.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Thu 26 Jan 2006 at 13:51
[ View Steve's Scratchpad | View Weblogs ]

You can use the same kernel if you wish for dom0 and domU - but I think the performance is slower.

Sounds like something is wrong with the networking though, you should be able to set it up so that it starts normally as with a real Debian installation.

Steve

[ Parent | Reply to this comment ]

Posted by Anonymous (84.17.xx.xx) on Thu 26 Jan 2006 at 14:21
Yes, in fact actualy my domU network works also after reboot.

But usually in domU network is configured from the sxp xen config file and not from the guest interfaces file.

I think this is because my guest kernel is the same as the host and not a "real" domU kernel.

I will try some performance test to check the impact of using same kernel and i will report.

Thank's steve

Giorgio.

[ Parent | Reply to this comment ]

Posted by Anonymous (81.173.xx.xx) on Fri 27 Jan 2006 at 21:00
You can use the same kernel for domU and dom0, and as far as I know that doesn't cost any performace in general.

a dom0 kernel need more "code" to actually work. the domU kernel would needs less, but it's ok if there are the dom0 specific stuff in it. It's not a performance issue, only the kernel takes a bit more memory and you have modules in your system that you wouldn't need, because (at least at the moment) there is no support for having pci devices imported in a domU in xen3...

and there was another question about xen3 and smp... my packages are compiled with smp support and it's okay to use them on smp and non-smp machines. It can be clever to use an smp kernel on a non-smp box, because then you can assign more then one vcpu to a domU, even if your xen host has just one real cpu... (But to be honest, it doesn't bring performance on uniprocessor system without HT). Another reason for just one general kernel (with smp support) is, that at the moment I am compiling xen & kernels for sid, etch and sarge on i386 and amd6 + a special pae version for sid,sarge, etch on i386, so at the moment I have to build 9 kernels for each new version. each kernel is about 15mb in size and takes over an hour to compile (on my i386 build host, the amd64 one is faster), so I am not really want to have 18 kernels, because of an smp and an up version.

the last open question was that someone was having the problem that the network interface needs to be configured on each reboot of a domU... I don't know for sure what's up there, because there were to less information to be sure, but I would guess that the required modules (/lib/modules/2.6.12.6-xen at the moment) doesn't exist in the domU filesystem. if that is the case, then the solution would be to stop the domU and mount the filesystem in your dom0. After that copy /lib/modules/2.6.12.6-xen to /<mountpoint-of-domu-fs>/lib/modules/ and umount the domu-fs again. after rebooting everything should work as expected, if not please provide some more information... what exactly doesn't work? do you need to insmod/modprobe some modules before it works? is your /etc/network/interfaces correct? does "/etc/init.d/networking start" work correctly? have you errors in your domU dmesg (beides maybe the usual usb and fd0 errors)?

--Ralph




[ Parent | Reply to this comment ]

Posted by Anonymous (195.248.xx.xx) on Mon 30 Jan 2006 at 16:13
Is it just me or do the hostname, ip, etc commands not work in xen 3.0?
I have

kernel = "/boot/xen-linux-2.6.12.6-xen"
ramdisk = "/boot/initrd-xen-3.0.img"
memory = 64
name = "vm01"
disk = [ 'file:/home/xen/domains/vm01/disk.img,sda1,w','file:/home/xen/doma ins/vm01/swap.img,sda2,w' ]
root = "/dev/sda1 ro"
#network
vif = [ 'bridge=xenbr0' ]
dhcp = "off"
ip = "10.0.0.16"
netmask = "255.0.0.0"
gateway = "10.0.0.1"
hostname = "vm01.X.X.X"

in my domain config file but after starting up the machine reports as (none)

[ Parent | Reply to this comment ]

Posted by junnu (194.100.xx.xx) on Wed 1 Feb 2006 at 07:03
Be sure you have udev and hotplug installed also.

[ Parent | Reply to this comment ]

Posted by Anonymous (85.116.xx.xx) on Thu 16 Feb 2006 at 10:35
If I am right udev and hotplug can't be used both? udev removes hotplug for me. Partial (means short time) problem?

However, nice tut - and great to have a repository where the debs are already ready :D

Regards, Bigfoot29

[ Parent | Reply to this comment ]

Posted by Anonymous (193.19.xx.xx) on Sat 4 Feb 2006 at 10:13
After spending several hours on getting Xen to run on my PIII 1GHz Testing machine with RAID1 I gave up.

The machine boots into XEN and starts detecting hardware. After about 10 seconds in the boot process, it reboots without halting for an error message. I took my digital camera and made a movie of the boot process so I could see what the last output was. Results: It seems to have something to do with devfs...

Output with RAID compiled into the kernel:
initrd-tools: 0.1.81.1
mount: unknown filesystem type 'devfs'
NET: Registered protocol family 1
FATAL: module raid1 not found
mdadm: device /dev/md1 already active - cannot ...

At this point the machine reboots.

Output with RAID compiled as module

initrd-tools: 0.1.81.1
mount: unknown filesystem type 'devfs'
NET: Registered protocol family 1
md: raid1 personally registered
md: md1 stopped
md: bind(hdb3)
md: bind(hda3)
raid: raid set md1 active ...
mdadm: /dev/md1 has been started with 2 drives
umount: devfs: not mounted


So what is the deal with the devfs? Does it have something to do with udev?

Any help would be highly welcome...

Cheers
Morten

[ Parent | Reply to this comment ]

Posted by Anonymous (193.19.xx.xx) on Sat 4 Feb 2006 at 10:16
I forgot to add: Debian Sarge (stable), fresh install (the 6th try ;)
Morten

[ Parent | Reply to this comment ]

Posted by mck (193.19.xx.xx) on Sat 4 Feb 2006 at 10:44
Okay folks, I recompiled the kernel again with RAID support as a module and devfs into the kernel.

Here is the result:
devfs_mk_dev: could not append to parent for ...
md: Autodetecting RAID arrays
md: do_md_run() returned -22
md: md0 stopped
md: unbind(hdb2)
md: export_rdev(hdb2)
md: unbind(hda2)
md: export _rdev(hda2)
md: ...autorun DONE.
RAMDISK: cramfs filesystem found at block 0
RAMDISK: Loading 1316KiB (1 disk) into ram disk
VFS: Mounted root (cramfs...)
Mounted devfs on /dev
Mounted devfs on /dev
Freeing unused kernel memory: 136k freed
initrd-tools: 0.1.81.1
NET: Registered protocol family 1
md: raid1 personally registered
mdadm: error opening /dev/md1/: No such file ...
EXT3-fs: unable to read superblock
EXT2-fs: unable to read superblock
cramfs: wrong magic
mount: mount point dev does not exist

REBOOT

[ Parent | Reply to this comment ]

Posted by mck (193.19.xx.xx) on Sat 4 Feb 2006 at 14:29
Problem was solved with "apt-get install udev", should have tried that earlier. In the meantime I reinstalled the machine again and am now having a different problem:

After compiling and installing, following this howto I am running into problems with xend, I cannot start virtual machines:

nex:/opt# xm create vm01.cfg -c
Using config file "/etc/xen/vm01.cfg".
Error: Error connecting to xend: No such file or directory. Is xend running?

nex:/opt# xm list
Error: Error connecting to xend: No such file or directory. Is xend running?


nex:/opt# ps aux | grep xen
root 6 0.0 0.0 0 0 ? S< 14:57 0:00 [xenwatch]
root 7 0.0 0.0 0 0 ? S< 14:57 0:00 [xenbus]
root 5243 0.0 1.0 7700 4620 ? S 15:09 0:00 python /usr/sbin/xend start
root 5244 0.0 1.0 11796 4852 ? S 15:09 0:00 python /usr/sbin/xend start
root 5245 0.0 1.0 11796 4852 ? S 15:09 0:00 python /usr/sbin/xend start
root 5251 0.0 1.0 11796 4852 ? S 15:09 0:00 python /usr/sbin/xend start
root 5252 0.0 1.0 11796 4852 ? S 15:09 0:00 python /usr/sbin/xend start

nex:/opt# uname -a
Linux nex 2.6.12.6-xen #1 Sat Feb 4 14:32:02 CET 2006 i686 GNU/Linux

nex:/opt# cat /etc/apt/sources.list
#deb file:///cdrom/ sarge main

deb http://ftp.de.debian.org/debian/ stable main
deb-src http://ftp.de.debian.org/debian/ stable main

deb http://security.debian.org/ stable/updates main

#
# Xen 3.0 packages by Ralph Passgang
#
deb http://packages.debianbase.de/sarge/i386/xen3/ ./
deb-src http://packages.debianbase.de/sources/xen3 ./

I installed the xen package from the above listed repository and it is the latest version...

Do you have any ideas what might cause the problem? TLS is disabled and I am doing an /etc/init.d/xend start as root.

Any help would be highly welcome, cheers
Morten

[ Parent | Reply to this comment ]

Posted by clcastro (202.90.xx.xx) on Fri 12 May 2006 at 04:58
Im having the same problem after following this installation guide:

"nex:/opt# xm list
Error: Error connecting to xend: No such file or directory. Is xend running? "

have u found a solution to this? thanks.

debian sarge (3.1), 1.8GHz P4, 512MBram.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 12 May 2006 at 10:07
[ View Steve's Scratchpad | View Weblogs ]

Make sure that xend is running. Should be able to run "/etc/init.d/xend restart" - but make sure that the two directories /var/run/xend, and /var/run/xenstored exist first.

If that doesn't help then please post more details.

Steve

[ Parent | Reply to this comment ]

Posted by clcastro (202.90.xx.xx) on Fri 12 May 2006 at 10:43
xend is running,
# ps ax|grep xend
3805 ? S 0:00 python /usr/sbin/xend start
3806 ? S 0:00 python /usr/sbin/xend start
3809 ? S 0:00 python /usr/sbin/xend start
3810 ? S 0:00 python /usr/sbin/xend start

i tried to xend stop, then xend start, but the same error message appears:
Exception starting xend: (111, 'Connection refused')

and i checked, /var/run/xend and /var/run/xenstored both exists.

# uname -a
Linux zenki-debian 2.6.12.6-xen #1 SMP Thu May 11 17:44:14 PHT 2006 i686 GNU/Linux

my grub.conf is:
title Xen 3.0 / (Debian) XenLinux 2.6
root (hd0,2)
kernel /boot/xen-3.0.gz
module /boot/xen-linux-2.6.12.6-xen root=/dev/hda3 ro console tty0
module /boot/xen-modules-2.6.12.6-xen

the logfile /var/log/xend.log reads:

[2006-05-12 10:43:22 xend] INFO (SrvDaemon:278) Xend Daemon started
[2006-05-12 10:43:22 xend] INFO (SrvDaemon:282) Xend changeset: Sun Mar 12 19:36:00 2006 +0100 .
[2006-05-12 10:43:22 xend] ERROR (SrvDaemon:292) Exception starting xend ((111, 'Connection refused'))
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvDaemon. py", line 286, in run
servers = SrvServer.create()
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvServer. py", line 108, in create
root.putChild('xend', SrvRoot())
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvRoot.py ", line 40, in __init__
self.get(name)
File "/usr/lib/python2.3/site-packages/xen/web/SrvDir.py", line 82, in get
val = val.getobj()
File "/usr/lib/python2.3/site-packages/xen/web/SrvDir.py", line 52, in getobj
self.obj = klassobj()
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvDomainD ir.py", line 39, in __init__
self.xd = XendDomain.instance()
File "/usr/lib/python2.3/site-packages/xen/xend/XendDomain.py&quo t;, line 582, in instance
inst.init()
File "/usr/lib/python2.3/site-packages/xen/xend/XendDomain.py&quo t;, line 70, in init
xstransact.Mkdir(VMROOT)
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 317, in Mkdir
complete(path, lambda t: t.mkdir(*args))
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 323, in complete
t = xstransact(path)
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 20, in __init__
self.transaction = xshandle().transaction_start()
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xsutil.p y", line 18, in xshandle
xs_handle = xen.lowlevel.xs.xs()
RuntimeError: (111, 'Connection refused')
[2006-05-12 10:54:03 xend] INFO (SrvDaemon:185) Xend stopped due to signal 15.
[2006-05-12 10:55:41 xend] INFO (SrvDaemon:278) Xend Daemon started
[2006-05-12 10:55:41 xend] INFO (SrvDaemon:282) Xend changeset: Sun Mar 12 19:36:00 2006 +0100 .
[2006-05-12 10:55:41 xend] ERROR (SrvDaemon:292) Exception starting xend ((111, 'Connection refused'))
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvDaemon. py", line 286, in run
servers = SrvServer.create()
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvServer. py", line 108, in create
root.putChild('xend', SrvRoot())
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvRoot.py ", line 40, in __init__
self.get(name)
File "/usr/lib/python2.3/site-packages/xen/web/SrvDir.py", line 82, in get
val = val.getobj()
File "/usr/lib/python2.3/site-packages/xen/web/SrvDir.py", line 52, in getobj
self.obj = klassobj()
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvDomainD ir.py", line 39, in __init__
self.xd = XendDomain.instance()
File "/usr/lib/python2.3/site-packages/xen/xend/XendDomain.py&quo t;, line 582, in instance
inst.init()
File "/usr/lib/python2.3/site-packages/xen/xend/XendDomain.py&quo t;, line 70, in init
xstransact.Mkdir(VMROOT)
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 317, in Mkdir
complete(path, lambda t: t.mkdir(*args))
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 323, in complete
t = xstransact(path)
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 20, in __init__
self.transaction = xshandle().transaction_start()
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xsutil.p y", line 18, in xshandle
xs_handle = xen.lowlevel.xs.xs()
RuntimeError: (111, 'Connection refused')
[2006-05-12 10:56:27 xend] INFO (SrvDaemon:185) Xend stopped due to signal 15.
[2006-05-12 11:36:41 xend] INFO (SrvDaemon:278) Xend Daemon started
[2006-05-12 11:36:41 xend] INFO (SrvDaemon:282) Xend changeset: Sun Mar 12 19:36:00 2006 +0100 .
[2006-05-12 11:36:41 xend] ERROR (SrvDaemon:292) Exception starting xend ((111, 'Connection refused'))
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvDaemon. py", line 286, in run
servers = SrvServer.create()
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvServer. py", line 108, in create
root.putChild('xend', SrvRoot())
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvRoot.py ", line 40, in __init__
self.get(name)
File "/usr/lib/python2.3/site-packages/xen/web/SrvDir.py", line 82, in get
val = val.getobj()
File "/usr/lib/python2.3/site-packages/xen/web/SrvDir.py", line 52, in getobj
self.obj = klassobj()
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvDomainD ir.py", line 39, in __init__
self.xd = XendDomain.instance()
File "/usr/lib/python2.3/site-packages/xen/xend/XendDomain.py&quo t;, line 582, in instance
inst.init()
File "/usr/lib/python2.3/site-packages/xen/xend/XendDomain.py&quo t;, line 70, in init
xstransact.Mkdir(VMROOT)
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 317, in Mkdir
complete(path, lambda t: t.mkdir(*args))
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 323, in complete
t = xstransact(path)
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 20, in __init__
self.transaction = xshandle().transaction_start()
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xsutil.p y", line 18, in xshandle
xs_handle = xen.lowlevel.xs.xs()
RuntimeError: (111, 'Connection refused')
[2006-05-12 11:41:41 xend] INFO (SrvDaemon:185) Xend stopped due to signal 15.
[2006-05-12 17:16:53 xend] INFO (SrvDaemon:278) Xend Daemon started
[2006-05-12 17:16:53 xend] INFO (SrvDaemon:282) Xend changeset: Sun Mar 12 19:36:00 2006 +0100 .
[2006-05-12 17:16:53 xend] ERROR (SrvDaemon:292) Exception starting xend ((111, 'Connection refused'))
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvDaemon. py", line 286, in run
servers = SrvServer.create()
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvServer. py", line 108, in create
root.putChild('xend', SrvRoot())
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvRoot.py ", line 40, in __init__
self.get(name)
File "/usr/lib/python2.3/site-packages/xen/web/SrvDir.py", line 82, in get
val = val.getobj()
File "/usr/lib/python2.3/site-packages/xen/web/SrvDir.py", line 52, in getobj
self.obj = klassobj()
File "/usr/lib/python2.3/site-packages/xen/xend/server/SrvDomainD ir.py", line 39, in __init__
self.xd = XendDomain.instance()
File "/usr/lib/python2.3/site-packages/xen/xend/XendDomain.py&quo t;, line 582, in instance
inst.init()
File "/usr/lib/python2.3/site-packages/xen/xend/XendDomain.py&quo t;, line 70, in init
xstransact.Mkdir(VMROOT)
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 317, in Mkdir
complete(path, lambda t: t.mkdir(*args))
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 323, in complete
t = xstransact(path)
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xstransa ct.py", line 20, in __init__
self.transaction = xshandle().transaction_start()
File "/usr/lib/python2.3/site-packages/xen/xend/xenstore/xsutil.p y", line 18, in xshandle
xs_handle = xen.lowlevel.xs.xs()
RuntimeError: (111, 'Connection refused')



I actually experienced this same situation when i tried Fedora+xen3.0...
what could possibly be the reason for this?.

thanks in advance!
&pardon for my lengthy post.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 12 May 2006 at 11:32
[ View Steve's Scratchpad | View Weblogs ]

I'm afraid I don't have any idea!

I'd suggest posting a question to the xen-users mailing list to see if anybody can help.

Steve

[ Parent | Reply to this comment ]

Posted by Anonymous (213.94.xx.xx) on Wed 8 Feb 2006 at 17:28
Thanks for your excellent and practical write-up. However there's something that I think is a mistake. In this line:

root@itchy:~# xen-create-image --dir=/home/xen --hostname=test.my.flat --dhcp \
--fs=ext3 --size=2Gb --swap-128Mb --kernel=/boot/xen-modules-2.6.12.6-xen

should the kernel not be listed as --kernel=/boot/xen-kernel-2.6.12.6-xen?

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Wed 8 Feb 2006 at 17:38
[ View Steve's Scratchpad | View Weblogs ]

Yes.

Or better yet you should use xen-tools ;)

Steve

[ Parent | Reply to this comment ]

Posted by Anonymous (212.203.xx.xx) on Mon 20 Mar 2006 at 14:52
I had to remove the "/boot/" part from the grub config, everything else worked perfectly.

[ Parent | Reply to this comment ]

Posted by Anonymous (60.234.xx.xx) on Mon 17 Apr 2006 at 04:43
It's easy to miss that you need the pae version of the packages if you want to enable highmem support for Xen. Also if you have enabled highmem support on your based kernel and then you do not for Xen you will get an error like

PAE mode mismatch (Xen=n, Dom0=y)

CPU0 Panic

[ Parent | Reply to this comment ]

Posted by Anonymous (205.200.xx.xx) on Tue 25 Apr 2006 at 03:35

After following these instructions, attempts to boot the Xen kernel resulted in a few boot messages prefixed by [XEN], which ended with

[XEN] Scrubbing free RAM ...
[XEN] Xen trace buffers: disabled

And then the machine restarted itself. Further reading about Xen led me to believe that it should (after these messages) attempt to start up Linux.

A couple of tips to help diagnose such errors:

  • first of all, it's helpful to pass the kernel option "noreboot", to give yourself time to actually read the error messages
  • also try the option "sync_console" to make sure that all messages produced are displayed immediately. In my case this allowed me to see that it was in fact starting Linux, but that it was failing because it couldn't find the boot device (which in my case is the raid device /dev/md1).

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

What do you use for configuration management?








( 336 votes ~ 1 comments )

 

 

Related Links