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?

Thanks!

Pablo B.

2 Likes

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.

2 Likes