Knowledgebase

how change time on openvz?

Posted by mixmox, 12-09-2010, 02:29 PM
hello. how can i change timezone time and date on my openvz vps. i have access on main node too

Posted by tanfwc, 12-09-2010, 02:39 PM
Give this a try on your guest node only

Posted by mixmox, 12-09-2010, 02:59 PM
is it importandt what is the time and time zone on main node?

Posted by MikeDVB, 12-09-2010, 03:09 PM
The system clock should run GMT+0 on the hardware clock and the software clock (that uses timezones) just makes adjustments off of that.

Posted by mixmox, 12-09-2010, 05:18 PM
so what should i run on main node?

Posted by kevster1, 12-09-2010, 05:41 PM
change timezone eg ln -sf ../usr/share/zoneinfo/Greenwich /etc/localtime set time with date command on the main node eg date 11042359 -- 4th nov 23:59 sync with time server using NTP check this out http://www.cyberciti.biz/faq/howto-i...-server-clock/

Posted by mugo, 12-11-2010, 04:23 AM
You can't change the time itself on an OpenVZ VE, that must be set on the node. You can not sync it with a time server, you can not manually change it. You will only get an error that it's not allowed. If the time is off, you must contact your host to set it...most providers are aware of the importance of maintaining proper time on a VZ node. To set on the node, just use what was given above. I would highly suggest installing, or if it is already, run ntpd. Set the time first, as it will not set if the offset is over a particular amount. Once you set it, the default sever in your conf file will suffice, but you can change them to any time server you have access to. You CAN change the time zone, and I do to all mine to match my time zone...after all, I want my log files to have meaning to me where I live, not in East Africa. The methods above will work for changing time zone.

Posted by kevster1, 12-11-2010, 04:25 AM
if you check the ops post he also states he has access to the main node thats why people have suggested the sync

Posted by mugo, 12-11-2010, 04:49 AM
Yeah, noticed that after the fact and edited to suggest using ntpd on the node.

Posted by @Matt, 12-11-2010, 09:59 AM
Here is an example of how to set the time. Stop VE vzctl stop CTID in Host node, run: vzctl set CTID --capability sys_timen --save Start VE: vzctl start CTID Enter VE: vzctl enter CTID mv /etc/localtime /etc/localtime.old ln -s /usr/share/zoneinfo/EST5EDT /etc/localtime

Posted by mixmox, 12-11-2010, 05:11 PM
tnx from all you. @PogiWeb : this command make access for openvz vm to have their particular time? (i mean after that users can change timezon ) this is what i run on vm and see time change to our location without any error: ln -sf /usr/share/zoneinfo/mylocation localtime ln -sf /usr/share/zoneinfo/EST localtime

Posted by @Matt, 12-12-2010, 04:13 PM
To answer the question the answer is yes. The user will then be able to change the server time if needed.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
htaccess toughie (Views: 597)
JaguarPC review please (Views: 606)
atjeu.com down? (Views: 667)
lnhost down again. (Views: 665)


Language:

Client Login

Email

Password

Remember Me

Search