user of qemu-system-x86 (libvirt)

On openSUSE the user “qemu” is the default user of the process “qemu-system-x86” when using libvirt, on Debian it’s “libvirt-qemu”.

I can change it in qemu.conf e.g. “user = root”.

But where is this default “qemu” or “libvirt-qemu” specified, it’s not in qemu.conf or any other. Been searching everything in /etc/*

I need to look it up by script, even on a computer where a qemu-system-x86 process hasn’t been started yet (otherwise I could easily use e.g. ps)

Hi
On Leap it gets created on qemu install as it’s not split out like in Tumbleweed (system-user-qemu), but it will be in groups and passwd files in /etc two groups kvm and qemu and user qemu;


egrep -d skip "qemu|kvm" /etc/*

See line 1578;
https://build.opensuse.org/package/view_file/devel:openQA:ci/qemu/qemu.spec?expand=1

I’m not talking about the “qemu” user and “kvm” group itself, I know it’s created in the user-, group- and password-files that’s not the issue.

How does libvirt know which user to use when creating a new “qemu-system-x86” process. It must look up that information somewhere, or is it really hard-coded?

Hi
File permissions, owner and group on the binary.

I’m guessing you’re confused believing that each Guest’s internal system processes with the processes used for VM management.
The processes used for managing VMs are external to the VMs themselves, and are owned by the HostOS.
If you’re trying to execute something within a VM on bootup, that’s entirely different than managing VMs.

TSU