[libvirt] hvm/x86_64 combination not allowed

I have a VM that I am able to run using qemu form a command prompt with no problems. I want to run it from within libvirt, so I converted my qemu command to XML using 'virsh domxml-from-native ...' My problem is that my libvirt does not seem to support the x86_64 architecture, so when I try to launch the VM, the kernel won't built since it was installed on x86_64. My os container is as follows (as imported by virsh): <os> <type arch='i686' machine='pc-0.11'>hvm</type> <boot dev='hd'/> </os> However, when I try to change it to this: <os> <type arch='x86_64'>hvm</type> <boot dev='hd'/> </os> I get the following message: error: internal error os type 'hvm' & arch 'x86_64' combination is not supported I've searched for a proper command line switch to build this option into libvirt, but I have not had any success. So how do I get libvirt to support the x86_64 arch? Thanks, Steve PS: $ sudo virsh capabilities <capabilities> <host> <cpu> <arch>x86_64</arch> </cpu> <migration_features> <live/> <uri_transports> <uri_transport>tcp</uri_transport> </uri_transports> </migration_features> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc-0.11</machine> <machine canonical='pc-0.11'>pc</machine> <machine>pc-0.10</machine> <machine>isapc</machine> <domain type='qemu'> </domain> </arch> <features> <pae/> <nonpae/> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> </capabilities>

On Thu, Jan 14, 2010 at 01:26:35PM -0600, Steve Brown wrote:
I have a VM that I am able to run using qemu form a command prompt with no problems. I want to run it from within libvirt, so I converted my qemu command to XML using 'virsh domxml-from-native ...' My problem is that my libvirt does not seem to support the x86_64 architecture, so when I try to launch the VM, the kernel won't built since it was installed on x86_64. My os container is as follows (as imported by virsh):
<os> <type arch='i686' machine='pc-0.11'>hvm</type> <boot dev='hd'/> </os>
However, when I try to change it to this:
<os> <type arch='x86_64'>hvm</type> <boot dev='hd'/> </os>
I get the following message:
error: internal error os type 'hvm' & arch 'x86_64' combination is not supported
I've searched for a proper command line switch to build this option into libvirt, but I have not had any success. So how do I get libvirt to support the x86_64 arch?
Thanks, Steve
PS: $ sudo virsh capabilities <capabilities> <host> <cpu> <arch>x86_64</arch> </cpu> <migration_features> <live/> <uri_transports> <uri_transport>tcp</uri_transport> </uri_transports> </migration_features> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc-0.11</machine> <machine canonical='pc-0.11'>pc</machine> <machine>pc-0.10</machine> <machine>isapc</machine> <domain type='qemu'> </domain> </arch> <features> <pae/> <nonpae/> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> </capabilities>
Ok, this confirms your host OS is x86_64, but it only shows a single guest entry for i386. This is because the 'qemu' binar is the 32-bit emulator. To make x86_64 guests work, you need to install the qemu-system-x86_64 binary, or a KVM binary called 'kvm' or 'qemu-kvm'. Once those are installed, you should see another <guest> appear in that capabilities XML daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

$ sudo virsh capabilities <capabilities> <host> <cpu> <arch>x86_64</arch> </cpu> <migration_features> <live/> <uri_transports> <uri_transport>tcp</uri_transport> </uri_transports> </migration_features> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc-0.11</machine> <machine canonical='pc-0.11'>pc</machine> <machine>pc-0.10</machine> <machine>isapc</machine> <domain type='qemu'> </domain> </arch> <features> <pae/> <nonpae/> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> </capabilities>
Ok, this confirms your host OS is x86_64, but it only shows a single guest entry for i386. This is because the 'qemu' binar is the 32-bit emulator. To make x86_64 guests work, you need to install the qemu-system-x86_64 binary, or a KVM binary called 'kvm' or 'qemu-kvm'.
Once those are installed, you should see another <guest> appear in that capabilities XML
Unfortunately, I already have the 64bit emulator installed: $ which qemu-system-x86_64 /usr/local/bin/qemu-system-x86_64 $ ls -l /usr/local/bin/qemu-* -rwxr-xr-x 1 root root 217184 Jan 14 14:00 /usr/local/bin/qemu-img -rwxr-xr-x 1 root root 229120 Jan 14 14:00 /usr/local/bin/qemu-io -rwxr-xr-x 1 root root 210968 Jan 14 14:00 /usr/local/bin/qemu-nbd -rwxr-xr-x 1 root root 2323328 Jan 14 14:01 /usr/local/bin/qemu-system-x86_64 This was done by building the qemu-kvm-0.12.1.1 package from source. I am able to run this vm just fine using the qemu-system-x86_64 binary. I've tried rebuilding libvirt several times to make it aware that the proper binaries are installed, but it can't seem to find them for some reason.

