[libvirt-users] Connecting libvirt to manually compiled QEMU

Hello I have manually compiled a customized qemu (1.4.0) which runs fine on its own (create VM etc) but I want to access this qemu through libvirt (virt-manager, virsh etc). But the libvirt driver only looks into "/usr/bin" for qemu binaries, how can I tell libvirt to connect to my qemu which is placed at "/home/user/qemu" directory. -- Asadullah Hussain

On 03/04/2014 05:12 AM, Asadullah Hussain wrote:
Hello I have manually compiled a customized qemu (1.4.0) which runs fine on its own (create VM etc) but I want to access this qemu through libvirt (virt-manager, virsh etc).
But the libvirt driver only looks into "/usr/bin" for qemu binaries, how can I tell libvirt to connect to my qemu which is placed at "/home/user/qemu" directory.
Libvirt only looks into precompiled locations (default to /usr/bin) if you fail to specify an explicit location; but you can force libvirt to use your version of qemu by specifying the <emulator> element under <devices> in your domain XML. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Tue, Mar 04, 2014 at 02:09:19PM -0700, Eric Blake wrote:
On 03/04/2014 05:12 AM, Asadullah Hussain wrote:
Hello I have manually compiled a customized qemu (1.4.0) which runs fine on its own (create VM etc) but I want to access this qemu through libvirt (virt-manager, virsh etc).
But the libvirt driver only looks into "/usr/bin" for qemu binaries, how can I tell libvirt to connect to my qemu which is placed at "/home/user/qemu" directory.
Libvirt only looks into precompiled locations (default to /usr/bin) if you fail to specify an explicit location; but you can force libvirt to use your version of qemu by specifying the <emulator> element under <devices> in your domain XML.
Actually we will search through $PATH for QEMU binaries, so if you install somewhere unusual, just make sure libvirtd sees an updated $PATH env variable including the new location. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Guys thanks a lot for taking the time out to reply, Although adding the $PATH & symbolic link methods both solved the "No hypervisor found" error on virt-manager but when I try to create a VM using the wizard it says: "No hypervisor options were found for this connection" "This usually means that QEMU or KVM is not installed on your machine, or the KVM modules are not loaded." The QEMU I want to connect to libvirt has no KVM kernel drivers (DPDK Qemu). There is a single binary "qemu-system-x86_64" I am using virt-manager GUI to see whether qemu is being detected by libvirt or not (is there a better/CLI method?) On 5 March 2014 15:51, Daniel P. Berrange <berrange@redhat.com> wrote:
On Tue, Mar 04, 2014 at 02:09:19PM -0700, Eric Blake wrote:
On 03/04/2014 05:12 AM, Asadullah Hussain wrote:
Hello I have manually compiled a customized qemu (1.4.0) which runs fine on its own (create VM etc) but I want to access this qemu through libvirt (virt-manager, virsh etc).
But the libvirt driver only looks into "/usr/bin" for qemu binaries, how can I tell libvirt to connect to my qemu which is placed at "/home/user/qemu" directory.
Libvirt only looks into precompiled locations (default to /usr/bin) if you fail to specify an explicit location; but you can force libvirt to use your version of qemu by specifying the <emulator> element under <devices> in your domain XML.
Actually we will search through $PATH for QEMU binaries, so if you install somewhere unusual, just make sure libvirtd sees an updated $PATH env variable including the new location.
Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/:| |: http://libvirt.org -o- http://virt-manager.org:| |: http://autobuild.org -o- http://search.cpan.org/~danberr/:| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc:|
-- Asadullah Hussain

