# xen+grub: Error 13: Invalid or unsupported executable format

## disperato

I had been tempted a long time to try xen, but the sources in the portage are too old to get on with my laptop, until I found this ebuilds:

http://code.google.com/p/gentoo-xen-kernel/downloads/list?can=1&q=xen&colspec=Filename+Summary+Uploaded+Size+DownloadCount

I have made the ebuild ready for my portage tree with ebuild + digest, installed the sources, mrproper, oldconfig, set the .config by following this guide:

http://www.gentoo.org/doc/en/xen-guide.xml

and compiled the kernel the usual way like for every kernel upgrade made in the past.

Grub keeps giving the reported error:

```
Error 13: Invalid or unsupported executable format
```

Here is my grub.conf:

```
# Grub configuration boot file

# Boot automatically after 30 secs.

timeout 30

#

# By default, boot the first entry.

default 0

#

# Fallback to the third entry.

fallback 2

#

# Splash image to show behind grub.

splashimage=(hd0,0)/boot/grub/splashimages/splash.xpm.gz

#

# For booting GNU/Hurd

title  Default

root   (hd0,0)

kernel /boot/vmlinuz-prod ro root=/dev/sda2 resume=/dev/sda9 agp=off video=uvesafb:ywrap,mtrr:3,1280x800-8@60 pci=nomsi memory_corruption_check=1 vga=0x360 

#

title  Test

root   (hd0,0)

#kernel /boot/vmlinuz console=vga

kernel /boot/vmlinuz-2.6.31-xen-r5 console=vga

module /boot/vmlinuz-2.6.31-xen-r5 root=/dev/sda2 ro console=tty0

#kernel /boot/vmlinuz ro root=/dev/sda2 resume=/dev/sda9 agp=off video=uvesafb:ywrap,mtrr:3,1280x800-8@60 pci=nomsi memory_corruption_check=1 vga=ask 

#

title  Fallback

root   (hd0,0)

kernel /boot/vmlinuz-old ro root=/dev/sda2 resume=/dev/sda9 agp=off video=uvesafb:ywrap,mtrr:3,1280x800-8@60 pci=nomsi memory_corruption_check=1 vga=0x360 

#

## For installing GRUB into the hard disk

title Install GRUB into the hard disk

root    (hd0,0)

setup   (hd0)

## XEN options:

xenkopt=console=tty0

```

The commented lines under the title "Test", which correspond to the xen kernel, prove my previous attempts. Every try ended with the same error. I'm on a laptop with amd64x2 and the installation is all 64 bit. My aim is/was to use my current linux system as dom0 to use xen for running other non-linux systems in place of vmware (too much overhead).

Anyone who can shed a light?

----------

## bbgermany

Hi,

instead of vmlinuz-XXX in you kernel line of grub, there should be loaded the hypervisor. There should be a xen.gz (or something similiar) in your /boot directory. This must be set as kernel. The kernel will be loaded by the hypervisor after it booted successfully.

bb

----------

## disperato

 *bbgermany wrote:*   

> Hi,
> 
> instead of vmlinuz-XXX in you kernel line of grub, there should be loaded the hypervisor. There should be a xen.gz (or something similiar) in your /boot directory. This must be set as kernel. The kernel will be loaded by the hypervisor after it booted successfully.
> 
> bb

 

Thank you. It works fine now.

```
title  Xen 3.4

root   (hd0,0)

kernel /boot/xen.gz dom0_mem=262144

##modules after root= are related to my hw and conf:

module /boot/vmlinuz-2.6.31-xen-r5 ro root=/dev/sda2 resume=/dev/sda9 agp=off video=uvesafb:ywrap,mtrr:3,1280x800-8@60 pci=nomsi memory_corruption_check=1 vga=ask
```

----------

