[SOLVED] Restrict qemu-agent

MaPf

Member
Apr 5, 2020
10
3
23
46
Hi all,

with the default installation of the qemu guest agent it's possible to reset user passwords (even root or administrator) from the commandline of the hypervisor.

I'd like to prevent that.
With linux guests that is quite easy with dumping the current config, add "block-rpcs=guest-set-user-password" and write it to /etc/qemu/qemu.conf

I'd like to do the same with Windows... the config looks quite similar, but I don't know where to place the file and how to name it.... if possible at all.

I couldn't find relevant documentation, maybe someone could point me there.
 
Last edited:
Hi,

my guess is, that there is no file, but you have to edit the service entry in the registry (HKLM\System\CurrentControlSet\Services\QEMU-GA) and append -b <rpcs to block> to the ImagePath-Entry instead.
 
Last edited:
You guessed right, that works mighty fine :D
And is even better to roll out via GPO than by files
Thanks!
 
Last edited:
Just in case anyone wants to rebuild that for Windows Domain Machines:
Create a WMI filter "ProxmoxVM" with Query
Code:
SELECT * FROM Win32_ComputerSystem  WHERE Manufacturer LIKE '%QEMU%'
to target VMs only.
Create a new GPO "QEMUGuestAgentSettings" on "Computer Configuration/Preferences/Windows Settings/Registry"
Code:
Hive: HKEY_LOCAL_MACHINE
Key path: SYSTEM\CurrentControlSet\Services\QEMU-GA
Value name: ImagePath
Value type: REG_EXPAND_SZ
Value data: "C:\Program Files\Qemu-ga\qemu-ga.exe" -d --retry-path -b guest-set-user-password
and set the WMI filter to it