[virt-manager PATCH] Add /usr/sbin to search path for non-root user

Cole Robinson crobinso at redhat.com
Tue Nov 3 17:24:02 UTC 2020


On 10/23/20 5:20 PM, Charles Arnold wrote:
> On a fresh install where no previous connection has been made a
> non-root user starting virt-manager won't find the installed libvirtd
> because the location is not in the user path.
> 
> Signed-off-by: Charles Arnold <carnold at suse.com>
> ---
>  virtManager/lib/connectauth.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/virtManager/lib/connectauth.py b/virtManager/lib/connectauth.py
> index cc83e469..71e1b21f 100644
> --- a/virtManager/lib/connectauth.py
> +++ b/virtManager/lib/connectauth.py
> @@ -204,7 +204,8 @@ def connect_error(conn, errmsg, tb, warnconsole):
>  ##################################
>  
>  def setup_first_uri(config, tryuri):
> -    libvirtd_installed = bool(shutil.which("libvirtd"))
> +    # Add /usr/sbin to the path in case non-root user launches virt-manager
> +    libvirtd_installed = bool(shutil.which("libvirtd", path=os.environ['PATH'] + os.pathsep + "/usr/sbin"))
>      if config.CLITestOptions.fake_no_libvirtd:
>          libvirtd_installed = False
>  
> 

Thanks Charles! Pushed now

- Cole




More information about the virt-tools-list mailing list