English | 中文 | Русский | Français
2,602 Posts served
8,351 Conversations started
The inaccuracy for system time of VMs has been well documented. This behavior has been labeled time drift. Because of the time drift while executing, it is recommended to use NTP. Use LINUX to set up an NTP server within the network of the physical machine(s) being used. This will allow the VMs to sync up their system time. The observed overhead appears to be less than 1%. On Windows 2003, which uses SNTP (Simple Network Time Protocol), there are 2 UDP packets received and 1 UDP packet sent by the system under test. On SLES 9 SP1, which uses NTP, there are 4 TCP packets received and 1 TCP packet sent. On a lightly loaded system, updating every 10 minutes is sufficient. On a heavily loaded system, it is recommended to update every minute. I have set updates to occur every minute, without a significant load added to the system.
If the VMM being used has a time synch option, it should be enabled.
There are just a few steps necessary to have your Windows 2003 system synchronizing with your NTP server, even from within a Virtual Machine.
Specifying your Internet Time Server
Right click on your time display. Then click on the Adjust/Time selection. Then click on the Internet Time tab. Enter the IP address or Name of the NTP server you wish to synchronize with.
Create a batch file
You will need to create a batch file for your scheduled task to execute. The batch file needs only one line:
w32tm /resync
Create the Scheduled task
Go to C:\Windows\Tasks folder. You will see an entry to "Add a scheduled task". Click on it to bring up the wizard. Browse to specify your newly created batch file as the executable for the new task. Specify daily execution. After you have created the task, use the advanced features to execute it every 10 minutes or 5 minutes as necessary.
SLES 9 SP1
There are just a few steps necessary to have your LINUX system synchronizing with your NTP server, even from within a Virtual Machine.
Specifying your Internet Time Server
Edit the file /etc/ntp.conf. Specify your server by adding a line like:
Server 192.168.1.63
Create a shell script
Create a bash shell script with the lines:
#!/bin/bash
/etc/init.d/xntpd restart 2>&1 > /dev/null
Edit crontab
Edit /etc/crontab to add an entry for your newly created shell script. It would look like (to execute every 5 minutes):
0,5,10,15,20,25,30,35,40,45,50,55 * * * root /root/myNewScript

Steven Thomsen (Intel)
1,605
Status Points:
1,105