Is there a way to "stop" the virtual hardware clock?

Allgemeine Diskussionen über den Einsatz von VirtualBox.
Post Reply
NKTUD
Posts: 4
Joined: 27. Sep 2019, 21:32

Is there a way to "stop" the virtual hardware clock?

Post by NKTUD »

I'd love to experiment with different operating systems when basic assumptions are not met. One of the most basic assumption is that the hardware clock always goes forward.

Is there any way to disable that? I'm not sure how it is technically implemented, but I imagine the hardware clock to add +1 (or some small float, depending on the resolution of the clock) every let's say 1 second. Like in Unix-time. My ideal configuration would be to always return the same value from the clock.

I'd be interested in how operating systems react when one of the most basic assumptions humans make pretty much everywhere is failing.

Is there any way to do this in VirtualBox? I'd be fine in writing some own code and re-compiling, if neccessary. But I don't know where to start.
birdie
Posts: 428
Joined: 2. May 2010, 14:19
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: Windows, Linux, other Unixes
Location: Artem S. Tashkinov
Contact:

Re: Is there a way to "stop" the virtual hardware clock?

Post by birdie »

Maybe start here?

https://docs.oracle.com/en/virtualizati ... imers.html

VirtualBox timers source code is here:

https://www.virtualbox.org/browser/vbox ... Devices/PC

Check DevHPET.cpp and DevRTC.cpp
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Is there a way to "stop" the virtual hardware clock?

Post by mpack »

No, there is no feature that allows you to stop the clock (RTC). You can apply a fixed time offset in milliseconds, this can be recalculated before every boot, but it can't be stopped as such. Also if the VM has a network connection then the clock will probably be corrected on boot anyway unless you can disable the NTP check.

It's probably simpler (and cheaper!) to just pay for that trial period software... :)
Post Reply