Description of problem: virsh does not honor uri_default setting in /etc/libvirt/libvirt.conf. I have 'uri_default = "qemu:///system"' uncommented in /etc/libvirt/libvirt.conf but running 'virsh uri' shows that I'm still connecting to qemu:///session. Version-Release number of selected component (if applicable): [root@dublin libvirt]# rpm -q libvirt libvirt-client libvirt-1.0.5.5-1.fc19.x86_64 libvirt-client-1.0.5.5-1.fc19.x86_64 How reproducible: [jslagle@dublin ~]$ grep uri_default /etc/libvirt/libvirt.conf uri_default = "qemu:///system" [jslagle@dublin ~]$ virsh uri qemu:///session (I tried restarting libvirtd as well, but that had no effect) Note that setting the value in ~/.config/libvirt/libvirt.conf does work: [jslagle@dublin ~]$ echo uri_default = \"qemu:///system\" >> ~/.config/libvirt/libvirt.conf [jslagle@dublin ~]$ virsh uri qemu:///system Actual results: I'm still connecting to qemu:///session Expected results: should be connected to qemu:///system Additional info:
The test steps you list work fine for me. $ virsh uri qemu:///session $ echo uri_default = \"qemu:///system\" >> ~/.config/libvirt/libvirt.conf $ virsh uri qemu:///system Do you have either LIBVIRT_DEFAULT_URI or VIRSH_DEFAULT_CONNECT_URI env variables set ? Those will override what's in the config file.
(In reply to Daniel Berrange from comment #1) > The test steps you list work fine for me. > > $ virsh uri > qemu:///session > $ echo uri_default = \"qemu:///system\" >> ~/.config/libvirt/libvirt.conf > $ virsh uri > qemu:///system Yes, setting the value in ~/.config/libvirt/libvirt.conf does work for me as I noted. Setting it in /etc/libvirt/libvirt.conf is what does not work. > Do you have either LIBVIRT_DEFAULT_URI or VIRSH_DEFAULT_CONNECT_URI env > variables set ? Those will override what's in the config file. No.
(In reply to James Slagle from comment #2) > (In reply to Daniel Berrange from comment #1) > > The test steps you list work fine for me. > > > > $ virsh uri > > qemu:///session > > $ echo uri_default = \"qemu:///system\" >> ~/.config/libvirt/libvirt.conf > > $ virsh uri > > qemu:///system > > Yes, setting the value in ~/.config/libvirt/libvirt.conf does work for me as > I noted. > > Setting it in /etc/libvirt/libvirt.conf is what does not work. That works if you are running virsh as root. The /etc/libvirt directory is intentionally not readable by non-root users, since some of the files there may contain passwords.