On Wed, Mar 19, 2014 at 05:17:52PM +0500, Asadullah Hussain wrote:
Guys thanks a lot for taking the time out to reply, Although adding the $PATH & symbolic link methods both solved the "No hypervisor found" error on virt-manager but when I try to create a VM using the wizard it says:
"No hypervisor options were found for this connection"
"This usually means that QEMU or KVM is not installed on your machine, or the KVM modules are not loaded."
The QEMU I want to connect to libvirt has no KVM kernel drivers (DPDK Qemu). There is a single binary "qemu-system-x86_64"
I am using virt-manager GUI to see whether qemu is being detected by libvirt or not (is there a better/CLI method?)
Yes, ignore virt-manager for now. You just want 'virsh capabilities' to show the binary you care about. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Still no success virsh capabilities doesn't return any "emulator" output. When I check the "libvirtd.log" there is an error: 2014-03-20 11:25:00.056+0000: 1014: error : virCommandWait:2188 : internal error Child process (LC_ALL=C PATH=/usr/local/sbin:/usr/ local/bin:/usr/bin:/usr/sbin:/sbin:/bin /usr/local/bin/qemu-system-x86_64 -help) status unexpected: exit status 1 I have searched mailing lists for this error ( https://lists.fedoraproject.org/pipermail/virt/2012-July/003358.html) but the solution suggested involves KVM which I cannot do (I just want to run simple qemu 1.4.0 ) libvirt version: 0.98 qemu: 1.4.0 On 19 March 2014 18:06, Daniel P. Berrange <berrange@redhat.com> wrote:
On Wed, Mar 19, 2014 at 05:17:52PM +0500, Asadullah Hussain wrote:
Guys thanks a lot for taking the time out to reply, Although adding the $PATH & symbolic link methods both solved the "No hypervisor found" error on virt-manager but when I try to create a VM using the wizard it says:
"No hypervisor options were found for this connection"
"This usually means that QEMU or KVM is not installed on your machine, or the KVM modules are not loaded."
The QEMU I want to connect to libvirt has no KVM kernel drivers (DPDK Qemu). There is a single binary "qemu-system-x86_64"
I am using virt-manager GUI to see whether qemu is being detected by libvirt or not (is there a better/CLI method?)
Yes, ignore virt-manager for now. You just want 'virsh capabilities' to show the binary you care about.
Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/:| |: http://libvirt.org -o- http://virt-manager.org:| |: http://autobuild.org -o- http://search.cpan.org/~danberr/:| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc:|
-- Asadullah Hussain

Fixed Thanks for all the help. It's simple just configured & installed QEMU 1.4.0 through standard way and restarted the libvirt-bin service through initctl. Libvirt runs *"qemu-system-x86_64 -help*" command to get the emulator version (virsh version). This option was disabled in my custom QEMU, so just had to enable it. On 20 March 2014 17:00, Asadullah Hussain <asadxflow@gmail.com> wrote:
Still no success virsh capabilities doesn't return any "emulator" output. When I check the "libvirtd.log" there is an error:
2014-03-20 11:25:00.056+0000: 1014: error : virCommandWait:2188 : internal error Child process (LC_ALL=C PATH=/usr/local/sbin:/usr/ local/bin:/usr/bin:/usr/sbin:/sbin:/bin /usr/local/bin/qemu-system-x86_64 -help) status unexpected: exit status 1
I have searched mailing lists for this error ( https://lists.fedoraproject.org/pipermail/virt/2012-July/003358.html) but the solution suggested involves KVM which I cannot do (I just want to run simple qemu 1.4.0 )
libvirt version: 0.98 qemu: 1.4.0
On 19 March 2014 18:06, Daniel P. Berrange <berrange@redhat.com> wrote:
On Wed, Mar 19, 2014 at 05:17:52PM +0500, Asadullah Hussain wrote:
Guys thanks a lot for taking the time out to reply, Although adding the $PATH & symbolic link methods both solved the "No hypervisor found" error on virt-manager but when I try to create a VM using the wizard it says:
"No hypervisor options were found for this connection"
"This usually means that QEMU or KVM is not installed on your machine, or the KVM modules are not loaded."
The QEMU I want to connect to libvirt has no KVM kernel drivers (DPDK Qemu). There is a single binary "qemu-system-x86_64"
I am using virt-manager GUI to see whether qemu is being detected by libvirt or not (is there a better/CLI method?)
Yes, ignore virt-manager for now. You just want 'virsh capabilities' to show the binary you care about.
Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
-- Asadullah Hussain
-- Asadullah Hussain
participants (3)
-
Asadullah Hussain
-
Daniel P. Berrange
-
Eric Blake