1

I have a virtual machine running headless in my machine. When I start it for the first time, the result of date command is correct. But after about a day or 2, I SSH into it and the date command has become late. Like when I tried today, it's already 5 days behind. A restart of the machine fixes this issue (but I don't want to restart all the time).

How do I keep the time/date updated on my server virtual machine over time?

I've noticed this behavior with CentOS 7 and Turnkey Linux (Debian 7) guest OSes. The host is a Mac mini and I'm virtualizing with VirtualBox.

5
  • Have you installed the guest additions on Linux? Are you running NTP on the guest? Commented May 19, 2015 at 14:49
  • @Gilles I'm not sure. How do I check that? I'm currently running vanilla Turnkey Linux Core.
    – baktin
    Commented May 22, 2015 at 2:02
  • @Gilles Thanks for your comments, I think it resolved my issue: installing guest additions and ntp. But I have to observe it for a few days. I didn't know that guest additions was needed to get the time updated.
    – baktin
    Commented Aug 18, 2015 at 0:56
  • @Gilles Okay, I think your comment did the trick. Perhaps convert it to an answer so I can accept it as the answer.
    – baktin
    Commented Sep 1, 2015 at 7:41

1 Answer 1

0

Have you tried to install NTP in your VM and let it take care of that?

If you were using VMware the best thing to do would be to install vmware-tools which provides automatic sync of time. However, I don't know whether a similar package exists for VirtualBox.

You must log in to answer this question.

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