Centos – Unable to set timezone on Xen VM running CentOS 5

centos

I have a XEN domU running CentOS 5.

I'm having trouble setting the correct timezone.

I want it to run on Mountain Standard Time, but it shows Pacific Standard time. I've tried everything, but I can't get this right. This VM doesn't have Internet access, so I can't use ntpd or anything. I sync it up with another Xen domU running XP, which has the correct timezone and time. But even if I don't sync up, it should show me the correct timezone, since I'm pointing /etc/localtime at the correct timezone.

Here's all the commands (and output for some) I've used so far.

# mv /etc/localtime  /etc/localtime-old

# ln -sf /usr/share/zoneinfo/US/Mountain /etc/localtime

# vi /etc/sysconfig/clock

ZONE="America/Denver"
UTC=true
ARC=false

# /usr/sbin/tzdata-update

# /sbin/hwclock --systohc --utc

# uname -a
Linux MyServer 2.6.18-164.6.1.el5 #1 SMP Tue Nov 3 16:18:27 EST 2009 i686 athlon i386 GNU/Linux

Now when I type date it shows PST
# date
Thu Apr 7 16:29:34 PDT 2011

ntpd is not running

What's missing?

Best Answer

Do you use a PV Xen DomU? If so, your time is coupled with the Dom0. If you want to change that, do a sysctl -e xen.independent_wallclock = 1

After that timezone, ntpdate and ntp will function as expected.

Related Topic