How to fix the time

Sorry this is late, but maybe some simple instructions can help others. I think it is all correct…

With coreboot, so no BIOS? I think it makes no difference, but please tell is if you see errors.

There is some quite explanation: here but it is maybe too much detail.

If most normal things are correct, then maybe it is only that clockvm does not get the correct time from the internet, and tell it to dom0 and other qubes.

First steps, if it is OK for you to use synchronisation by network:

  1. We will verify which qube you use for ClockVM…
  2. Open dom0 terminal.
  3. Run qubes-prefs clockvm
  4. Does it say the name of the qube you use for internet? Normally it is “sys-net” qube.
  5. If you use a different qube for network:
    1. change the pref: run qubes-prefs clockvm NNNNN but put the new name in place of NNNNN.
  6. Open settings for your clockvm qube - maybe it is sys-net, or maybe you changed it. Go to “Services”, and enable the service called “clocksync”. It must have a tick next to it.
    1. This is also possible with the terminal qvm-service command.
  7. Shutdown and restart your clockvm/network qube. This requires shutdown of any qubes that use it for network.
    1. After restart, if there is network, then the time in this qube should be synchronized. You can run timedatectrl to verify.
  8. In dom0, run sudo qvm-sync-clock
    1. now the correct time is saved to the hardware clock, so it should be almost correct even if you start your computer with no network.
  9. your other qubes will take a long time to learn the correct time. You can restart them, or run qvm-sync-clock in each one.

Some other verifications:

If timezone is wrong in dom0, simplest is to use a gui tool. I think it will work. If you want to use terminal:

  1. Get a piece of paper to record what you see. Write down if there are mistakes in my instructions.
  2. Open dom0 terminal.
  3. Every command must have sudo before it. I do not write it every time… but do not forget.
  4. Verify the timezone.
    1. Run timedatectl
    2. If the timezone is wrong, run timedatectl list-timezones, then
    3. Choose the best timezone for you, then
    4. run timedatectl set-timezone XXXXX - you must replace XXXXX with the one you chose.
    5. run sudo qvm-sync-clock. Verify that Local time and UTC time are both correct.

If you get errors exactly equal to your timezone offset, after you restart:

  1. Set the RTC offset.
    1. This will tell Qubes if the hardware clock is saved as your local country time, or as UTC time…
    2. If you boot the computer sometimes to Windows, run timedatectl set-local-rtc 1
    3. If you only use Qubes, run timedatectl set-local-rtc 0
    4. It is best for Qubes to use UTC, which means local-rtc is zero.
  2. Set the system time in dom0: run sudo qvm-sync-clock.
    1. Verify that Local time and UTC time are both correct.
    2. This is the time Qubes uses right now. It will be saved in hardware

If you get crazy values after restarting your computer, then maybe the small internal battery is defective, so the computer cannot keep the time when there is no power. Normally the network time should correct it.

If there are errors, post them here.

1 Like