All of lore.kernel.org
 help / color / mirror / Atom feed
* xl create doesn't like kernel
@ 2011-07-01 19:31 Mike Wright
  2011-07-04  8:54 ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Wright @ 2011-07-01 19:31 UTC (permalink / raw)
  To: xen

Hi all,

New to xen-4 and the new tools.

Running xen-4.1.1 with linux-3.0.0-rc5.

I have a kernel that boots on bare metal that I thought should boot as a 
domU.

This is the command: xl create vm1

Here are the first few lines of vm1's config file:

# Kernel image file.
kernel = "/boot/vmlinuz-2.6.35.6-45.fc14.i686"

# Optional ramdisk.
ramdisk = "/boot/initramfs-2.6.35.6-45.fc14.i686.img"

Here is the error message:

Parsing config file vm1
xc: error: elf_xen_note_check: ERROR: Will only load images built for 
the generic loader or Linux images: Invalid kernel
libxl: error: libxl_dom.c:196:libxl__build_pv xc_dom_parse_image failed: 
Success
cannot (re-)build domain: -3

I've seen a lot of the same errors on google but not for xen-4 and xl.

Any helpers out there?

TIA,
Mike Wright

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xl create doesn't like kernel
  2011-07-01 19:31 xl create doesn't like kernel Mike Wright
@ 2011-07-04  8:54 ` Ian Campbell
  2011-07-04 17:53   ` Mike Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2011-07-04  8:54 UTC (permalink / raw)
  To: Mike Wright; +Cc: xen

