4

I'm trying to add my user to the libvirt group but I can't because it doesn't exist.

I also can't create the group because it does exist

[core@localhost ~]$ sudo usermod -a -G libvirt $(whoami)
usermod: group 'libvirt' does not exist
[core@localhost ~]$ sudo groupadd --system libvirt
groupadd: group 'libvirt' already exists

The group does not show up in /etc/group but it does show in getent group

What does this mean? Does the group exist or not? The OS is Fedora CoreOS.

2
  • 1
    Maybe you have other data sources /etc/nsswitch.conf.
    – stribika
    Feb 27, 2021 at 0:34
  • Added excerpt from bug report with workaround hope this will help you out. I know this isn't exactly what you where looking for but I hope it helps. Feb 27, 2021 at 0:53

1 Answer 1

4

There is a bug report on this issue https://bugzilla.redhat.com/show_bug.cgi?id=1919994 hope this helps.

There is also reports of this issue on the Ubuntu forum and a couple other places so it doesn't look like your the only one having the problem.

EXCERPT FROM BUG REPORT:

Iker Pedrosa 2021-02-01 11:13:42 UTC Apparently when installing the virt-manager package, libvirt group is added to /usr/lib/group file, instead of /etc/group. This isn't expected by shadow-utils, as it looks for the groups located in /etc/group file. I'll try to understand why this happens and how to fix it, but in the meantime I think I found a workaround. From a root shell (sudo su -) add the group information located in /usr/lib/group file to /etc/group by issuing "grep -E '^libvirt:' /usr/lib/group >> /etc/group". Now, you'll be able to add the user to the group with usermod.

The information was found in: https://discussion.fedoraproject.org/t/adding-user-to-a-group/12583/2

And this is the link for the Fedora Project where the issue was reported.

https://discussion.fedoraproject.org/t/adding-user-to-a-group/12583/6

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .