Bug 237694 - virt-manager fails for kvm
Summary: virt-manager fails for kvm
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager   
(Show other bugs)
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Daniel Berrange
QA Contact: Martin Jenner
Depends On:
TreeView+ depends on / blocked
Reported: 2007-04-24 19:58 UTC by Josh Boyer
Modified: 2007-11-30 22:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-10-05 02:30:25 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Josh Boyer 2007-04-24 19:58:36 UTC
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

How reproducible:


Steps to Reproduce:
1. modprobe kvm-intel
2. start virt-manager
3. select QEMU hypervisor
Actual results:

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

Expected results:

Connects and starts (I guess?)

Additional info:

This is on a T60p Core Duo machine.

Comment 1 Daniel Berrange 2007-04-24 20:01:07 UTC
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.

Comment 2 Josh Boyer 2007-04-24 20:03:31 UTC
(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.

Comment 3 Josh Boyer 2007-04-24 20:14:24 UTC
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?

Comment 4 Josh Boyer 2007-04-24 20:25:29 UTC
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?

Comment 5 Josh Boyer 2007-04-24 20:56:41 UTC
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

Comment 6 Daniel Berrange 2007-04-24 23:17:42 UTC
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
httpd straightawy.

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

Comment 7 Josh Boyer 2007-04-25 00:39:56 UTC
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.

Comment 8 Deependra Singh Shekhawat 2007-04-26 06:05:52 UTC

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
KVM  sources.

Should I install Qemu separetely?

Comment 9 Josh Boyer 2007-04-30 11:55:36 UTC
(In reply to comment #8)
> Hello,
> 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

Comment 10 Red Hat Bugzilla 2007-07-25 02:09:30 UTC
change QA contact

Comment 11 Daniel Berrange 2007-09-27 21:09:00 UTC
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
Fedora soon....

Comment 12 Daniel Berrange 2007-10-05 02:30:25 UTC
libvirt-0.3.3 now available in rawhide removes the need to have QEMU installed
if only running KVM guests.

Note You need to log in before you can comment on or make changes to this bug.