Hi, recently my colleague gave me a hint how to manage virtual machines on the system using non-root user. It's very simple so I'd like to share it here.
1. first you need to use policy kit to tweak libvirtd.
# echo 'polkit.addRule(function(action, subject) { if (action.id == "org.libvirt.unix.manage" && subject.isInGroup("wheel")) { return polkit.Result.YES; } }); ' > /etc/polkit-1/rules.d/80-libvirt.rules
then (re)start libvirtd service,
# systemctl enable libvirtd # systemctl start libvirtd
2. add the non-root user to group 'wheel'.
3. the last bit is to run lnst-ctl with following environment variable exported:
LIBVIRT_DEFAULT_URI=qemu:///system lnst-ctl ...
Hope I did not forget anything. Feel free to ping me if this does not work for you.
-Jan