Error: date: cannot set date: Operation not permitted (OpenVZ)
After installation of an OpenVZ container (VE/Virtual Environment) not able to set the date, and the time-zone was incorrect. Attempts to set the date resulted in the following error.
# date 031612482009
date: cannot set date: Operation not permitted
To correct this problem, exit from the container (#exit) and issue the following commands.
# vzctl stop <veid>
# vzctl set <veid> –save –capability sys_time:on
# vzctl start <veid>
Where <veid> is your Virtual Environment ID.
Next, log back into your virtual environment and issue the following commands to set the appropriate time-zone for the Virtual Environment (VE).
# vzctl enter <veid>
# mv /etc/localtime /etc/localtime.old
# ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
Now you can set the date and time appropriately.
September 4, 2009 at 2:20 am
Cool site, love the info.
September 3, 2010 at 1:30 am
Working as sysadmin, found this information very useful, thanks very much
October 26, 2011 at 6:48 pm
Thank for having the full vzctl commands, kept finding the ln, but never everything.
August 21, 2012 at 9:03 pm
Great stuff, just
vzctl set –save –capability sys_time:on
needs to be
vzctl set –save –capability sys_time:on
Note the “–” becomes “–”
Tried and tested ProxMox VE 2.1
August 21, 2012 at 9:05 pm
This blog formattes the double “- -” into a single “-” :-\
Anyway the -save and -capability needs to have double “-“”-” prefixed.