So, I have several vms for not so privacy friendly sites and I found out the hard way that modern sites somehow acquire not just my timezone. But my actual country even if the vm is run over Tor or any other ip changing application. What I found out that timedatectl is the reason for this information leak
And the accounts I had to make where all made with specific countries in mind. In one standalone vm I need to always run timedatectl set-timezone Asia/Calcutta before opening the specific site with the specific account. In another I always need to run timedatectl set-timezone Europe/Paris This is not a good solution. Because eventually I might forget to run these specific commands and this will ban my accounts while simultaneously revealing my location
Another issue is that for certain vms I specifically want them to have my actual timezone. Namely the government and banking websites. So I donât need randomization for those
So, how do I set custom timezones for certain standalone vms only?
Semi-solution. You can add the command timedatectl set-timezone Europe/Paris to .bashrc and then 'source ~/.bashrc` But it will require running all programs from the terminal specifically. And removing all programs but the terminal from the shortcut list in Qubes Application Menu for the specific standalone vm
I now tried TIMEZONE=$(qubesdb-read /vm-config/timezone) timedatectl set-timezone "$TIMEZONE" ln -sf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime
And it just permanently stuck to Europe/Berlin Is it how it is supposed to work? Rebooting the test vm for this feature does not change the timezone to anything else but Europe/Berlin
as per this post, there are two mechanisms by which the time is set in a qube:
at system boot, the dom0 timezone is read as part of qubes-early-vm-config.service, using the qubesdb-read /qubes-timezone command.
regularly, as part of qubes-sync-time.service, using the qubes.GetDate RPC call. But this only pulls UTC time for synchronisation purposes and sets it using date -u; so itâs not relevant for timezones.
Using timedatectl set-timezone will work to change the timezone in a given qube, but with two caveats:
At least in Debian 12 templates, as part of qubes-early-vm-config.service also the config file /etc/timezone will be set; this is a debian-specific file that is largely useless. This file is ignored by timedatectl set-timezone, so once it gets set, it will contain your dom0 timezone, unless you delete it. Presumably in R4.3 this stops being an issue if you use anon-timezone with qvm-features (but I havenât checked).
The timezone info still remains in qubesdb, unless you run qubesdb-rm /qubes-timezone to delete the entry (again, not necessary if you use anon-timezone).
tl;dr if youâre on R4.2, make sure you delete /etc/timezone and run qubesdb-rm /qubes-timezone
OTOH, timedatectl set-timezone does change /etc/localtime, so itâs not necessary to link it again manually.