VM guest's time is not in-sync with host

Discussions related to using VirtualBox on Windows hosts.
Post Reply
floki
Posts: 4
Joined: 4. Aug 2019, 10:09

VM guest's time is not in-sync with host

Post by floki »

Host (16GB RAM): Windows 10 x64 1903 Build 18362.267
Guest (4GB RAM): Windows 10 x64 1803 Build 17134.885
Virtualbox Version 6.0.10 r132072 (Qt5.6.2)
VirtualBox Guest Additions 6.0.10r132072 installed in guest

Brand new to virtualbox, impressed with the product so far but I am having a small issue where my Win 10 1803 guest is not syncing time correctly with it's Win 10 1903 host, the guest is typically a minute behind the host. The VM was originally provisioned using VMware workstation and was imported into virtualbox. I've reviewed existing posts but failed to find one that seemed to address this issue.

Any assistance would be greatly appreciated.
Attachments
Windows10-2019-08-04-11-18-31.log
VM Log File
(125.59 KiB) Downloaded 49 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM guest's time is not in-sync with host

Post by mpack »

The VM will get time from the host on startup. We know this works because people who don't want time sync complain about it. Thereafter it's up to the guest OS to keep time. Generally speaking it will access a network time server during or quite soon after boot.

You only allocated one core - Windows 10 hates that, which may explain why background tasks are not keeping up. You have a 4 core host, so I'd give two to the guest.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM guest's time is not in-sync with host

Post by scottgus1 »

floki wrote:The VM was originally provisioned using VMware workstation and was imported
Might check that all VMware tools are uninstalled, too:
floki
Posts: 4
Joined: 4. Aug 2019, 10:09

Re: VM guest's time is not in-sync with host

Post by floki »

Thanks for the responses. @mpack I've provisioned an extra vCPU, overall the VM seems happy but no progress in relation to the time drift. @scottgus1 good call, VMTools was still installed, I've uninstalled and rebooted but no luck.

I'll try re-installing Guest Additions, any other ideas?

Thanks.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM guest's time is not in-sync with host

Post by mpack »

I would live with it until the Windows guest has finished whatever is taking up CPU time. As mentioned earlier, a Windows 10 PC is under no obligation to sync its time with another PC you own. About a minute off seems normal to me.
floki
Posts: 4
Joined: 4. Aug 2019, 10:09

Re: VM guest's time is not in-sync with host

Post by floki »

The problem is that I'm running an app that can't function correctly with a clock-skew. As you mentioned the guest should sync time with the host at startup which isn't happening, can you think of any reason why that is the case?

Thanks,
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM guest's time is not in-sync with host

Post by mpack »

floki wrote:As you mentioned the guest should sync time with the host at startup which isn't happening
It definitely is happening. The guest OS doesn't have any access to wall clock time except what the virtual hardware tells it on startup: if the guest OS was getting nothing at all you'd know. It would be harder for the VM to get the time wrong than to get it right - and in any case we know every other VM gets the correct time (a PC's hardware is not changed by the OS you install), meaning that the problem is with the guest OS.
floki
Posts: 4
Joined: 4. Aug 2019, 10:09

Re: VM guest's time is not in-sync with host

Post by floki »

Got it, so the guest is syncing time with the host at startup but the problem is that the guest's clock is running slow. After watching the host and guest clocks together for a few minutes it is very evident that the guest's clock is losing around a second every 10 seconds, this continues for around 5 minutes then the guest's clock visibly speeds up (the seconds start counting very quickly) and it corrects itself to within ~20 seconds of the host.

Average CPU utilization of the guest is 30% with memory utilization at 65%.

Is this expected behavior?
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: VM guest's time is not in-sync with host

Post by fth0 »

floki wrote:any other ideas?
Some random ideas, in descending order of probability (from a layman's point of view ;)):
  • In your guest, disable anything Power Management related (waking up after sleeping needs extra time catch-up provisions).
  • Install the VirtualBox Extension Pack (I don't know if this has anything to do with your problem, but it is a deviation from the typical VirtualBox installation and therefore a less common setup).
EDIT:
Removed inappropriate ICH9/PIIX3 chipset suggestion.
Last edited by fth0 on 15. Aug 2019, 15:54, edited 1 time in total.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: VM guest's time is not in-sync with host

Post by socratis »

fth0 wrote:Change the Chipset from ICH9 to PIIX3.
Actually no, ICH9 is not a good idea, unless you're running an OSX VM. Just hover over the control and read the tooltip... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: VM guest's time is not in-sync with host

Post by fth0 »

socratis wrote:Actually no, ICH9 is not a good idea, unless you're running an OSX VM.
I'm not so sure any more that the OP is using ICH9: In my own VMs run by VirtualBox 5.2.x, I have /Devices/ich9pci/ when using ICH9 and /Devices/pci/ when using PIIX3, and the OP has a VM run by VirtualBox 6.0.x with /Devices/pci/. I've been misled by the fact that the OP has the following line in his VBox log file:
VBox log file wrote:00:00:04.574899 IOAPIC: Using implementation 2.0! Chipset type ICH9
@socratis:
In your VMs run by VirtualBox 6.0.x, does this message occur in all VBox log files, independent on the chipset?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: VM guest's time is not in-sync with host

Post by socratis »

@floki
I want you to try with a new VM using a fresh Win10 ISO from Microsoft (https://www.microsoft.com/en-us/softwar ... ndows10ISO). Since you're going to be visiting their site using your Win10 host, you'll be presented with the "Create Win10 installation media" tool. If you want to just get the ISO, let me know and I can get you the link (24hrs of life). Or you could visit the site with a Linux VM. ;)

Create a new VM using the defaults, except maybe with 2 CPUs and 4 GB RAM for better performance. Let's see what happens...

@fth0
Here's what I get for the four different combinations (but let's not get sidetracked in this thread):
5.2.x / PIIX3 -> IOAPIC: Using implementation 2.0!
5.2.x / ICH9  -> IOAPIC: Using implementation 2.0!

6.0.x / PIIX3 -> IOAPIC: Using implementation 2.0! Chipset type ICH9
6.0.x / ICH9  -> IOAPIC: Using implementation 2.0! Chipset type ICH9
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply