KVM qemu-system-x86_64 *.img problem


#1

Hello all,
Help~~ I had met a problem:

    When I using the commad:  **qemu-system-x86_64 linux.img -m 1G** .
    And then I saw the logs: **Error 13:  Invalid or unsupported executable format **in QEMU window. So my RHEL 5.1 stopped and couldn't startup.
    But the same image file linux.img could sucessful startup in xen environment.

    Can you tell me the reason that why linux.img couldn't startup in KVM qemu environment ?
    And how to fix this issue?

   Waitting for your warmly help.
   Thanks.

#2

[quote=“snowrabit”]Hello all,
Help~~ I had met a problem:

    When I using the commad:  **qemu-system-x86_64 linux.img -m 1G** .
    And then I saw the logs: **Error 13:  Invalid or unsupported executable format **in QEMU window. So my RHEL 5.1 stopped and couldn't startup.
    But the same image file linux.img could sucessful startup in xen environment.

    Can you tell me the reason that why linux.img couldn't startup in KVM qemu environment ?
    And how to fix this issue?

   Waitting for your warmly help.
   Thanks.[/quote]

What does file linux.img give you?


#3

I use xen to create the linux.img .
And I find when the linux.img bootup in xen environment , the config file contains this line : < bootloader : /usr/bin/pygrub >.

Is that means I should use the ‘pygrub’ to startup the linux.img in kvm environment?


#4

Create a quick machine with a something.img file in the same location. Does it work or fail?
Are the permissions consistent from the one you just created to the one that you’re attempting to get to work?

Are you using SELinux on the host operating system? Go to the .img file and perform a ls -lZ and examine the SELinux contexts. If you think these are out of order (and “getenforce” shows “Enforcing”), try restorecon against your image file (do you have a backup?).

linux-kvm.org/page/HOWTO
You may have already seen the above link, there’s something there on converting Xen to KVM.