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