I have completed the steps described in this post of the Qubes Documentation:
However I don’t know how to verify it is working.
My NetVM does not visually change to a random number each time it starts up, it stays the same name I have it set as. When I run “hostname” in the NetVM terminal, it returns with “localhost”. Does anyone have experience/advice on spoofing my hostname? How can I test my hostname to see if its spoofing properly? Help me out if you can, thanks.
You can simply open a terminal in sys-net and see the randomized hostname in the prompt, e.g., [user@PC-1234 ~] instead of the default [user@sys-net ~].
The new hostname should be in your /etc/hostname and /etc/hosts files. If it’s not there, something went wrong. However it looks like something went wrong as hostname should also return the new one.
/rw/config/protected-files.d/protect_hostname.txt still exists after a reboot of sys-net?
(I guess you’re not using a disposable sys-net? Because if so, the instructions apply to the disposable template and the template’s template instead.)
Can you post the content of /etc/hosts and /etc/hostname?
Please also post the content of these files of the template VM of your sys-net for a comparison.
and then I have been adding the entire text in the command box included on the documentation, and saving. Is this correct? This seems like the only area where I could be messing up
Hello! Not using a disposable sys-net. I just tried the instruction
on the qubes documentation again, and am receiving the same result.
How can I check the state of
/rw/config/protected-files.d/protect_hostname.txt ?
ls -l /rw/config/protected-files.d/protect_hostname.txt in your sys-net.
(If it exists, it will be listed.)
The Contents of template & sys-net:
[user@localhost] cat /etc/hosts 127.0.0.1 localhost
localhost.localdomain localhost4.localdomain4 fedora-30 ::1
localhost.localdomain localhost6 localhost6.localdomain6 fedora-30
[user@localhost] cat /etc/hostname cat: /etc/hostname: No such file
or directory
Thanks. That looks like /etc/NetworkManager/dispatcher.d/preup.d/00_hostname doesn’t exist in your template or you forgot to make it executable.
Assuming it exists, as root (via sudo su) inside your sys-net template, run chown root:root /etc/NetworkManager/dispatcher.d/preup.d/00_hostname to make root the owner and chmod +x /etc/NetworkManager/dispatcher.d/preup.d/00_hostname to make it executable.
Also double check on step 2 via ls -l /etc/hosts.lock.
For step 1 of the instructions, I have been running the following
command in a CLI Fedora Template VM
and then I have been adding the entire text in the command box
included on the documentation, and saving. Is this correct? This
seems like the only area where I could be messing up
Thank you so much for the help, I really really appreciate it. However my hostname is still not being spoofed, and I am still dealing with the same issues. To be clear this is the process I just attempted.
Created sys-net VM based off of Fedora-30 Template.
In Fedora-30 Template CLI, I ran:
Sorry. I just did a fresh install of Qubes, and completed the steps I described above, and now the hostname is correctly randomizing. Thanks again for all the help man, I appreciate it.
Hello everyone.
The same issue is happening in my system too. I have followed all the steps here. However it seems that the script itself is not executing. I have tried to manually create /etc/hostname file.
Could you please help?
Also I have modified the NetworkManager.conf file and added “hostname-mode=none” under main section to prevent network manager from interfering but to no avail.
Update : I tried to slightly modify the script to make it output text to a file in desktop after execution of particular lines in the script.
It is found out that the test file is not being created at all.
There can be one conclusion from this i.e. the script is not being executed at all when the NetVM is starting.
However if the script is not being executed then how come the hostname changes from “sys-net” to “local host” ?