winapps icon indicating copy to clipboard operation
winapps copied to clipboard

Group check uses incorrect group (NixOS)

Open theCapypara opened this issue 3 months ago • 4 comments

Hi! The winapps-setup --user command fails for me on NixOS:

Checking whether the user 'marco' is part of the required groups... Failed!

ERROR: GROUP MEMBERSHIP CHECK ERROR.
The current user 'marco' is not part of group 'libvirt' and/or group 'kvm'.

This group is not called libvirt or kvm on my machine, it is libvirtd. And I am in that group. How can I bypass this check?

Config :

RDP_DOMAIN=""
RDP_IP=""
WAFLAVOR="libvirt"
RDP_SCALE="100"
REMOVABLE_MEDIA="/run/media"
RDP_FLAGS="/cert:tofu /sound /microphone +home-drive"
DEBUG="true"
AUTOPAUSE="off"
AUTOPAUSE_TIME="300"
FREERDP_COMMAND=""
PORT_TIMEOUT="5"
RDP_TIMEOUT="30"
BOOT_TIMEOUT="120"
RDP_USER="marco"
RDP_PASS="..."
VM_NAME="Win11"

theCapypara avatar Aug 29 '25 13:08 theCapypara

I am also getting weird warnings. Am I not supposed to run this command on NixOS? But how else can I then have winapps discover apps?

[WARNING] You are running a WinApps installation located outside of default location '/nix/store/95wp2gpyy7f0v71vk6hi1as1zjmbgpm9-winapps-0-unstable-2025-07-02/src'. A new installation will be created.
[WARNING] You might want to remove your old installation on '/nix/store/95wp2gpyy7f0v71vk6hi1as1zjmbgpm9-winapps-0-unstable-2025-07-02/bin'.

When I try to run winapps nothing happens and winapps-launcher says:

ERROR: Windows VM NOT FOUND.
Please ensure 'RDPWindows' exists.

but that isn't the configured VM name.

theCapypara avatar Aug 29 '25 13:08 theCapypara

I guess my issue is actually just a duplicate of https://github.com/winapps-org/winapps-launcher/issues/30 here, but let me know if I'm wrong

theCapypara avatar Aug 29 '25 13:08 theCapypara

Unfortunately I found out that this is not the issue. Even with this PR nothing is really working. I found out now that winapps is failing with a group error as well according to winapps.log:

[Fr 29. Aug 16:07:48 CEST 2025-21340] ERROR: USER NOT PART OF REQUIRED GROUPS. EXITING.

Output of id:

uid=1000(marco) gid=100(users) Gruppen=100(users),1(wheel),57(networkmanager),67(libvirtd),131(docker),999(adbusers)

I'm not in the group kvm, that one doesn't exist, but I don't need it to manage libvirt+QEMU

theCapypara avatar Aug 29 '25 14:08 theCapypara

If I patch:

both commands work generally, although the warnings I get for the setup command are still a bit spooky. And I run into a new issue, I will make a new issue for that.

--- a/setup.sh
+++ b/setup.sh
@@ -807,7 +807,7 @@
     # Identify groups the current user belongs to.
     USER_GROUPS=$(groups "$(whoami)")
 
-    if ! (echo "$USER_GROUPS" | grep -q -E "\blibvirtd\b") || ! (echo "$USER_GROUPS" | grep -q -E "\bkvm\b"); then
+    if ! (echo "$USER_GROUPS" | grep -q -E "\blibvirtd\b"); then
         # Complete the previous line.
         echo -e "${FAIL_TEXT}Failed!${CLEAR_TEXT}\n"
--- a/bin/winapps
+++ b/bin/winapps
@@ -303,8 +303,7 @@
     # shellcheck disable=SC2155 # Silence warnings regarding masking return values through simultaneous declaration and assignment.
     local USER_GROUPS=$(id -nG "$(whoami)")
 
-    if ! echo "$USER_GROUPS" | grep -qE '\b(libvirt|libvirtd)\b' || \
-       ! echo "$USER_GROUPS" | grep -qE '\bkvm\b'; then
+    if ! echo "$USER_GROUPS" | grep -qE '\b(libvirt|libvirtd)\b'; then
         waThrowExit "$EC_NOT_IN_GROUP"
     fi
 }

theCapypara avatar Aug 29 '25 14:08 theCapypara

@theCapypara Thanks for raising this. I’m not very familiar with NixOS myself, but I know we maintain a custom patchset for it. I believe @oskardotglobal is looking after that - do we know if it’s expected behaviour on NixOS for the kvm group to be missing/unnecessary?

KernelGhost avatar Sep 11 '25 05:09 KernelGhost

On my machine, there was a kvm group; let me confirm this

oskardotglobal avatar Sep 11 '25 12:09 oskardotglobal