30.5. Wrong kernel image error - using a non-Xen kernel in a para-virtualized guest

30.5. Wrong kernel image error - using a non-Xen kernel in a para-virtualized guest

If you try to boot a non-xen kernel in a para-virtualized guest you will see the following error message:

# xm create testVM
Using config file "./testVM".
Going to boot Red Hat Enterprise Linux Server (2.6.18-1.2839.el5)
kernel: /vmlinuz-2.6.18-1.2839.el5
initrd: /initrd-2.6.18-1.2839.el5.img
Error: (22, 'Invalid argument')

In the above error you can see that the kernel line shows that it's trying to boot a non-xen kernel. The correct entry in the example is ”kernel: /vmlinuz-2.6.18-1.2839.el5xen”.

The solution is to verify you have indeed installed a kernel-xen in your guest and it is the default kernel to boot in your /etc/grub.conf configuration file.

If you do have a kernel-xen installed in your guest you can start your guest using the command “xm create -c GuestName” where GuestName is the name of the kernel-xen. The previous command will present you with the Grub boot loader screen and allow you to select the kernel to boot. You will have to choose the kernel-xen kernel to boot. Once the guest has completed the boot process you can log into the guest and edit /etc/grub.conf to change the default boot kernel to your kernel-xen. Simply change the line “default=X” (where X is a number starting at '0') to correspond to the entry with your kernel-xen line. The numbering starts at '0' so if your kernel-xen entry is the second entry you would enter '1' as the default,for example “default=1”.


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.