As mentioned in my previous post, I had a minor support issue with the Linode host I set up last night. When I logged in, the system clock was set to 2008:

root@server:~# date
Thu Nov 20 14:03:10 EST 2008

Attempting to set the correct time resulted in an error I hadn’t ever seen:

root@server:~# date -s "25 JAN 2010 00:50:00"
date: cannot set date: Operation not permitted
Mon Jan 25 00:50:00 EST 2010

Can my server travel through time? Sadly, no.

Linode uses Xen virtualization, so I (correctly) assumed that the clock on the physical host for my node was wrong. I fired off a quick support ticket and went to bed. Flash forward to this morning, and I had a response when I woke up, and the fine folks at Linode were kind enough to provide the solution (at least for Ubuntu): disconnecting the virtual system clock from the physical host.

Edit /etc/sysctl.conf to include the line:

xen.independent_wallclock = 1

Then, reboot your node and eureka, you can set the time and date.

Alternately, you can temporarily detach from the host clock by doing this, no reboot required.

echo 1 > /proc/sys/xen/independent_wallclock

I’m not entirely sure why Linode doesn’t care whether their host machine has the correct time or not, but there you go. While you’re logged in and mucking about with your time settings, add a crontab to update the time from an NTP server every night:

0 1 * * * /usr/sbin/ntpdate us.pool.ntp.org

(You’ll probably need to apt-get install ntpdate)