It is possible to manage virtual machines without root privileges. The check for root is therefore no more required.
Follow further steps to allow non-root user to use LNST for virtual setups.
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 ...
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Controller/NetTestController.py | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py index cce1fec..8fdd43e 100644 --- a/lnst/Controller/NetTestController.py +++ b/lnst/Controller/NetTestController.py @@ -232,12 +232,6 @@ class NetTestController: msg = "This setup cannot be provisioned with the current pool." raise NoMatchError(msg)
- if sp.is_setup_virtual() and os.geteuid() != 0: - msg = "Provisioning this setup requires additional configuration "\ - "of the virtual hosts in the pool. LNST needs root "\ - "priviledges so it can connect to qemu." - raise NetTestError(msg) - def print_match_description(self): sp = self._slave_pool match = sp.get_match()
lnst-developers@lists.fedorahosted.org