Re: How do I move my VM's from root to a user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 06, 2020 at 04:04:06PM -0700, ToddAndMargo wrote:
> Hi All,
> 
> Fedora 32, x64
> qemu-kvm-4.2.0-7.fc32.x86_64
> 
> Since I have figure out how to run virt-manager as a
> user without having to hassle with the pol kit prompt,
> I would like to move my virtual machines out of
> root (or wherever the are) and into a particular user.
> 
> I can start virt-manager as a user, but all my VM
> are missing.
> 
> How to do migrate all my vm's from root to a user?

Hi,

It's not that simple. virt-manager uses libvirt to manage virtual
and for QEMU/KVM there are two ways of running VMs using different
connections.

Usually the main one is qemu:///system connection which connects to
a libvirt daemon running under root user. For this connection you need
to configure which other users on the system except for root can use it.
By default it polkit will ask you to provide password, but you can
create a polkit rule file which will allow you to use the system
connection without password. Libvirt already provides some default
polkit rule which allows all users that are in 'libvirt' group to access
the system connection.

The other connection qemu:///session works a bit differently, the
libvirt daemon is started as the same user that used this connection
which implicates some limitations with networking, attaching host
devices into the VM and other tasks that would require root permissions.

So for your use-case I would not move the VMs into the qemu:///session
connection for your user but I would add your user to 'libvirt' group.
In addition you need to make sure that in virt-manager you have
configured 'QEMU/KVM' connection which should use qemu:///system as
Libvirt URI instead of the 'QEMU/KVM User session' which uses
qemu:///session as Libvirt URI.

Pavel

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux