Page 1 of 2

How change permanently datetime...

Posted: 24. Feb 2013, 17:24
by dr_pompeii
Hello Guys

I have VirtualBox version 4.2.6 r82870 on Mac OS 10.8
I am working with Windows.... when I change the DateTime on Windows... just in seconds it returns to the same DateTime than my Mac OS

How I can around this situation? It is problematic

Thank You.

Re: How change permanently datetime...

Posted: 24. Feb 2013, 17:36
by Perryg
By disabling the time sync from VirtualBox. Then it is up to Windows and NTP.

Code: Select all

vboxmanage setextradata <vmname> “VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled” “1″

Re: How change permanently datetime...

Posted: 24. Feb 2013, 18:39
by dr_pompeii
Hello Perry

Thanks for the reply, but something is wrong or an extra step is mandatory....

The command when is executed none error appear.. I just have used
vboxmanage setextradata Windows-8-64 “VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled” “1″
and apparently works

But when I load my snapshot and do double click on the clock, disable any synchronisation with Internet or any else dependency...
then I change the day and again after of some seconds it returns or get the Mac OS system...

What is wrong?

BTW I have installed Guest Additions due it was mandatory to work with Shared Folders feature...

Could you give me a hand pls?

Thank You

Re: How change permanently datetime...

Posted: 24. Feb 2013, 18:42
by Perryg
You did this with the guest shut down, right? Not saved state or live.

Re: How change permanently datetime...

Posted: 24. Feb 2013, 18:50
by Perryg
An alternate command would be:

Code: Select all

VBoxManage modifyvm <vmname> --biossystemtimeoffset <msec>

Re: How change permanently datetime...

Posted: 24. Feb 2013, 19:01
by dr_pompeii
Thanks again for the reply
Perryg wrote:You did this with the guest shut down, right? Not saved state or live.
VirtualBox totally shutdown and closed on Mac... None instance running...

1) I execute the command
2) I open VirtualBox and load my sixth snapshot for this Windows8
3) I try to change the DateTime..... but not work...

About the command
VBoxManage modifyvm <vmname> --biossystemtimeoffset <msec>

How work the red part?

Thank You.

Re: How change permanently datetime...

Posted: 24. Feb 2013, 19:30
by Perryg
<msec> is milliseconds.
Depending on just how far back you want to go it can be a really large number.
1 month = 2628000000 millisecond

Code: Select all

VBoxManage modifyvm <vmname> --biossystemtimeoffset 2628000000
See conversion tables on the web.

Re: How change permanently datetime...

Posted: 24. Feb 2013, 19:43
by dr_pompeii
Hello Perryg

Thanks a lot for your support.... I will try it in the night....

Do you have some idea why the first command not work?.

BTW I forget to say I have installed VirtualBox 4.2.6 Oracle VM VirtualBox Extension Pack by mistake thinking It was the required to install
Guest Additions.... Well I was really tired and it was done... Anyway I don't think it would be the responsible that first command not work

Thank You...

Re: How change permanently datetime...

Posted: 24. Feb 2013, 20:06
by Perryg
Could be Windows 8. They are doing some funky Web stuff in the back ground that you don't see.

Re: How change permanently datetime...

Posted: 25. Feb 2013, 04:38
by dr_pompeii
Hi

Is not nothing about Windows 8... your first command work but must be used without quotes...

Error
vboxmanage setextradata Windows-8-64 VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled” “1

Correct
vboxmanage setextradata Windows-8-64 VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled 1

Thanks for all

Re: How change permanently datetime...

Posted: 25. Feb 2013, 08:51
by Armando
As far as I can see, however, the above mentioned command only works when you "close" a VM by saving its state and then "open" it by resuming the saved state.

As soon as the VM gets rebooted (or shut down and started from scratch) the guest date and time will sync again with the host.

So it is impossible to have a VM continuously keeping its own flow of time while you use it "normally"
(that is, starting it and shutting it down or restarting it as you need).
Am I wrong?

Re: How change permanently datetime...

Posted: 25. Feb 2013, 11:44
by mpack
A believe the typical guest OS reads the RTC once on startup, and thereafter uses system timer (*) ticks to track time, maybe with infrequent further checks of the RTC or network time servers for corrections. If VirtualBox lies about the RTC value, and the guest OS has no internet access, then it may be possible to have the guest clock running in a weird way.

People doing this are usually trying to fool some demo license into not expiring. Doomed to failed IMHO. The most moronic of programmers could e.g. test for file date stamps that appear to come from the future, or time out after a certain number of hours with no NTP access.

(*) I assume you're aware that the system timer is unrelated to the RTC. The system timer is like a stopwatch: it can measure the passage of time, but not tell you its current value.

Re: How change permanently datetime...

Posted: 25. Feb 2013, 15:46
by Perryg
The first suggestion stops the time sync. It does not stop the time initiation at startup.
The second suggestion sets the guest to a different time at startup, just like when you change the time in bios.

It can actually work for the demo time limit but is not designed for that and not to regress more than a short time. After a while you will reach the string limit and will not be able to add more zeros.

Re: How change permanently datetime...

Posted: 27. Feb 2013, 09:24
by Armando
So my assumption was correct:
by disabling (via vboxmanage setextradata...) the time sync we prevent VBox from syncing a VM's date/time with the host while the VM is running but we do not prevent it from syncing at the VM's startup, which is not possible in any way, unless acting on source code.

Thanks for confirming.

Re: How change permanently datetime...

Posted: 27. Feb 2013, 10:56
by mpack
Armando wrote:we do not prevent it from syncing at the VM's startup
There's a separate option which seems to cover that. See the extradata field GetHostTimeDisabled discussed above, and described in section 9.15.4 of the current (v4.2.6) user manual. In fact the whole of section 9.15 is relevant to this discussion.