If the host is a Linux system and runs an ntp service (most distros do by default) you can configure the host as ntp server for the guest.
Assuming that you are using virtual box and a NAT type network adapter for the virtual system the guest will see the host under 10.0.2.2.
In /etc/ntp.conf on the guest system you'll find the section with the servers. I.e. on my machine that looks like below
Code:
# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will
# pick a different set every time it starts up. Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
Make a backup copy of the file:
Code:
cp /etc.ntp.conf /etc/ntp.conf.bck
and then change it into
Code:
# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will
# pick a different set every time it starts up. Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
server 10.0.2.2 iburst
The restart ntp (how to do that depends on your init system, worst case just restart the guest system).
Now the two machines should automatically synchronize, provided that the timezone is set correctly as described by veerain.