Xen domainU Boot Fails with Invalid kernel / ERROR: Not a Xen-ELF image Message
The specific problem involves the appearence of the following error message when attempting to boot a Xen guest (domainU) system:
Error: (2, 'Invalid kernel', "elf_xen_note_check: ERROR: Not a Xen-ELF image: No ELF notes or '__xen_guest' section found.\n")
This problem typically occurs when attmpting to boot from a QEMU disk image file using the pyGRUB tool, although it can also be encountered in other scenarios.
The most common cause of this problem is due to configuration problems in the /etc/grub/grub.conf file of the domainU system. When the package management tools of a Linux distribution are used to install Xen on the domainU filesystems the assumption is sometimes made that the system is to run with the Xen hypervisor which is actually prohibited in a domainU system.
An incorrectly configured grub.conf file will typically appear as follows:
title CentOS Xen (2.6.18-53.1.14.el5xen) root (hd0,0) kernel /xen.gz-2.6.18-53.1.14.el5 module /vmlinuz-2.6.18-53.1.14.el5xen ro root=LABEL=/ module /myinitrd.img title CentOS (2.6.18-53.el5) root (hd0,0) kernel /vmlinuz-2.6.18-53.el5 ro root=LABEL=/ initrd /initrd-2.6.18-53.el5.img
In order to correct this we need to modify the values for the Xen boot option so that it reads as follows. Note that you will need to mount the filesystem or disk image containing the boot partition of the Xen guest to access this file:
title CentOS (2.6.18-53.1.14.el5xen) root (hd0,0) kernel /vmlinuz-2.6.18-53.1.14.el5xen ro root=LABEL=/ initrd /myinitrd.img title CentOS (2.6.18-53.el5) root (hd0,0) kernel /vmlinuz-2.6.18-53.el5 ro root=LABEL=/ initrd /initrd-2.6.18-53.el5.img
Once the above changes have been made it should be possible to start the domainU system successfully.