data in guest and host

This is for discussing general topics about how to use VirtualBox.
Post Reply
freewind
Posts: 10
Joined: 12. Nov 2008, 13:48

data in guest and host

Post by freewind »

Hello.
Sorry for my english.
I have last VBOX with GA. Host and Guest WinXP.
In Guest I need to run some program for change the data and time to past. But this programms not work, becouse Guest OS is rapidly sync data/time with host. How I can resolve this problem?
Thank you.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

You can use VBoxManage modifyvm uuid/name -biossystemtimeoffset msec. Just do the math and convert your delta time into milliseconds. If necessary you can put this in a script immediately before the VBoxManage startvm command. This will allow you to fix the start time within a few seconds.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
freewind
Posts: 10
Joined: 12. Nov 2008, 13:48

Post by freewind »

Thank you.
But, can I simply disable data and time sync between guest and host? I need different data for some programms that I run in VM. I use dater - simply programm to set data to past, before run basic programm. This very comfortable.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

IIRC, the clock of the guest is initialised by the guest BIOS from the host time at startup. Thereafter it is kept in sync with the Guest Additions timer driver, so just don't bother to load GA and you should be able to reset the time within the guest.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
ghr
Volunteer
Posts: 376
Joined: 25. May 2007, 22:46
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: DOS, Win3x, Win95, WinXP, Ubuntu, OS/2

Post by ghr »

So my conclusion (as well as my experience) is: installing GA makes the VBox command VBoxManage modifyvm uuid/name -biossystemtimeoffset msec useless... Right ?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

AFAIK, the GA driver honours the biossystemtimeoffset parameter.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Oops, cancel last. The code for the synchronisation is in vboxadd-timesync.c. This basically runs a loop where it compares the host time (requested from the HCGC interface) to the current gettimeofday and then converges these by 5ms per 10s unless the delta is >5 mins in which case it just resets the time to the host time as a bang.

I would have expected an offset in this calculation based on the biossystemtimeoffset parameter accessed through the BIOS, but it doesn't so it looks as if you are correct.

I've updated http://www.virtualbox.org/ticket/2107 accordingly.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Post by vbox4me2 »

Here's a hack, tested and working.

Locate VBoxGuest.sys in C:\WINDOWS\system32\drivers
Open it with a hexeditor (tiny hexer) and locate the word:
"ZwSetSystemTime", then zero out the first character "Z", reboot the guest(VM) and have your VM live in the past or future.

Ps. the security logs also don't get flooded anymore with 520 events.
Rodriguin81
Posts: 2
Joined: 10. Mar 2009, 23:58
Location: Buenos Aires

Re: data in guest and host

Post by Rodriguin81 »

Hello, I could not make the change in ..sys. I not understand "then zero out". Can you explain that it means, please?

Thanks in advance
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: data in guest and host

Post by TerryE »

He means replace it with a zero byte "\0x00". You can do this with any hex editor. That way the symbol is changed from "ZwSetSystemTime" to "" which does not resolve so the call to set the time fails silently.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Rodriguin81
Posts: 2
Joined: 10. Mar 2009, 23:58
Location: Buenos Aires

Re: data in guest and host

Post by Rodriguin81 »

OK, I only replace the "Z" character for NULL or 0x00.. and no good result (the guest no boot, but no problem).
Tomorrow i'll try to change all string for "" and tell you for results jejeje
i_saw_drones
Posts: 1
Joined: 11. Mar 2009, 19:05

Re:

Post by i_saw_drones »

vbox4me2 wrote:Here's a hack, tested and working.

Locate VBoxGuest.sys in C:\WINDOWS\system32\drivers
Open it with a hexeditor (tiny hexer) and locate the word:
"ZwSetSystemTime", then zero out the first character "Z", reboot the guest(VM) and have your VM live in the past or future.

Ps. the security logs also don't get flooded anymore with 520 events.
Hi there,
Thanks a lot for this, been looking everywhere for a solution.
However, I have also tried this replacement method directly in hex, by replacing the "Z" with a null and also a space, as well as replacing the whole function name with nulls but with no luck. My vista guest just falls over when trying to use the modified version (based on GA 2.1.4).
Sorry to be a pain, but could you please be so kind as to tell me exactly what you did to have this work?

Thank you very much.
Last edited by i_saw_drones on 13. Mar 2009, 13:07, edited 1 time in total.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: data in guest and host

Post by vbox4me2 »

Nothing personal but if you can't get this to work then this hack is not for you. This should be resolved by the devellopment team so file a ticket or compile the OSE yourself. As you have seen the Host can crash if done wrong.
Post Reply