MyThinkPond

On Java, Python, Groovy, Grails, Spring, Node.js, Linux, Arduino, ARM, Embedded Devices & Web

  • Recent Posts

    November 2016
    M T W T F S S
    « Oct   Dec »
     123456
    78910111213
    14151617181920
    21222324252627
    282930  
  • Subscribe Options

  • Awards

    JavaCodeGeeks
  • Most Valuable Blogger @ DZone
  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 175 other followers

  • Follow MyThinkPond on WordPress.com
  • Blog Stats

    • 366,804 hits
  • General Options

How to sync your date when you restore a VirtualBox snapshot?

Posted by Venkatt Guhesan on November 5, 2016

hypervisor_logoThis article focuses on synchronizing/updating the clock in your guest linux VM after you restore a VirtualBox snapshot.

When you create a VirtualBox snapshot, it’s essentially a photo taken and frozen in time. All bits including the date and time are frozen to that instant. When you restore a snapshot, the Linux guest VM system is restored back to that snapshot including the date and time. This may not be desired all the time especially if the purpose is to restore the configuration and settings to an earlier time but your want to roll forward the clock on the VM to the present instance. The outlined steps below can also apply to other virtual hypervisors like Qemu, VMWare, Amazon S3 images, etc. (essentially where ever you may have a CentOS or Red Hat Linux Virtual instance and with slight modifications the same can be applied to any Linux guest hypervised image)

Below are a few simple steps you can take to reset the clock:

Steps to perform before you create a VirtualBox snapshot:

# Install ntp service 
yum -y install ntp
# Turn it on so that it starts up automatically on reboot
chkconfig ntpd on
# Point it to your nearest internet accessable NTP server available around the globe for time-services 
ntpdate pool.ntp.org
# Manually start it up and ensure that it comes up
service ntpd start

Now take a VirtualBox snapshot as needed.

When you restore a snapshot, do the following after the snapshot is restored:

# After snapshot restore, run 
ntpdate pool.ntp.org

That’s it! Your date & time should now be updated but all of the other settings and modifications you have done will be restored to it’s former glory!

What is NTP?
NTP stands for Network Time Protocol, and it is an Internet protocol used to synchronize the clocks of computers to some time reference.

Cheers!

Today’s Inspirational Quotes:

bust_of_marcusaureliusIf you are distressed by anything external, the pain is not due to the thing itself, but to your estimate of it; and this you have the power to revoke at any moment.

Marcus Aurelius, Meditations

 

-AUM

Advertisements

One Response to “How to sync your date when you restore a VirtualBox snapshot?”

  1. […] « How to sync your date when you restore a VirtualBox snapshot? […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: