Page 1 of 1

Guest RTC clock always two days behind host on VM startup

Posted: 1. Jan 2018, 20:43
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!

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

Posted: 2. Jan 2018, 01:28
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?

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

Posted: 2. Jan 2018, 02:46
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.

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

Posted: 2. Jan 2018, 03:50
by rpyne
That sounds like your hardware clock is off by two days.

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

Posted: 2. Jan 2018, 06:03
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.