kvm default install throws "Unable to open a connection to the libvirt management daemon" requires logout + login

Bug #736844 reported by Fabián Rodríguez
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
qemu-kvm (Ubuntu)
Won't Fix
Low
Dustin Kirkland 

Bug Description

Binary package hint: qemu-kvm

The default kvm installation does not work out of the box, instead throwing this message when starting virt-manager, which doesn't help much:

Unable to open a connection to the libvirt management daemon.

Libvirt URI is: qemu:///system

Verify that:
 - The 'libvirt-bin' package is installed
 - The 'libvirtd' daemon has been started
 - You are member of the 'libvirtd' group

The message should at least propose to logout / login to complete the installation, or the installation post-install scripts should warn / force this. Ideally this should not be necessary so we have the best user experience.

The need to login/logout is mentioned in the installation docs FWIW, but surely this can be improved:
https://help.ubuntu.com/community/KVM/Installation#Add%20Users%20to%20Groups

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: kvm 1:84+dfsg-0ubuntu16+0.14.0+noroms+0ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-6.34-generic 2.6.38-rc7
Uname: Linux 2.6.38-6-generic x86_64
Architecture: amd64
Date: Thu Mar 17 09:09:29 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20110315)
KvmCmdLine: Error: command ['ps', '-C', 'kvm', '-F'] failed with exit code 1: UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
MachineType: System manufacturer System Product Name
ProcEnviron:
 LANGUAGE=en_US:en
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-2.6.38-6-generic root=/dev/mapper/hostname-root ro quiet splash vt.handoff=7
SourcePackage: qemu-kvm
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 07/22/2010
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1604
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: P7H55-M PRO
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr1604:bd07/22/2010:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP7H55-MPRO:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Fabián Rodríguez (magicfab) wrote :
description: updated
summary: - kvm default install requires logout + login
+ kvm default install throws "Unable to open a connection to the libvirt
+ management daemon" requires logout + login
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug and helping to make Ubuntu better.

Do you have any suggestions for where we could place a more helpful message?

I'm assigning to Dustin as he might have an idea of where we can, or why we shouldn't, do so. On the one hand I can see a new user wanting to see that message pop up after installing the package. On the other hand, an admin installing 100s of machines won't want to waste time clicking 'ok' 100 times. Dustin, do you have any advice? Can we have the .postinst script simply echo a msg and expect dpkg, apt, and synaptic all do the right thing?

Changed in qemu-kvm (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
status: New → Incomplete
importance: Undecided → Low
Revision history for this message
Fabián Rodríguez (magicfab) wrote :

As I wrote in my initial report:
"The message should at least propose to logout / login to complete the installation, or the installation post-install scripts should warn / force this. Ideally this should not be necessary so we have the best user experience."

Right after installation is when I would expect a more useful message to pop-up in notifications / power-menu (forgot what it's called), much like updates that require a reboot.

Revision history for this message
Goksu (gun-goksu) wrote :

Hi,

The reason the error shows is because with apt-get your user is not added to the necessary group.
this should somehow be handled within the install script.
a logoff/login is then required to get that setting activated (though there should be another way in linux).

Hope this helps.

the link: https://help.ubuntu.com/community/KVM/Installation

---QUOTE---
You need to ensure that your username is added to the group libvirtd:

$ sudo adduser `id -un` libvirtd
Adding user '<username>' to group 'libvirtd' ...
After this, you need to relogin ...
---/QUOTE---

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

This is addressed in the documentation. There's really no good way to do this automatically. Running 'newgrp libvirtd' to start a new shell from which to run virsh commands comes closest.

Changed in qemu-kvm (Ubuntu):
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.