Guest RTC clock always two days behind host on VM startup

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Misha256
Posts: 4
Joined: 26. May 2014, 10:08

Guest RTC clock always two days behind host on VM startup

Post by Misha256 »

Hi everyone,

I'm experiencing a strange issue. When I start any VM, VirtualBox initially sets the VM's RTC clock two days behind the current local host datetime. Could this be a bug? Is there a workaround?

- Host OS: Fedora Workstation 27 64-bit (Kernel 4.14.8 )
- VirtualBox: 5.1.30 (RPM Fusion build)
- Guest: Any (guest additions not relevant in this issue)

Attached:

- Screenshot of host date and time
- Screenshot of RTC date and time on VM startup
- VM log

BTW happy new year to all!
Attachments
VBox.log
VM log
(87.01 KiB) Downloaded 9 times
Screenshot of RTC date and time on VM startup
Screenshot of RTC date and time on VM startup
Screenshot from 2018-01-02 06-06-09.png (18.9 KiB) Viewed 2163 times
Screenshot of host date and time
Screenshot of host date and time
Screenshot from 2018-01-02 06-05-25.png (11.21 KiB) Viewed 2163 times
socratis
Site Moderator
Posts: 27329
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: Guest RTC clock always two days behind host on VM startup

Post by socratis »

00:00:01.023848 Guest OS type: 'WindowsXP'
00:00:01.094905 File system of '/home/jonah/Downloads/Microsoft MS-DOS 6.22 Plus Enhanced Tools (3.5)/Disk1.img' (Floppy) is ext4
This doesn't look right at all. Could you elaborate?
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.
Misha256
Posts: 4
Joined: 26. May 2014, 10:08

Re: Guest RTC clock always two days behind host on VM startup

Post by Misha256 »

Oh sorry about that, I temporarily booted the VM with a MS-DOS floppy disk image to troubleshoot this. The issue is the same when I boot to Windows XP.
rpyne
Posts: 16
Joined: 5. Jul 2013, 00:15
Primary OS: Other
VBox Version: OSE Fedora
Guest OSses: linux

Re: Guest RTC clock always two days behind host on VM startup

Post by rpyne »

That sounds like your hardware clock is off by two days.
Misha256
Posts: 4
Joined: 26. May 2014, 10:08

Re: Guest RTC clock always two days behind host on VM startup

Post by Misha256 »

rpyne wrote:That sounds like your hardware clock is off by two days.
Exactly what I thought but then I did more testing. I think I've discovered a corner case bug.

The issue seemingly "resolved itself" -- I could not replicate it. So I set the hardware clock via BIOS Setup to 01/01/2018 15:00:00 (Linux takes that as UTC) and the bug reveals itself nicely! My guess is it's a date calculation bug that crops up only around new year?

Updated screenshots attached. Note that internet is disabled and guest additions are not installed, to ensure what we see is the date and time VirtualBox sets the VM to on startup.
Attachments
VBox.log
VM log
(88.74 KiB) Downloaded 5 times
Windows XP VM showing date and time as set by VirtualBox on startup.
Windows XP VM showing date and time as set by VirtualBox on startup.
Screenshot from 2018-01-02 04-12-01b.jpg (83.21 KiB) Viewed 2145 times
Date and time set in BIOS
Date and time set in BIOS
20180102_161346_resized_b.jpg (87.99 KiB) Viewed 2145 times
Post Reply