Go to main content

Oracle® Solaris Zones Configuration Resources

Exit Print View

Updated: October 2017

About Using the zonecfg Command

The zonecfg command, which is described in the zonecfg (1M) man page, is used to configure a non-global zone.

The zonecfg command can also be used to persistently specify the resource management settings for the global zone. For example, you can use the command to configure the global zone to use a dedicated CPU by using the dedicated-cpu resource.

    The zonecfg command can be used in interactive mode, in command-line mode, or in command-file mode. The following operations can be performed using this command:

  • Create or delete (destroy) a zone configuration

  • Add resources to a particular configuration

  • Set properties for resources added to a configuration

  • Remove resources from a particular configuration

  • Query or verify a configuration

  • Commit to a configuration

  • Revert to a previous configuration

  • Rename a zone

  • Exit from a zonecfg session

The zonecfg prompt is of the following form:


When you are configuring a specific resource type, such as a file system, that resource type is also included in the prompt:


For more information, including procedures that show how to use the various zonecfg components described in this chapter, see Chapter 1, How to Plan and Configure Non-Global Zones in Creating and Using Oracle Solaris Zones.

zonecfg Modes

The concept of a scope is used for the user interface. The scope can be either global or resource specific. The default scope is global.

In the global scope, the add subcommand and the select subcommand are used to select a specific resource. The scope then changes to that resource type.

  • For the add subcommand, the end or cancel subcommands are used to complete the resource specification.

  • For the select subcommand, the end or cancel subcommands are used to complete the resource modification.

The scope then reverts back to global.

Certain subcommands, such as add, remove, and set, have different semantics in each scope.

zonecfg Command in Command-File Mode

In command-file mode, input is taken from a file. The export subcommand described in zonecfg Command in Interactive Mode is used to produce this file. The configuration can be printed to standard output, or the –f option can be used to specify an output file.

zonecfg Command in Interactive Mode

In interactive mode, the following subcommands are supported. For detailed information about semantics and options used with the subcommands, see the zonecfg (1M) man page. For any subcommand that could result in destructive actions or loss of work, the system requests user confirmation before proceeding. You can use the –F (force) option to bypass this confirmation.


Print general help, or display help about a given resource.

zonecfg:my-zone:capped-cpu> help

In the global scope, add the specified resource type to the configuration.

In the resource scope, add a property of the given name with the given value.

See How to Configure the Zone in Creating and Using Oracle Solaris Zones and the zonecfg (1M) man page for more information.


Applicable only in the resource scope. End the resource specification and reset the scope to global. Any partially specified resources are not retained.


Clear the value for optional settings. Required settings cannot be cleared. However, some required settings can be changed by assigning a new value. Use of the clear command on a property clears the value to the default value of the property.


Commit current configuration from memory to stable storage. Until the in-memory configuration is committed, changes can be removed with the revert subcommand. A configuration must be committed to be used by zoneadm. This operation is attempted automatically when you complete a zonecfg session. Because only a correct configuration can be committed, the commit operation automatically does a verify.


Begin configuring an in-memory configuration for the specified new zone for one of these purposes:

  • To apply the Oracle Solaris default settings to a new configuration. This method is the default.

  • With the –t template option, to create a configuration that is identical to the specified template. The zone name is changed from the template name to the new zone name.

  • With the –F option, to overwrite an existing configuration.

  • With the –b option, to create a blank configuration in which nothing is set.


Destroy the specified configuration. Delete the configuration both from memory and from stable storage. You must use the –F (force) option with delete.


Caution  -  This action is instantaneous. No commit is required, and a deleted zone cannot be reverted.


Applicable only in the resource scope. End the resource specification.

The zonecfg command then verifies that the current resource is fully specified.

  • If the resource is fully specified, it is added to the in-memory configuration and the scope will revert back to global.

  • If the specification is incomplete, the system displays an error message that describes what needs to be done.


Exit the zonecfg session. You can use the –F (force) option with exit.

A commit is automatically attempted if needed. Note that an EOF character can also be used to exit the session.


Print the configuration to standard output, or to the output file specified, in a form that can be used in a command file.


Display information about the current configuration or the global resource properties zonepath, autoboot, and pool. If a resource type is specified, display information only about resources of that type. In the resource scope, this subcommand applies only to the resource being added or modified.


In the global scope, remove the specified resource type. You must specify a sufficient number of property name-value pairs for the resource type to be uniquely identified. If no property name-value pairs are specified, all instances will be removed. If more than one exists, a confirmation is required unless the –F option is used.

In the resource scope, remove the specified property name-property value from the current resource.


Revert configuration back to the last committed state.


Applicable only in the global scope. Select the resource of the given type that matches the given property name-property value pair criteria for modification. The scope is changed to that resource type. You must specify a sufficient number of property name-value pairs for the resource to be uniquely identified.


Set a given property name to the given property value. Note that some properties, such as zonepath used in native and solaris10 branded zones, are global, while others are resource specific. Thus, this command is applicable in both the global and resource scopes.


Verify current configuration for correctness. Ensure that all resources have all of their required properties specified. Verify the syntax of any rootzpool resource group and its properties. The accessibility of any storage specified by a URI is not verified.