Go to main content
Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: March 2017

Setting Time Values in Non-Global Oracle Solaris Zones

You can set time values in non-global zones that are different from the value in the global zone. The ability to set the time in the zone is available through the default sys_time privilege. This privilege allows a non-global zone process to set either the virtual zone time or the system time, depending on the value of the global-time property for the zone, if set. The ability to set different times in non-global zones is not independent of time changes made in the global zone. If the time is changed in the global zone, the non-global zone time is offset by the same amount.

Network Time Protocol (NTP) can be run from any zone, affecting only the zone in which the command is run. When running NTP across a system with non-global zones that have different times, run NTP in the global zone. Running NTP in the global zone will synchronize all the non- global zone clocks that just run at an offset. The effect of NTP changing the time through clock modulation in the global zone will transfer to a non global-zone as well.

When NTP is run inside the zone with global-time set to false, the ntp_adjtime and adjtime syscalls cannot be used to make corrections to the zone time. When global-time is set to false, NTP keeps time in sync by adjusting the clock to a given value through setting the time, which maintains time synchronization at a second level of granularity. NTP can make zone time go forward or backward to maintain synchronization.

When NTP is run inside the zone when global-time is set to true, NTP is allowed to modulate the system clock through the ntp_adjtime and adjtime system calls. Then the ability to run NTP inside the zone to keep system time in tight synchronization is preserved.

For more information about the global-time property, see Oracle Solaris Zones Configuration Resources. For information about setting the time, see date(1). For more information about privileges, see Privileges in a Non-Global Zone. For more information about adjtime and ntp_adjtime, see the adjtime(2) and ntp_adjtime(2) man pages.