Persistent timezone for specific standalone vms

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

This is what I use for some of my qubes:

/rw/config/rc.local

TIMEZONE=$(qubesdb-read /vm-config/timezone)
timedatectl set-timezone "$TIMEZONE"
ln -sf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime

I use the vm-config feature to customize the timezone from dom0 like this:

qvm-features <qube> vm-config.timezone <TZ>

If you use Qubes 4.3, you can also enable the anon-timezone feature:

qvm-features <qube> anon-timezone 1
1 Like

Currently trying out ‘qvm-features anon-timezone 1’ in dom0 and it didn’t work. Still shows my default timezone when running timedatectl

‘qvm-features vm-config.timezone ’ Also does not work

UPD. It does work. Unlike the rest

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

anon-timezone is only working on Qubes 4.3, if you are on 4.2 it won’t work.

Have you set the commands inside /rw/config/rc.local?
The timezone set with “qvm-features” is the one that should always be used by the qube.

When you say “standalone,” do you mean it was created from a template or an ISO?

I am on Qubes 4.3

I did set up Europe/Berlin for the untrusted vm. It did work. It didn’t work for standalone vm for whatever reason

Template

Alright. I good confused. I thought for some reason that

this part may be omitted. But it is necessary. Thank you

1 Like

qvm-features <qube> anon-timezone 1 not working for me. What’s the nuance?

UPD: work

It required me to restart the vm for it to work