2

I want to set the date on my windows 7 Home Premium virtual machine to Jan X, 2009 (any day in that month). Or if I cannot do that set the date to Jan X, 2009 and then let it increment normally after that (less desirable) but I can live with it. I have tried this already but the system changes it back to today and nothing I do can stop it.

There is no point in telling me about secpol.msc because that does not exist in the home editions. Does anyone know how to disable date inside the bowels of the beast? Perhaps using the CLI.

And I did what Natsu Gage suggested:

    net stop w32time

and then

    w32tm /unregister

But that had no affect other than to kill the time server connection (a good thing!).

I also tried using the "date" command in the CLI as SU. That seemed to work but it had no affect on the date in the panel and then when I ran the "date" command it reported today's date unchanged.

Edit many hours later: OK these are all the things I have done to figure this out.

  1. I changed the date in my UEFI even though I didn't think that would matter. It didn't matter.
  2. I changed the date in the host. Linux wouldn't let me do that even when I logged in as root. Just as well. I do want auto date and time in the host.
  3. I went through the registry file. I found there was a "datetime.cpl" (or maybe timedate.cpl?) being called in a number of entries. But since they were inside Windows hieroglyphics entries and I don't know what I am doing with those, I left them alone.
  4. I found w32time nestled all nice and cozy inside a service host call. When I saw that I disabled the Ethernet card in the virtual machine (apparently that also disables it in the host!)) so that we could positively eliminate w32time as the culprit. I then rebooted.
  5. I opened task manager to see what processes and services were running but found no likely candidates. But there were a dozen service hosts running that could have been hiding it. Virtualbox guest additions was also running.
  6. I then logged in as super administrator and changed the date using CLI "date" command. I had done this before to no avail but I did notice a 10 second lag before the date changed back to today in the panel. So I opened task manager, sorted by CPU use and watched as I hit the enter on the date command. Sure enough for the briefest moment a service host process logged cpu time at the exact moment the date changed in the panel.

Third Update Edit:

I forgot to mention that following a suggestion from Natsu Gage, I ran:

    sc qtriggerinfo w32time

The result was:

    The specific service does not exist as an installed service

And therefor that corroborated the fact that the w32time service was not doing the automatic date updating. Since Microsoft says that it is the only service which updates time and date, that strengthens my suspicion that Virtualbox is doing it.

CONCLUSION: Virtual box guest additions is the only possible program that could be using service host to make the date changes and it is getting the date time from the host system. So I need to go and post on their forum.

I would never have got this far without Natsu Gage's help. He/she gave me search criteria for google that I would never have thought of (I am old) and they were extremely helpful.

Mikech
  • 21
  • 6

1 Answers1

0

Short answer:

Once installed and started, the Oracle VM VirtualBox Guest Additions will try to synchronize the guest time with the host time. This can be prevented by forbidding the guest service from reading the host clock:

$ VBoxManage setextradata VM-name "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

Knowing the correct terminology sure makes a big difference in search results! So it turns out that "Virtualbox guest additions" does in fact update the time in a virtual machine and they provide a way to turn that off. Wish I had know that to start with!

Here are the solutions to the problem. I am posting three different threads because the circumstances may be different and not all the solutions will work for everyone but one of the solutions should work for you. I don't really understand them yet (that will require a great deal of study) but I wanted to post them immediately in case someone has a similar issue.

https://unix.stackexchange.com/questions/505650/manually-set-time-overwritten-without-a-time-sync-active-in-a-vm

How to disable time sync with Windows 7 as host OS in VirtualBox?

https://forums.virtualbox.org/viewtopic.php?f=2&t=8535&sid=b33293ccc01c532972318e370223aff1&start=15

Also the manual has information but I certainly did not understand any of it on first read but you might:

https://www.virtualbox.org/manual/ch09.html#fine-tune-timers

The key to this is knowing the right search terms which is:

    How to disable time sync between host and guest  

When I began this thread I did not know that Virtualbox Guest Additions was causing the problem and therefore wasted a lot of time. Also it never occurred to me to post in the Linux/Unix exchange since I thought it was a Windows issue.

Mikech
  • 21
  • 6