Bug 860633

Summary: 'virsh list' does not print error when not run as root
Product: [Fedora] Fedora Reporter: Stef Walter <stefw>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: berrange, clalancette, dallan, eblake, itamar, jforbes, jyang, laine, libvirt-maint, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-26 11:29:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stef Walter 2012-09-26 11:18:38 UTC
Description of problem:

When run as a non-root user 'virsh list' does not print any virtual machines. It also does not report an error:

[stef@stef-rawhide ~]$ virsh list
 Id    Name                           State
----------------------------------------------------

Version-Release number of selected component (if applicable):

[root@stef-rawhide data]# rpm -qf /usr/bin/virsh 
libvirt-client-0.10.2-3.fc18.x86_64

Comment 1 Eric Blake 2012-09-26 11:29:50 UTC
Not a bug.  By default, non-root users connect to 'qemu:///session' rather than 'qemu:///system', and as that is a different URI tied to a different instance of libvirtd, the output is expected to be different.  To get the system listing as non-root, you must set your desired URI, such as by 'virsh -c qemu:///system list'.

Comment 2 Dave Allan 2012-09-26 13:28:17 UTC
(In reply to comment #1)
> Not a bug.  By default, non-root users connect to 'qemu:///session' rather
> than 'qemu:///system', and as that is a different URI tied to a different
> instance of libvirtd, the output is expected to be different.  To get the

To put it another way, you can define and start VMs with the session URI and then you will see them when you connect to session and list VMs, but the set of VMs on the session URI will always be different from the system URI.  See http://libvirt.org/drvqemu.html for more information.