Monday, September 26, 2011

date: cannot set date: Operation not permitted openvz


This post explains how to solve the following error while setting the time in a openvz container vps.

date: cannot set date: Operation not permitted

Capability not set for the vps


On Openvz node:

Stop the vps
[root@test ~]# vzctl stop 9851

set the parameter

[root@test ~]# vzctl set 9851 --save --capability sys_time:on
Saved parameters for CT 9851

Start the vps
[root@test ~]# vzctl start 9851

Enter into the vps
[root@test8 ~]# vzctl enter 9851
entered into CT 9851
[root@abc /]#

check date
[root@abc /]# date
Fri Sep 16 00:39:09 CST 2011

Change date
[root@abc /]# date -s "Tue Sep 27 00:39:09 CST 2011"
Tue Sep 27 00:39:09 CST 2011

check date again
[root@abc /]# date
Tue Sep 27 00:39:19 CST 2011

Thats it. Date has been changed. 

Recommended Reading

1. Practical Guide to Linux Commands, Editors, and Shell Programming, A (2nd Edition)
2. UNIX and Linux System Administration Handbook (4th Edition)
3. Linux All-in-One For Dummies
4. Introduction to the Command Line (Second Edition): The Fat Free Guide to Unix and Linux Commands

No comments:

Post a Comment

Be nice. That's all.