Making Admin API calls from Management VMs (domU) in Bash


After being away from Qubes for few years, I am back on Qubes OS 4.2

While I was on Qubes OS 3.2, I wrote myself a package manager helper to facilitate template update & maintenance tasks easier. I upgraded it for Qubes OS 4.2 in the last couple of days but I would like to eventually retire it after fully familiarizing myself with the new modern tools (e.g. qubes-vm-update) and Salt stack. Actually I did not know about the former tool until writing this very post. Until forum drafting tool suggested this very useful post.

Yet old habits do not die quickly and the mentioned tools could not perform few tasks which my own script does (like downloading updates without installation). So in the meantime, I wonder how I could make Admin API calls from a Management VM with sufficient qrexec policy privileges. Let’s say I would like to make admin.vm.List call from any vm rather than dom0. I could do it in dom0 via qubesd-query and process the output via awk or similar tool. I have some ideas beyond my old script which I would like to implement. Before committing to writing it in Python or via a Python bridge, I wonder if this could be done via simple plain bash.

1 Like