On Mon, Jan 11, 2016 at 03:29:26PM +0100, Jan Tluka wrote:
Mon, Jan 11, 2016 at 03:24:35PM CET, jtluka(a)redhat.com wrote:
>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
That also means that I'd like to remove the check for root user when a recipe
matches virtual environment since root is not required anymore.
Makes sense, so instead just check whether the virt machine was/wasn't
found then... And just to be sure if it isn't provide a log message
explaining the possibility of incorrect setup.
-Ondrej