[-- Attachment #1: Type: text/plain, Size: 2966 bytes --]

On Fri, 2011-07-01 at 20:31 +0100, Mike Wright wrote:
> Hi all,
> 
> New to xen-4 and the new tools.
> 
> Running xen-4.1.1 with linux-3.0.0-rc5.
> 
> I have a kernel that boots on bare metal that I thought should boot as a 
> domU.
> 
> This is the command: xl create vm1
> 
> Here are the first few lines of vm1's config file:

Please can you provide the whole file please.

> # Kernel image file.
> kernel = "/boot/vmlinuz-2.6.35.6-45.fc14.i686"
> 
> # Optional ramdisk.
> ramdisk = "/boot/initramfs-2.6.35.6-45.fc14.i686.img"

Those paths are valid within the dom0 filesystem?

> Here is the error message:
> 
> Parsing config file vm1
> xc: error: elf_xen_note_check: ERROR: Will only load images built for 
> the generic loader or Linux images: Invalid kernel
> libxl: error: libxl_dom.c:196:libxl__build_pv xc_dom_parse_image failed: 
> Success
> cannot (re-)build domain: -3

Does "xl -vvv create vm1" give any more information?

I downloaded kernel-PAE-2.6.35.6-45.fc14.i686.rpm from
http://rpm.pbone.net/index.php3/stat/4/idpl/15471895/dir/fedora_14/com/kernel-PAE-2.6.35.6-45.fc14.i686.rpm.html (actually
ftp://ftp.sunet.se/pub/Linux/distributions/fedora/linux/releases/14/Everything/i386/os/Packages/kernel-PAE-2.6.35.6-45.fc14.i686.rpm ) which contained /boot/vmlinuz-2.6.35.6-45.fc14.i686.PAE with md5sum 09b04a528e1cb4939abb05c739b360e6 and it booted OK for me (until it failed due to lack of a ramdisk). I tried recent xen-unstable and current tip of xen-4.1-testing.hg (23096:45f5bdc1a90a).

I've attached "bzexlode.c" if you compile it then you can use it to
extract the payload from the vmlinuz, which you can then decompress to
get an elf file and run /usr/lib/xen/bin/readnotes on e.g:
        # /root/bzexplode /root/vmlinuz-2.6.35.6-45.fc14.i686.PAE | file - 
        [...]
        /dev/stdin: gzip compressed data, from Unix, last modified: Tue Oct 19 00:50:15 2010, max compression
        # /root/bzexplode /root/vmlinuz-2.6.35.6-45.fc14.i686.PAE | zcat > /tmp/x
        [...]
        # file /tmp/x
        /tmp/x: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
        # /usr/lib/xen/bin/readnotes /tmp/x
        GUEST_OS: linux
        GUEST_VERSION: 2.6
        XEN_VERSION: xen-3.0
        VIRT_BASE: 0xc0000000 (4 bytes)
        ENTRY: 0xc0a39000 (4 bytes)
        HYPERCALL_PAGE: 0xc0402000 (4 bytes)
        FEATURES: !writable_page_tables|pae_pgdir_above_4gb
        PAE_MODE: yes
        LOADER: generic
        L1_MFN_VALID: mask=0x1 value=0x1
        SUSPEND_CANCEL:        0x1 (4 bytes)
        HV_START_LOW: 0xf5800000 (4 bytes)
        PADDR_OFFSET:          0 (4 bytes)
        
Does that match what you see?


> I've seen a lot of the same errors on google but not for xen-4 and xl.
> 
> Any helpers out there?
> 
> TIA,
> Mike Wright
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel


[-- Attachment #2: bzexplode.c --]
[-- Type: text/x-csrc, Size: 1251 bytes --]

#include <stdio.h>
#include <fcntl.h>
#include <stdint.h>
#include <unistd.h>

#include <inttypes.h>

#include <err.h>

#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>

int main(int argc, char **argv)
{
	int fd;
	struct stat sb;
	void *p;
	uint8_t *hdr;
	int setup_sectors;
	uint32_t compressed_payload_offset;
	uint32_t compressed_payload_length;

	if (argc != 2)
		errx(1, "usage: bzexplode <bzImage>");

	fd = open(argv[1], O_RDONLY);
	if (fd < 0)
		err(1, "open");

	if (fstat(fd, &sb) < 0)
		err(1, "fstat");

	p = mmap(0, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
	if (p == MAP_FAILED)
		err(1, "mmap");

	hdr = p;
	setup_sectors = hdr[0x1f1];
	compressed_payload_offset = *(uint32_t*)&hdr[0x248];

	fprintf(stderr, "setup sectors %d\n", setup_sectors);

	compressed_payload_offset += (setup_sectors+1) * 512;

	//compressed_payload_length = *(uint32_t*)(p + compressed_payload_offset - 4);
	compressed_payload_length = *(uint32_t*)&hdr[0x24c];

	fprintf(stderr, "compressed_payload_offset %"PRIx32" (abs)\n",
		compressed_payload_offset);
	fprintf(stderr, "compressed_payload_length %"PRIx32"\n",
		compressed_payload_length);

	write(1,
	      p + compressed_payload_offset,
	      compressed_payload_length);
	return 0;
}

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xl create doesn't like kernel
  2011-07-04  8:54 ` Ian Campbell
@ 2011-07-04 17:53   ` Mike Wright
  2011-07-04 18:23     ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Wright @ 2011-07-04 17:53 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen

On 07/04/2011 01:54 AM, Ian Campbell wrote:
> On Fri, 2011-07-01 at 20:31 +0100, Mike Wright wrote:
>> Hi all,
>>
>> New to xen-4 and the new tools.
>>
>> Running xen-4.1.1 with linux-3.0.0-rc5.
>>
>> I have a kernel that boots on bare metal that I thought should boot as a
>> domU.
>>
>> This is the command: xl create vm1
>>
>> Here are the first few lines of vm1's config file:
>
> Please can you provide the whole file please.

Thanks for replying, Ian.

Turns out I'd messed up in a couple of places.  I'd used sda for my 
targets instead of xvda and no 'root =' in the vm's config.

In the vm's /etc/fstab I hadn't adjusted / and /swap to /dev/xvda?, nor 
had I commented out /boot.

After that all was well in virtualization land ;)

>
>> # Kernel image file.
>> kernel = "/boot/vmlinuz-2.6.35.6-45.fc14.i686"
>>
>> # Optional ramdisk.
>> ramdisk = "/boot/initramfs-2.6.35.6-45.fc14.i686.img"
>
> Those paths are valid within the dom0 filesystem?
>
>> Here is the error message:
>>
>> Parsing config file vm1
>> xc: error: elf_xen_note_check: ERROR: Will only load images built for
>> the generic loader or Linux images: Invalid kernel
>> libxl: error: libxl_dom.c:196:libxl__build_pv xc_dom_parse_image failed:
>> Success
>> cannot (re-)build domain: -3
>
> Does "xl -vvv create vm1" give any more information?
>
> I downloaded kernel-PAE-2.6.35.6-45.fc14.i686.rpm from
> http://rpm.pbone.net/index.php3/stat/4/idpl/15471895/dir/fedora_14/com/kernel-PAE-2.6.35.6-45.fc14.i686.rpm.html (actually
> ftp://ftp.sunet.se/pub/Linux/distributions/fedora/linux/releases/14/Everything/i386/os/Packages/kernel-PAE-2.6.35.6-45.fc14.i686.rpm ) which contained /boot/vmlinuz-2.6.35.6-45.fc14.i686.PAE with md5sum 09b04a528e1cb4939abb05c739b360e6 and it booted OK for me (until it failed due to lack of a ramdisk). I tried recent xen-unstable and current tip of xen-4.1-testing.hg (23096:45f5bdc1a90a).
>
> I've attached "bzexlode.c" if you compile it then you can use it to
> extract the payload from the vmlinuz, which you can then decompress to
> get an elf file and run /usr/lib/xen/bin/readnotes on e.g:
>          # /root/bzexplode /root/vmlinuz-2.6.35.6-45.fc14.i686.PAE | file -
>          [...]
>          /dev/stdin: gzip compressed data, from Unix, last modified: Tue Oct 19 00:50:15 2010, max compression
>          # /root/bzexplode /root/vmlinuz-2.6.35.6-45.fc14.i686.PAE | zcat>  /tmp/x
>          [...]
>          # file /tmp/x
>          /tmp/x: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
>          # /usr/lib/xen/bin/readnotes /tmp/x
>          GUEST_OS: linux
>          GUEST_VERSION: 2.6
>          XEN_VERSION: xen-3.0
>          VIRT_BASE: 0xc0000000 (4 bytes)
>          ENTRY: 0xc0a39000 (4 bytes)
>          HYPERCALL_PAGE: 0xc0402000 (4 bytes)
>          FEATURES: !writable_page_tables|pae_pgdir_above_4gb
>          PAE_MODE: yes
>          LOADER: generic
>          L1_MFN_VALID: mask=0x1 value=0x1
>          SUSPEND_CANCEL:        0x1 (4 bytes)
>          HV_START_LOW: 0xf5800000 (4 bytes)
>          PADDR_OFFSET:          0 (4 bytes)
>
> Does that match what you see?
>
>
>> I've seen a lot of the same errors on google but not for xen-4 and xl.
>>
>> Any helpers out there?
>>
>> TIA,
>> Mike Wright
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xl create doesn't like kernel
  2011-07-04 17:53   ` Mike Wright
@ 2011-07-04 18:23     ` Ian Campbell
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2011-07-04 18:23 UTC (permalink / raw)
  To: Mike Wright; +Cc: xen

On Mon, 2011-07-04 at 18:53 +0100, Mike Wright wrote:
> On 07/04/2011 01:54 AM, Ian Campbell wrote:
> > On Fri, 2011-07-01 at 20:31 +0100, Mike Wright wrote:
> >> Hi all,
> >>
> >> New to xen-4 and the new tools.
> >>
> >> Running xen-4.1.1 with linux-3.0.0-rc5.
> >>
> >> I have a kernel that boots on bare metal that I thought should boot as a
> >> domU.
> >>
> >> This is the command: xl create vm1
> >>
> >> Here are the first few lines of vm1's config file:
> >
> > Please can you provide the whole file please.
> 
> Thanks for replying, Ian.
> 
> Turns out I'd messed up in a couple of places.  I'd used sda for my 
> targets instead of xvda and no 'root =' in the vm's config.
> 
> In the vm's /etc/fstab I hadn't adjusted / and /swap to /dev/xvda?, nor 
> had I commented out /boot.
> 
> After that all was well in virtualization land ;)

Great, glad to hear it's all sorted.

Ian.

> 
> >
> >> # Kernel image file.
> >> kernel = "/boot/vmlinuz-2.6.35.6-45.fc14.i686"
> >>
> >> # Optional ramdisk.
> >> ramdisk = "/boot/initramfs-2.6.35.6-45.fc14.i686.img"
> >
> > Those paths are valid within the dom0 filesystem?
> >
> >> Here is the error message:
> >>
> >> Parsing config file vm1
> >> xc: error: elf_xen_note_check: ERROR: Will only load images built for
> >> the generic loader or Linux images: Invalid kernel
> >> libxl: error: libxl_dom.c:196:libxl__build_pv xc_dom_parse_image failed:
> >> Success
> >> cannot (re-)build domain: -3
> >
> > Does "xl -vvv create vm1" give any more information?
> >
> > I downloaded kernel-PAE-2.6.35.6-45.fc14.i686.rpm from
> > http://rpm.pbone.net/index.php3/stat/4/idpl/15471895/dir/fedora_14/com/kernel-PAE-2.6.35.6-45.fc14.i686.rpm.html (actually
> > ftp://ftp.sunet.se/pub/Linux/distributions/fedora/linux/releases/14/Everything/i386/os/Packages/kernel-PAE-2.6.35.6-45.fc14.i686.rpm ) which contained /boot/vmlinuz-2.6.35.6-45.fc14.i686.PAE with md5sum 09b04a528e1cb4939abb05c739b360e6 and it booted OK for me (until it failed due to lack of a ramdisk). I tried recent xen-unstable and current tip of xen-4.1-testing.hg (23096:45f5bdc1a90a).
> >
> > I've attached "bzexlode.c" if you compile it then you can use it to
> > extract the payload from the vmlinuz, which you can then decompress to
> > get an elf file and run /usr/lib/xen/bin/readnotes on e.g:
> >          # /root/bzexplode /root/vmlinuz-2.6.35.6-45.fc14.i686.PAE | file -
> >          [...]
> >          /dev/stdin: gzip compressed data, from Unix, last modified: Tue Oct 19 00:50:15 2010, max compression
> >          # /root/bzexplode /root/vmlinuz-2.6.35.6-45.fc14.i686.PAE | zcat>  /tmp/x
> >          [...]
> >          # file /tmp/x
> >          /tmp/x: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
> >          # /usr/lib/xen/bin/readnotes /tmp/x
> >          GUEST_OS: linux
> >          GUEST_VERSION: 2.6
> >          XEN_VERSION: xen-3.0
> >          VIRT_BASE: 0xc0000000 (4 bytes)
> >          ENTRY: 0xc0a39000 (4 bytes)
> >          HYPERCALL_PAGE: 0xc0402000 (4 bytes)
> >          FEATURES: !writable_page_tables|pae_pgdir_above_4gb
> >          PAE_MODE: yes
> >          LOADER: generic
> >          L1_MFN_VALID: mask=0x1 value=0x1
> >          SUSPEND_CANCEL:        0x1 (4 bytes)
> >          HV_START_LOW: 0xf5800000 (4 bytes)
> >          PADDR_OFFSET:          0 (4 bytes)
> >
> > Does that match what you see?
> >
> >
> >> I've seen a lot of the same errors on google but not for xen-4 and xl.
> >>
> >> Any helpers out there?
> >>
> >> TIA,
> >> Mike Wright
> >>
> >> _______________________________________________
> >> Xen-devel mailing list
> >> Xen-devel@lists.xensource.com
> >> http://lists.xensource.com/xen-devel
> >
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-04 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-01 19:31 xl create doesn't like kernel Mike Wright
2011-07-04  8:54 ` Ian Campbell
2011-07-04 17:53   ` Mike Wright
2011-07-04 18:23     ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.