I struggle to get something that's working in Q3.2 also in Qubes4:
- I need to display message from AppVm on the screen (via notify-send in dom0) and do it via qubes-rpc executed in AppVm "storage". rpc procedure is named 'storage.log'
- allow policy in dom0:
> cat /etc/qubes-rpc/policy/storage.log:
> storage dom0 allow
> $anyvm $anyvm deny
- procedure:
> cat /etc/qubes-rpc/storage.log
> #!/usr/bin/bash
>
> read message
> /usr/bin/notify-send "$message"
RPC is called this way in appvm 'storage':
> echo 'message from vm'|qrexec-client-vm dom0 storage.log
What happens:
- In Q3.2 this works since years
- In Q4 action is executed, but nothing is displayed on screen. Action is actually executed-in journalctl I see 'storage.log' is allowed, and if I add 'echo $message|systemd-cat' that message is logged also.
- If its run in dom0, message is displayed on the screen:
> echo 'dom0 message'|/etc/qubes-rpc/storage.log
It seems like /usr/bin/notify-send does nothing when invoked via RPC.
Any ideas?
First some introduction:
- I have 'storage' vm. It takes storage devices (few HDDs) on startup and exposes them via NFS & Samba to other VMs and physical machines. Each VM can access just what is exported for it, rw or r/o.
- When 'storage' is started it has to trigger assignment of block devices to itself (and un-assign them on shutdown). Achieving this is discussed here https://groups.google.com/d/topic/qubes-users/RogG5rXG_Pw/discussion
- Assign/un-assign is triggered from storage via qubes-rpc actions 'storage-attach/detach'
I just want to be notified on screen for each device that is assigned/de-assigned. And since assign/de-assign happens in dom0, 'notify-send' is called there. It seems clumsy that dom0 calls back 'storage' to run 'notify-send' there, but if this is the only working option in Q4 - I'll do it. Will try it on next Q4 run
Tom