Allowing non-root user to use virt-manager on Fedora 20


Everytime you start kvm virt-manager, it ask for password to authenticate as root.
There may be situation you want to be able to allow user to run virt-manager without entering password

virt-manager in fedora 20 implements PolicyKit, therefore we can use policy kit rules to achieve this.

Note: you may modify the code to adapt to your requirements. Read the man page for details.

Edit /etc/polkit-1/rules.d/80-libvirt.rules as root as follows:

polkit.addRule(function(action, subject) {
if (action.id == "org.libvirt.unix.manage" && subject.local && subject.active && subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});

Leave a comment

Your email address will not be published.