1

I have a time server running on a server PC that is meant to change the times of various guest PCs as a result of a TCP/IP command on port 9000 issued by a control application running on an integrated controller. I have everything running the way I would like except that every time I try to set the time on my clients or my server PC using the following:

sudo hwclock --set --date="2014-01-30 12:00:00"
sudo hwclock --hctosys

the time changes to my issued value and then moments later the time reverts back to what it was initially. I've tried using these commands on a guest pc with ntp stopped, and no network connectivity with the /etc/localtime file deleted and it still does this. I'm using the latest version of Lubuntu currently. Does anyone know why this might be happening?

By the by, when I say "PC" I am referring to virtual machines I have running in VirtualBox. Eventually this will go onto real PCs but for now I'm working virtually.

2
  • --hctosys will also set the timezone, are you sure its set correctly? Jan 31, 2014 at 12:29
  • From what I understand the timezone specifies an offset. In most cases this is in increments of hours (half hours for certain zones like Kabul). So even if I was resetting the timezone to be my own, I would expect at least minutes to match my input +- 30 minutes worst case.
    – Dan Snyder
    Jan 31, 2014 at 12:39

2 Answers 2

0

Maybe you enabled the time synchronisation between host and guests?

See here: Using virtual box is it possible to set your virtual machine time to be different from host time

Just a thought.

I appologize if that doesn't suffice as an answer - it seems I cannot add comments (not yet, or not because I'm using the smartphone version of the site).

4
  • You will be able to add comments to any post after gaining 50 points to reputation. Jan 31, 2014 at 9:07
  • Interesting. So I followed these: stevenormrod.com/2012/10/disabling-time-sync-in-virtualbox directions and I am able to set the time but this in the "Time and Date Settings" window still reverts back to the original time. The time on my toolbar changes to my specified time after a long while and then changes back as well. I tried the command specified above as well as the standard sudo date --set="..". Any other possibilities?
    – Dan Snyder
    Jan 31, 2014 at 12:14
  • Okay, so I tried this on a non-virtual Lubuntu installation and time setting works fine. All signs point to VB...
    – Dan Snyder
    Jan 31, 2014 at 12:21
  • Okay, VM with no guest additions allows time setting just fine. Perhaps a mechanism other than time synchronization is fighting me...
    – Dan Snyder
    Jan 31, 2014 at 13:10
0

Figured it out. Thank you for directing me towards VirtualBox as the issue. If anyone runs into this problem the solution is simple. It is the time sync feature from VirtualBox Guest Additions that is causing time to revert back to its original state. To prevent time sync in a linux guest VM, follow the below instructions:

disable time sync instructions

Simply change line

daemon $binary > /dev/null to daemon $binary --disable-timesync > /dev/null

in "/etc/init.d/vboxadd-service"

Cheers

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .