Run virt-manager remotely without logging in as root

By jbayer - Last updated: Thursday, July 7, 2011 - Save & Share - One Comment

The following little script will allow a normal user to run virt-manager (used for KVM, Xen and Qemu) without having to log in as root.

This assumes that the user is allowed to sudo;  while the topic of the sudoers file is a whole article by itself, the following is an example which should allow the user “fred” to run virt-manager:

========== Sudoer entry below ==========================
# Allow fred to run virt-manager
fred		ALL = /usr/bin/virt-manager
=================== Script follows =====================

#! /bin/bash

xauth list | while read line; do
 sudo -i xauth add $line
done
sudo -i virt-manager
Posted in Administration, Virtulization • • Top Of Page
2,599 views

One Response to “Run virt-manager remotely without logging in as root”

Comment from Chris
Time August 1, 2011 at 1:32 pm

Thank you! This is exactly what I needed, 🙂

Write a comment

asd