Page 1 of 1

Guest time sync cannot be disabled

Posted: 6. Jan 2019, 17:36
by RonLar
I'm running a Win 10 guest on a Win 10 host, and am trying to disable guest time sync. Basically I want guest time to only pass when the guest is up and running.

Details:

VirtualBox 5.2.22 r126460 with extension pack
Host is Win 10 Home 64-bit 1809
Guest is Win 10 Home 32-bit 1809 with guest additions, vminfo is pasted here: pastebin(dot)com/d2Dw49Dy

I've verified the name of the VM, run the following, verified that the value is 1, and disabled guest networking:
VBoxManage setextradata "Windows 10 32-bit" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
But there is no change. Every time I start the guest it receives the updated host time. How can I fix this?

Re: Guest time sync cannot be disabled

Posted: 6. Jan 2019, 17:42
by socratis
RonLar wrote:Basically I want guest time to only pass when the guest is up and running.
Can't do that. Every time you boot the VM, it's going to ask the time from the host. Why do you want to do this? There might be ways around it, but it would depend on the usage scenario.

Re: Guest time sync cannot be disabled

Posted: 6. Jan 2019, 18:25
by RonLar
socratis wrote:Can't do that. Every time you boot the VM, it's going to ask the time from the host.
Why not? Isn't the whole point of a setting called "GetHostTimeDisabled" to stop it from asking the time from the host?
socratis wrote:Why do you want to do this? There might be ways around it, but it would depend on the usage scenario.
I'd like to first point out that these are valid and licensed installations. This is not some scenario to use or play pirate copied operating systems or video games.

I occasionally need to build a few updated command line tools for Windows. With the way I use my regular Windows machine, the host system, I can't guarantee that it's free from malware or treat it as a production system, so I keep a minimal, encrypted, and guaranteed clean Win 10 system in a VM just for the purpose of running MSBuild and VC++ to produce the CLI tools.

But when I start the guest every month or two it goes through the entire maintenance and update procedure, on an encrypted disk, with no AES hardware support in the CPU, and it is unbearably slow. To minimize this I want the guest to believe only a second has passed since I last turned it off.

Re: Guest time sync cannot be disabled

Posted: 6. Jan 2019, 19:56
by socratis
RonLar wrote: Isn't the whole point of a setting called "GetHostTimeDisabled" to stop it from asking the time from the host?
Yes it is. Once it's up and running, not at boot! If you were to keep it frozen like you have in your mind, then something on the host must be keeping track of when you shut it down last time, and set the time at boot for the virtualBIOS. No such mechanism exists.

What this key does is to tell it "Hey, if I change the time manually in the guest, don't change it for me". Oh, and BTW, this applies only to guests with Guest Additions (GAs) installed. The rest get the time once from the host (when they boot) and then they're on their own...
RonLar wrote:I'd like to first point out that these are valid and licensed installations
You read my mind! :)
RonLar wrote:so I keep a minimal, encrypted, and guaranteed clean Win 10 system
I understand most of it, except the encrypted part. Why encrypted? You're afraid that your virtual HD is going to get affected?
RonLar wrote:it goes through the entire maintenance and update procedure, on an encrypted disk, with no AES hardware support in the CPU, and it is unbearably slow.
Out of curiosity, what does that even mean?
RonLar wrote:To minimize this I want the guest to believe only a second has passed since I last turned it off.
And now we're getting to the gist of your question. You can't do this automatically, you have to do it manually. There is a command that can set the time offset that a VM gets from the BIOS each time it starts:
VBoxManage modifyvm "<VMname>" --biossystemtimeoffset <ms>
  • This specifies a fixed time offset (milliseconds) of the guest relative to the host time. If the offset is positive, the guest time runs ahead of the host time.
Now, you can use this command right before you launch your VM, but you got to keep track of the time outside VirtualBox, like in your notebook or post-it note stuck on your monitor... ;)

For examples of how people have used it, search for "biossystemtimeoffset site:forums.virtualbox.org", or even "biossystemtimeoffset script site:forums.virtualbox.org" for a script or two.

Re: Guest time sync cannot be disabled

Posted: 6. Jan 2019, 21:30
by RonLar
socratis wrote:Now, you can use this command right before you launch your VM, but you got to keep track of the time outside VirtualBox, like in your notebook or post-it note stuck on your monitor... ;)

For examples of how people have used it, search for "biossystemtimeoffset site:forums virtualbox org", or even "biossystemtimeoffset script site:forums virtualbox org" for a script or two.
I'll have a look. Thanks for your help.