Set a specific hostname for sys-net

Hi Everyone!

I am a newcomer to Qubes OS, having just installed 4.2 in a computer. While I have experience with Linux systems (mostly Debian), I am new to Qubes OS and all the different VMs.

I have found a Community Guide on anonymizing MAC address and preventing hostname leaks, but I find myself in the opposite place: I need sys-net to have a given hostname.
Just for context, I need this so I can identify my computer in my university network. Every computer gets assigned a hostname based on the one reported by the DHCP client.

I tried to change the hostname in a sys-net terminal (both with the ‘hostname’ command and editing /etc/hostname), but that did not work (maybe because sys-net is disposable? I’m not 100% sure.
I guess that if I change the hostname in the template it could work, but then I think it will propagate to all VMs based on that template and I’m not certain I want that. I looked into Network Manager’s options for the interface, but the hostname cannot be changed from the GUI.

Are there any “official” or well-supported ways to just set (in a persistent way) the sys-net hostname?


Pablo B.

1 Like

Hi Everyone!

Nevermind, I found about the “dhcp-hostname” option in the /rw/config/NM-system-connections/*.nmconnection files. That seems to have worked (I still need to check how persistent it is, but I think it should stay).

I’ll leave this up in case it can make someone’s life easier in the future.