Ask Your Question
0

configuring libvirt uri and setting permissions

asked 2013-07-25 09:20:00 -0500

a7ndrew gravatar image

updated 2013-07-25 09:26:03 -0500

How do I set the connection uri in Fedora?

[andrew@tree ~]$ cat ~/.libvirt/libvirt.conf 
uri_default='qemu:///system'

[andrew@tree ~]$ virsh uri
qemu:///session

I was expecting that to return qemu:///system as specified.

Also, how do I prevent myself from being prompted for a password every time I try to do anything with libvirt? I think it has something to do with policykit, but I can't seem to find where.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-07-26 04:31:34 -0500

marcindulak gravatar image

The answer to the first part of the question.

According to http://libvirt.org/uri.html the configuration for unpriviledged user is in $XDG_CONFIG_HOME/libvirt/libvirt.conf and XDG_CONFIG_HOME is undefined on Fedora so according to http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html it's value should be $HOME/.config. Use:

~/.config/libvirt/libvirt.conf

You can also use the environment variable LIBVIRT_DEFAULT_URI='qemu:///system', which takes precedence over the libvirt.conf.

Note that virsh --connect qemu:///system as unpriviledged user from an ssh session will not work due to https://bugzilla.redhat.com/show_bug.cgi?id=872166

edit flag offensive delete link more

Comments

Excellent, thanks!

a7ndrew gravatar imagea7ndrew ( 2013-07-26 20:58:20 -0500 )edit

Question Tools

Stats

Asked: 2013-07-25 09:20:00 -0500

Seen: 1,097 times

Last updated: Jul 26 '13