Auto rotating vpn and timezone

Hello qubes community.

I want to add a script which automatically rotates between my wireguard vpns in my network manager. I already have auto connect on which is great. But what if i want to randomly rotate my vpn between the 25min and 45min range (im just picking numbers out on a whim but can be any range really).

I also want the timezone to change based on the VPN location. Fortunate for me, most of my wireguard vpns are only a handful of locations.

I realize that UTC is the best option for most people, however we still standout when we use the same few VPN location and always have UTC timezone etc.

You can use something like this:

But add it as a cron job instead of running it in /rw/config/rc.local.
You can change the system timezone in the cron job as well.

Do you want to use VPN in the sys-vpn or in the qube where you’ll be using apps e.g. browser/messenger/etc?
If you want to use VPN in sys-vpn this way then it’s hard to configure the timezone in the qubes connected to sys-vpn properly.

Also are you sure you want to do this? I’m not sure if this will give you any benefit, e.g. if you’ll be connected to the web server and then your connection will be suddenly changed. You’ll be tracked this way then.

1 Like

good point. If i stick to all my VPNs being in one timezone (UTC + 5:00), then all i need to do is switch my dom0 clock to UTC +500 correct?

Yes.
But you can also change the timezone of the specific qubes or in the template.

For template:
Configure timezone in the template.
Set the timezone-related files to be protected so Qubes tools won’t change them:

cat << 'EOF' | sudo tee /etc/qubes/protected-files.d/timezone.conf > /dev/null
/etc/timezone
/etc/localtime
EOF

For app qube:
Configure bind-dirs to save the changes in timezone-related files.
Configure timezone in the app qube.
Set the timezone-related files to be protected so Qubes tools won’t change them:

cat << 'EOF' | sudo tee /rw/config/protected-files.d/timezone.conf > /dev/null
/etc/timezone
/etc/localtime
EOF