Score:0

libvirt-kvm and libvirt shows up as login profiles on Kubuntu 23.04

cn flag

Last night, I want to install Qemu on my Kubuntu 23.04. I found this article to follow along to install Qemu on my computer:

  1. Install and Use Qemu on Ubuntu

After reboot my pc, I notice libvirt-kvm and libvirt shows up as users you can login onto my computer:

users

I have done some research and I found this post Primary Groups vs. Supplement/Secondary Groups:

  1. Primary vs secondary groups in Linux

I am assuming libvirt and libvirt-kvm are added in my Primary Group.

Is this a MUST to have QEMU work properly on my PC?

if not, Is there a way for libvirt and libvirt-kvm users' profile not show up as login options?

hr flag
Interesting... the tutorial you linked says *"To make Qemu work, you'd have to add your user to two groups: libvirt-kvm and libvirt"* but AFAIK that's simply not what those commands do - even the link it provides in support says to use either `adduser` or `usermod` **not** `useradd`
krillavilla avatar
cn flag
@steeldriver Do you know how I can fix this?
Score:2
hr flag

The tutorial that you linked says:

To make Qemu work, you'd have to add your user to two groups: libvirt-kvm and libvirt.

To do so, use the following commands one by one:

sudo useradd -g $USER libvirt

sudo useradd -g $USER libvirt-kvm

However those commands do not add a user to a group - as you have discovered, they create two new users, with their primary group (-g) name equal to the username of the invoking user. On Ubuntu, that happens to succeed because such a group exists by default (it is the user's private group). Since they are created as non-system users (UID > 1000) they show up in the display manager.

The link provided in the tutorial suggests two correct ways to add a user to a group: sudo adduser username groupname and sudo usermod -a -G group_name username. So for example:

sudo adduser "$USER" libvirt
sudo adduser "$USER" libvirt-kvm

or

sudo usermod -a -G libvirt "$USER"
sudo usermod -a -G libvirt-kvm "$USER"

however I'm not sure these are necessary - I'd suggest seeking out a more reliable tutorial.

Fortunately (at least with the default Ubuntu /etc/default/useradd) the commands that you were instructed to use may be undone fairly easily:

sudo userdel libvirt
sudo userdel libvirt-kvm
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.