[SOLVED] Can't set date; manually, ntp or otherwise
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've got ntp running, but unfortunately, I started it up before executing ntpdate to do the initial synchronizing of the OS clock to the "correct" remote server time. My VM had drifted badly over the months, so the offset when I run ntpq -p is currently -101 seconds, and continues to increase. I tried stopping ntpd, and running ntpdate again, however the sync was not successful; the offset persists.
I also tried to set the system date manually using the date command, however, it does not seem to work...when I run something like date --set="06/21/2011 1:00:00", it outputs that date, however when I execute "date" again, the date has not been changed. I'm logged in as root so that's not the issue.
I'm kind of at a loss at this point, do I need to uninstall ntp and reinstall or something? Thanks for any help.
All I know right now is the guest OS, it's CentOS 5.5. I'm on a hosted VPS and I've not needed to know the other information thus far. I've got a request in to find out the other information. I'll post back here as soon as I find out.
Yeah, I already tried that a bunch of times. I think that the problem must be that the VPS gets its time from the host as you say. I'm working with the host now so hopefully they can help me resolve the issue. I'll post back when I find out for sure.
OK, I finally got it sorted out. I am on a VPS using Xen VMs. By default, the guest VMs will sync to the host machine's system time, so the guest VM is not able to alter its system time. Through much googling I found that this is controlled by a flag on the guest VM as described here:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.