Get information on the used netvm from within domU.
Why i want to achieve this:
Giving more cues on what netvm a domU is using by means of a custom zsh prompt element or something like neofetch.
Using the colored windows to indicate netvm does not cut it for me, as the used netvm can change on runtime, while the color cannot.
Possible solutions
Reading IP and determining netvm with a lookup table
Every domU holds a list with all Subnets/IPs of all netvms and can determine the used one through used subnet or gateway.
Pros:
Easy
No modification to qubes
Cons
Leaks system information to domUs
static
needs external updating of table
All domU is its own adminVM
Every domU is an adminVM. Qrexec rules should be as such, that they only can call qvm-prefs $OWN_NAME netvm for themselves.
Pros
dynamic
no leaks
Cons
Needs qubes-core-admin-client on all domUs
Needs tight qrexec rules that i might fuck up
I dont like neither of those ideas. Due to information leak solution one it is no real option for me, but i dont feel good installing qubes-core-admin-client in every vm on the system.
What are your feelings on this?
Do you have better ideas?
I imagine this could be possible through DNS. You could probably set a static DNS record, something like netvm.local , in each of your NetVMs and resolve it, for example, to a CNAME record which gives the real netVM name. Or you could choose an arbitrary private IP address and set an rDNS entry for it.
As far as I know, netVMs should resolve DNS for AppVMs unless you changed anything about this default behaviour. So depending on which netVM your Qube is connected to, DNS could give different results.
As i would love to have an obvious, color based indication the implementation over DNS would leak no information about the systems configuration as it would with some kind of lookup table (one can encode the color in the CNAME entry).
I will try to do that. However i am not that familiar with DNS, especially in qubes, but that does not sound too difficult