2010/1/18 Steve Brown <sbrown25@gmail.com>:
$ sudo virsh capabilities <capabilities> <host> <cpu> <arch>x86_64</arch> </cpu> <migration_features> <live/> <uri_transports> <uri_transport>tcp</uri_transport> </uri_transports> </migration_features> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc-0.11</machine> <machine canonical='pc-0.11'>pc</machine> <machine>pc-0.10</machine> <machine>isapc</machine> <domain type='qemu'> </domain> </arch> <features> <pae/> <nonpae/> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> </capabilities>
Ok, this confirms your host OS is x86_64, but it only shows a single guest entry for i386. This is because the 'qemu' binar is the 32-bit emulator. To make x86_64 guests work, you need to install the qemu-system-x86_64 binary, or a KVM binary called 'kvm' or 'qemu-kvm'.
Once those are installed, you should see another <guest> appear in that capabilities XML
Unfortunately, I already have the 64bit emulator installed:
$ which qemu-system-x86_64 /usr/local/bin/qemu-system-x86_64 $ ls -l /usr/local/bin/qemu-* -rwxr-xr-x 1 root root 217184 Jan 14 14:00 /usr/local/bin/qemu-img -rwxr-xr-x 1 root root 229120 Jan 14 14:00 /usr/local/bin/qemu-io -rwxr-xr-x 1 root root 210968 Jan 14 14:00 /usr/local/bin/qemu-nbd -rwxr-xr-x 1 root root 2323328 Jan 14 14:01 /usr/local/bin/qemu-system-x86_64
This was done by building the qemu-kvm-0.12.1.1 package from source. I am able to run this vm just fine using the qemu-system-x86_64 binary. I've tried rebuilding libvirt several times to make it aware that the proper binaries are installed, but it can't seem to find them for some reason.
libvirt expects the QEMU binaries in /usr/bin. e.g. it explicitly checks for /usr/bin/qemu-system-x86_64. Try symlinking /usr/local/bin/qemu-system-x86_64 to /usr/bin/qemu-system-x86_64. I'm not sure why the paths are hardcoded instead of using the PATH to find the QEMU binaries, like the storage driver does it already: virFindFileInPath("qemu-img") Maybe Daniel can explain. Matthias

On 01/18/2010 04:59 PM, Matthias Bolte wrote:
2010/1/18 Steve Brown<sbrown25@gmail.com>:
$ sudo virsh capabilities <capabilities> <host> <cpu> <arch>x86_64</arch> </cpu> <migration_features> <live/> <uri_transports> <uri_transport>tcp</uri_transport> </uri_transports> </migration_features> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc-0.11</machine> <machine canonical='pc-0.11'>pc</machine> <machine>pc-0.10</machine> <machine>isapc</machine> <domain type='qemu'> </domain> </arch> <features> <pae/> <nonpae/> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> </capabilities>
Ok, this confirms your host OS is x86_64, but it only shows a single guest entry for i386. This is because the 'qemu' binar is the 32-bit emulator. To make x86_64 guests work, you need to install the qemu-system-x86_64 binary, or a KVM binary called 'kvm' or 'qemu-kvm'.
Once those are installed, you should see another<guest> appear in that capabilities XML
Unfortunately, I already have the 64bit emulator installed:
$ which qemu-system-x86_64 /usr/local/bin/qemu-system-x86_64 $ ls -l /usr/local/bin/qemu-* -rwxr-xr-x 1 root root 217184 Jan 14 14:00 /usr/local/bin/qemu-img -rwxr-xr-x 1 root root 229120 Jan 14 14:00 /usr/local/bin/qemu-io -rwxr-xr-x 1 root root 210968 Jan 14 14:00 /usr/local/bin/qemu-nbd -rwxr-xr-x 1 root root 2323328 Jan 14 14:01 /usr/local/bin/qemu-system-x86_64
This was done by building the qemu-kvm-0.12.1.1 package from source. I am able to run this vm just fine using the qemu-system-x86_64 binary. I've tried rebuilding libvirt several times to make it aware that the proper binaries are installed, but it can't seem to find them for some reason.
libvirt expects the QEMU binaries in /usr/bin. e.g. it explicitly checks for /usr/bin/qemu-system-x86_64. Try symlinking /usr/local/bin/qemu-system-x86_64 to /usr/bin/qemu-system-x86_64.
That's not enough. I have a locally-built qemu-system-x86_64 installed in /usr/bin, and the only way I could get it to work properly was copy /usr/bin/qemu-system-x86_64 to /usr/bin/qemu-kvm (a symlink would likely do the job just as well). There is a bit of code just doesn't happen unless /usr/bin/qemu-kvm or /usr/bin/kvm exist and are executable, although I have to say that once I solved my own problem by making a copy of the file with the proper name, I stopped trying to understood exactly what was happening in that code :-)

