time in guest advances by 1 hour on every restart of the vm or unraid...


darianf

Recommended Posts

initially i faced strange issue while setting the time in the tower.

NTP as not getting correct time.

when setting it manually, the time was update to a value +1 from what i was configuring.

 

Had to do a trick to update manually to an incorrect hour, to account the for unraid's stubbornness to add the extra hour.

Once the time was manually ok and time zone ok, i switched to automatically/ntp

 

since then the time was ok in unraid.

 

but now i see in windows vm, that the time advances every time i restart (could not yet identify if VM or unraid box restart)

 

anything you can suggest please?

 

Link to comment

hi guys, this issue drives me crazy...

 

Somehow the unraid insists to reduce the time i set manually by 1 hour. I have to account for this nasty thing, by adding 1 hour extra.

finally i manage to set it up like this:

 

ntp - yes

time zone - utc+2, for athens, bucharest, istanbul

 

(btw, if i set it up 1-2 minutes off, after NTP enabled it does not correct this - i would expect that the time will be adjusted to the second, but it's not the case - is this some clue that NTP is not working?)

 

I start the Windows 10 guest, guest time is ok. Restart the VM, guest time remains ok.

I restart the tower entirely, unraid time remains ok, but Windows 10 guest VM advances by 1 hour.

 

Will try to restart the tower several times, to see how much i can time travel!

Link to comment

hi squid

 

I try to explain the steps i perform while setting up the time of unraid tower (settings>date and time).

In red what's wrong, in green what is expect behavior.

 

NTP: no

time zone: utc+2 athens, bucharest, istanbul

I set the time to the current time and save - immediately the time is updated to 1 hour less, by the unraid interface probably - some javascript maybe...

 

Then i change the unraid time to account for this strange behavior, by adding 1 hour. Save => the time is again reduced by 1 hour, but it's accurate as per my current time.

 

Then i enable NTP as Yes, time textbox gets grayed out and is accurate.

 

Next step is to start the Windows 10 VM.

In the guest, i have similar settings like:

time zone - utc+2 Athens, Bucharest

Set time automatically is ON

Time is 1 hour extra.

 

Then i perform these changes:

1) Set time automatically is set to OFF

2) change time to reflect current time

3) Set time automatically is set to ON

 

Time is accurate.

I restart the Windows VM - time remains accurate

 

I restart the unraid box. unraid time remains accurate after restart.

I start also the Windows VM. Guest time is extra 1 hour.

 

I go in Windows Settings, Date & Time. I switch OFF, then ON the "Set time automatically" = > time is accurate for the session.

But then, any restart of unraid will change the time in the VM by adding extra hour.

 

next step i will do to understand more of this, I will leave uncorrected the guest time, but will perform several unraid box restarts, and see when it stops adding this extra hour nonsense...

 

 

 

 

 

 

 

Link to comment

hi trurl, the same computer was used up till few days ago, with windows 10, directly from the ssd. no issues with the time / time zone.

 

Not sure what is the risk of playing with the time / time zone - basically following the same steps i described in my previous post - but probably the issue can be replicated easily.

 

btw, i just updated to 6.3.0, but same behavior was present in 6.2.4 as well.

 

Link to comment

thanks squid, will try also this thoroughly. at certain point i think i changed also there, but not sure what if the results were relevant...

 

but i just restarted the entire unraid box and now the time did not advanced in guest VM.

 

now thinking if power off vs restart of unRaid makes a difference.

 

 

will try more - this is a hard nut to crack especially with this inconsistency...

 

 

I am afraid that this is a case of OS trying to modify the Bios clock as well, and different OS will act differently.

 

Link to comment
  • 3 years later...
  • 9 months later...

Just view it as XML, find the clock section and change the  <clock offset='localtime'> to <clock offset='utc'> . Seems like Windows wants UTC as base and adds the timezone to that. Thats why the time goes wrong: it gets localtime from host (which is already +3h e.g) like 14:00, adds offset +3 and you get 17:00. Which is 3 hours ahead.

  • Thanks 2
Link to comment
  • 7 months later...
On 3/14/2021 at 6:21 AM, reyo said:

Just view it as XML, find the clock section and change the  <clock offset='localtime'> to <clock offset='utc'> . Seems like Windows wants UTC as base and adds the timezone to that. Thats why the time goes wrong: it gets localtime from host (which is already +3h e.g) like 14:00, adds offset +3 and you get 17:00. Which is 3 hours ahead.

 

Thanks for this, was driving me nuts every time my Windows VM that runs some scripts reboots, the time is off by my timezone and I need to toggle off/on the auto sync time option.

 

This change in the VM XML fixed that issue.

Link to comment
  • 2 years later...
On 3/14/2021 at 11:21 AM, reyo said:

Just view it as XML, find the clock section and change the  <clock offset='localtime'> to <clock offset='utc'> . Seems like Windows wants UTC as base and adds the timezone to that. Thats why the time goes wrong: it gets localtime from host (which is already +3h e.g) like 14:00, adds offset +3 and you get 17:00. Which is 3 hours ahead.

This works like a charm. Which just begs the question: How can we get this implemented as default when users create a VM with the Windows presets? Windows has been like this for at least the better part of the last decade. Is there some way we can flag this 1 minute fix to Lime Tech to implement?

Link to comment
On 10/22/2023 at 1:43 PM, ilnahro said:

This works like a charm. Which just begs the question: How can we get this implemented as default when users create a VM with the Windows presets? Windows has been like this for at least the better part of the last decade. Is there some way we can flag this 1 minute fix to Lime Tech to implement?

Do you not have time update enabled in Windows? I have not seen this issue on my Windows VM. Quick review of the code the value is being used to Identify Windows vs other so it is not just a default change. Also timer section is currently only written for a new VM.

Link to comment
  • 2 weeks later...
On 10/23/2023 at 7:30 PM, SimonF said:

Do you not have time update enabled in Windows? I have not seen this issue on my Windows VM. Quick review of the code the value is being used to Identify Windows vs other so it is not just a default change. Also timer section is currently only written for a new VM.

 

I do have this enabled but for some reason, Windows doesn't execute this frequently enough for it to fix the issue. Before I made the change suggested above, it literally set the wrong time every boot from the emulated UEFI without checking with the NTP servers

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.