# Error 13 invalid or unsupported executable format,Xen kernel

## aobradovic

I am having problems booting from the Xen kernel. I get

Error 13 invalid or unsupported executable format

when I try to boot kernel 2.6.16.28-xen-r2  on Gentoo AMD64 installation on Core 2 Duo. 

I followed  everything from 

http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo

I built the xen kernel and copied it to boot. 

Here it is

# cat /boot/vmlinuz-2.6.16.28-xen-r2 | gunzip | file -

/dev/stdin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

 uname -a

Linux localhost 2.6.19-gentoo-r5 #2 SMP PREEMPT Wed Feb 28 20:31:38 PST 2007 x86_64 Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz GenuineIntel GNU/Linux

 uname -a

/dev/hda3 on / type ext3 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)

udev on /dev type tmpfs (rw,nosuid)

devpts on /dev/pts type devpts (rw,nosuid,noexec)

/dev/hda1 on /boot type ext2 (rw)

none on /dev/shm type tmpfs (rw)

The regular non-xen kernel works fine: 

file /boot/vmlinuz-2.6.19-gentoo-r5

/boot/vmlinuz-2.6.19-gentoo-r5: Linux kernel x86 boot executable RO-rootFS, root_dev 0x303, swap_dev 0x2, Normal VGA

here is my grub configuration

default 0

timeout 30from

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

title=Gentoo Linux 2.6.19

root (hd0,0)

kernel /vmlinuz root=/dev/hda3

title=XEN Gentoo Linux vmlinuz-2.6.16.28-xen-r2

root (hd0,0)

kernel /vmlinuz-2.6.16.28-xen-r2 root=/dev/hda3

Any ideas? Some posts are suggesting that I have 64/32bit architecture mixup here, but I am not sure if that is the case. I installed everything from the 2006.1 AMD64 distribution, then rebuilt the whole system and I am completely up to date with everything.

----------

## velociphile

Hi aobradovic,

Did you get to the bottom of this? I've got the exact same problem...

Cheers!

----------

## aobradovic

Yes, I had incorrect entry in my grub. See this thread

https://forums.gentoo.org/viewtopic-t-544192-highlight-.html

----------

## velociphile

Thanks!

I'd found the same thing since I wrote that - must RTFM next time! - but have another prob, Xen and nvidia-drivers not playing happily at the moment. Oh well.

Thanks again for the quick reply.

----------

## evilshenaniganz

I just got the binary Nvidia driver working with Xen.  I had to peruse nvnews for a bit, but I finally hit jackpot one one solution.  For anybody wishing to try, my system specs are:

Athlon XP 2600+

1GB RAM

Gainward Nvidia GeForce FX 5600

I had to drop back to xen-sources-2.6.18-r4 instead of using the latest and greatest (2.6.20-r3).  I also used nvidia-drivers-1.0.9746-r1.  Here's what I had to do to make it work.

1.  Start with a running, non-Xen kernel-- in my case it was gentoo-sources-2.6.21-r4-- and clean out all nvidia-drivers:

```
emerge -vCa nvidia-drivers
```

2.  Make sure /usr/src/linux points to your current, non-Xen kernel then emerge nvidia-drivers-1.0.9746-r1:

```
emerge -v =nvidia-drivers-1.0.9746-r1
```

3.  Compile your 2.6.18-r4 dom0 Xen kernel and reboot into it.

4.  Download Nvidia's installer for 1.0.9746-r1 and then extract it to /root by running the following:

```
sh NVIDIA-Linux-x86-1.0-9746-pkg1.run -x
```

5.  Save baco's patch to /root after downloading it here:  NVIDIA_xen-9746.patch.gz

6.  Run the following commands to prep and install the module (thanks to baco for contributing these steps):

```
cd ~/NVIDIA-Linux-x86-1.0-9746-pkg1/usr/src/nv

zcat ../../../../NVIDIA_xen-9746.patch.gz | patch -p4

cd ~/NVIDIA-Linux-x86-1.0-9746-pkg1/usr

cp -Rv * /usr

cd /usr/src/nv

export SYSSRC=/usr/src/linux

make module

install -D -o root -g root -m 0644 nvidia.ko /lib/modules/$(uname -r)/video/nvidia.ko

depmod -a

modprobe nvidia
```

7.  Edit your /etc/X11/xorg.conf file to use the "nvidia" driver instead of the Xorg "nv" driver and be sure to enable glx.

Hope this works and good luck!

----------