libvirt expects the QEMU binaries in /usr/bin. e.g. it explicitly checks for /usr/bin/qemu-system-x86_64. Try symlinking /usr/local/bin/qemu-system-x86_64 to /usr/bin/qemu-system-x86_64.
That's not enough. I have a locally-built qemu-system-x86_64 installed in /usr/bin, and the only way I could get it to work properly was copy /usr/bin/qemu-system-x86_64 to /usr/bin/qemu-kvm (a symlink would likely do the job just as well). There is a bit of code just doesn't happen unless /usr/bin/qemu-kvm or /usr/bin/kvm exist and are executable, although I have to say that once I solved my own problem by making a copy of the file with the proper name, I stopped trying to understood exactly what was happening in that code :-)
That's insane, but it solved the problem. I created a symlink in /usr/bin to /usr/local/bin/qemu-system-x86_64, and everything works perfectly now. FWIW, I didn't need /usr/bin/qemu or /usr/bin/qemu-kvm either. Thanks for the advice.

On Mon, Jan 18, 2010 at 10:59:23PM +0100, Matthias Bolte wrote:
$ which qemu-system-x86_64 /usr/local/bin/qemu-system-x86_64 $ ls -l /usr/local/bin/qemu-* -rwxr-xr-x 1 root root 217184 Jan 14 14:00 /usr/local/bin/qemu-img -rwxr-xr-x 1 root root 229120 Jan 14 14:00 /usr/local/bin/qemu-io -rwxr-xr-x 1 root root 210968 Jan 14 14:00 /usr/local/bin/qemu-nbd -rwxr-xr-x 1 root root 2323328 Jan 14 14:01 /usr/local/bin/qemu-system-x86_64
This was done by building the qemu-kvm-0.12.1.1 package from source. I am able to run this vm just fine using the qemu-system-x86_64 binary. I've tried rebuilding libvirt several times to make it aware that the proper binaries are installed, but it can't seem to find them for some reason.
libvirt expects the QEMU binaries in /usr/bin. e.g. it explicitly checks for /usr/bin/qemu-system-x86_64. Try symlinking /usr/local/bin/qemu-system-x86_64 to /usr/bin/qemu-system-x86_64.
I'm not sure why the paths are hardcoded instead of using the PATH to find the QEMU binaries, like the storage driver does it already:
virFindFileInPath("qemu-img")
We didn't have virFindFileInPath() when we first wrote the QEMU driver. It is well overdue for us to switch over to using that to detect QEMU binaries instead of hardcoding /usr/bin. If someone wants to send a patch, that'd be welcome Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

2010/1/19 Daniel P. Berrange <berrange@redhat.com>:
On Mon, Jan 18, 2010 at 10:59:23PM +0100, Matthias Bolte wrote:
$ which qemu-system-x86_64 /usr/local/bin/qemu-system-x86_64 $ ls -l /usr/local/bin/qemu-* -rwxr-xr-x 1 root root 217184 Jan 14 14:00 /usr/local/bin/qemu-img -rwxr-xr-x 1 root root 229120 Jan 14 14:00 /usr/local/bin/qemu-io -rwxr-xr-x 1 root root 210968 Jan 14 14:00 /usr/local/bin/qemu-nbd -rwxr-xr-x 1 root root 2323328 Jan 14 14:01 /usr/local/bin/qemu-system-x86_64
This was done by building the qemu-kvm-0.12.1.1 package from source. I am able to run this vm just fine using the qemu-system-x86_64 binary. I've tried rebuilding libvirt several times to make it aware that the proper binaries are installed, but it can't seem to find them for some reason.
libvirt expects the QEMU binaries in /usr/bin. e.g. it explicitly checks for /usr/bin/qemu-system-x86_64. Try symlinking /usr/local/bin/qemu-system-x86_64 to /usr/bin/qemu-system-x86_64.
I'm not sure why the paths are hardcoded instead of using the PATH to find the QEMU binaries, like the storage driver does it already:
virFindFileInPath("qemu-img")
We didn't have virFindFileInPath() when we first wrote the QEMU driver. It is well overdue for us to switch over to using that to detect QEMU binaries instead of hardcoding /usr/bin. If someone wants to send a patch, that'd be welcome
Regards, Daniel
Done :) See https://www.redhat.com/archives/libvir-list/2010-January/msg00603.html Matthias
participants (4)
-
Daniel P. Berrange
-
Laine Stump
-
Matthias Bolte
-
Steve Brown