Red Hat Bugzilla – Bug 237694
virt-manager fails for kvm
Last modified: 2007-11-30 17:12:02 EST
Description of problem:
virt-manager cannot connect to the QEMU hypervisor which makes using it for kvm fail
Version-Release number of selected component (if applicable):
[jwboyer@zod virt]$ rpm -q libvirt
[jwboyer@zod virt]$ rpm -q kernel
[jwboyer@zod virt]$ rpm -q kvm
Steps to Reproduce:
1. modprobe kvm-intel
2. start virt-manager
3. select QEMU hypervisor
Unable to open connection to hypervisor URI 'qemu:///system':
<class 'libvirt.libvirtError'> virConnectOpenReadOnly() failed
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/engine.py", line 68, in _connect_to_uri
conn = self.get_connection(uri, readOnly)
File "/usr/share/virt-manager/virtManager/engine.py", line 309, in get_connection
conn = vmmConnection(self.get_config(), uri, readOnly)
File "/usr/share/virt-manager/virtManager/connection.py", line 74, in __init__
self.vmm = libvirt.openReadOnly(openURI)
File "/usr/lib/python2.5/site-packages/libvirt.py", line 109, in openReadOnly
if ret is None:raise libvirtError('virConnectOpenReadOnly() failed')
libvirtError: virConnectOpenReadOnly() failed
Connects and starts (I guess?)
This is on a T60p Core Duo machine.
Can you confirm whether 'service libvirtd status' shows any PID(s) running. If
so, for each one, do an 'lsof -p <pid>' and paste the output.
(In reply to comment #1)
> Can you confirm whether 'service libvirtd status' shows any PID(s) running. If
> so, for each one, do an 'lsof -p <pid>' and paste the output.
No, it wasn't. Started it and things connect now. Should this service be
started automatically on install?
I'm just wondering how I would know to start that as a user.
ok, on to the next issue... after it connected, I selected an accelerated guest,
and it fails with:
Unable to complete install '<class 'libvirt.libvirtError'>
virDomainCreateLinux() failed internal error Cannot find QEMU binary
/usr/bin/qemu: No such file or directory
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/create.py", line 677, in do_install
dom = guest.start_install(False, meter = meter)
File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 649, in
return self._do_install(consolecb, meter)
File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 666, in
self.domain = self.conn.createLinux(install_xml, 0)
File "/usr/lib/python2.5/site-packages/libvirt.py", line 480, in createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: virDomainCreateLinux() failed internal error Cannot find QEMU
binary /usr/bin/qemu: No such file or directory
shouldn't it be looking for qemu-kvm?
Ok, installed the qemu package and things are working better. I noticed that it
started qemu-kvm even though it seems to require qemu to be installed. Should
virt-manager have a Requires: on qemu?
Also, I seem to have a defunct libvirtd process handing around...
[root@zod init.d]# sudo /sbin/service libvirtd restart
Stopping libvirtd daemon: [ OK ]
Starting libvirtd daemon: [ OK ]
[root@zod init.d]# ps ax | grep libvirt
2541 ? S 0:00 libvirt_qemud --system --daemon
2606 ? Z 0:00 [libvirt_qemud] <defunct>
2633 pts/10 S+ 0:00 grep libvirt
The RPM %post script registers the libvirtd init script to automatically start
upon boot - it doesn't explicitly start it though, which is normal practice - eg
apache %post script registers its httpd init script, but doesn't actually start
So, if you're doing a fresh install, libvirtd should be running automatically at
the first boot after install. If doing an in-place upgrade, it'll get started
the first time you reboot after the upgrade.
That said, we need to provide a more intelligable error message than simply
'libvirtError: virConnectOpenReadOnly() failed', to give the user some clue as
to what went wrong. In the xen case we already explicitly tell the user to check
whether xend is running - we should do the same in QEMU case.
Now, onto comment #3 - KVM is just implemented as a special case of the QEMU
driver - for certain other purposes we need to run the regular /usr/bin/qemu
binary at least once. In the future qemu-kvm will just be a command line switch
to regular qemu.
Now, comment #4 - having a Requires: qemu will force Xen users to have QEMU
install, or similarly having a Requires: xen, would force QEMU users to have Xen
installed. Also, neither case deals with the fact that virt-manager will talk to
a remote hypervisor - local Requires: tags are irrelevant in that case as
there's no need to have anythin installed locally there. Again I think we
primarily need to provide clearer error reporting in this scenario.
Finally, comment #5 is definitely a bug - the 'dnsmasq' daemon has not started
up - most likely dnsmasq is not installed, because there is a missing RPM
dependancy in this case. I'll correct that dependancy.
So I reckon three things to address here:
1. Provide much better error reporting for initial connection failure against
2. Improve error reporting upon domain creation
3. Add RPM dep on dnsmasq
Agreed with everything you said.
The particular case I ran into with libvirtd was basically not during OS install
_or_ upgrade. I literally did a "yum install virt-manager" and expected things
to work. I completely understand why the service isn't started during rpm
install, and I think a sufficient error message telling the user to check
libvirtd should cover this case as well.
Thanks for taking the time to read all my comments. I realized a bit late that
I was lumping a bunch of stuff into the same bug and generally turning into the
bug reporter from hell.
If you need help testing anything as things are fixed up, let me know.
Can you please tell me how you installed qemu-kvm? I tried both kvm-19-1.src.rpm
and kvm-20.tar.gz (vanilla) but couldn't install /usr/bin/qemu-kvm?
It seems that qemu has been modified for KVM. And I am using Qemu compiled via
Should I install Qemu separetely?
(In reply to comment #8)
> Can you please tell me how you installed qemu-kvm? I tried both kvm-19-1.src.rpm
> and kvm-20.tar.gz (vanilla) but couldn't install /usr/bin/qemu-kvm?
qemu-kvm is provided by the kvm package in Fedora Extras. If you have that
repository enabled, just do:
yum install kvm
change QA contact
Latest upstream libvirt CVS repo now contains a patch to remove the need to have
QEMU installed when merely running KVM. This will be included in an update to
libvirt-0.3.3 now available in rawhide removes the need to have QEMU installed
if only running KVM guests.