Go to main content

Creating and Using Oracle® Solaris 10 Zones

Exit Print View

Updated: October 2017

How to Configure an Exclusive-IP solaris10 Branded Zone

You must be the global administrator or a user with the appropriate authorizations in the global zone to perform this procedure.

  1. Become an administrator.

    For more information, see Assigning Rights to Non-Root Users to Manage Zones in Creating and Using Oracle Solaris Zones.

  2. Create an exclusive-IP solaris10 zone with the zone name s10-zone.
    global$ zonecfg -z s10-zone

    If this is the first time you have configured this zone, you will see the following system message:

    Use 'create' to begin configuring a new zone.
  3. Create the new solaris10 zone configuration by using the SYSsolaris10 template.
    zonecfg:s10-zone> create -t SYSsolaris10

    The SYSsolaris10 profile creates an exclusive-IP zone that includes an automatic anet resource by default.

  4. Set the zone path, /zones/s10-zone in this procedure.
    zonecfg:s10-zone> set zonepath=/zones/s10-zone
  5. Set the autoboot value.
    zonecfg:s10-zone> set autoboot=true

    If set to true, the zone is automatically booted when the global zone is booted. The default value is false. Note that for the zones to autoboot, the zones service svc:/system/zones:default must also be enabled. You can enable the zones service with the svcadm command.

  6. Add a ZFS file system shared with the global zone.
    zonecfg:s10-zone> add fs
    1. Set the type to zfs.
      zonecfg:s10-zone:fs> set type=zfs
    2. Set the directory to mount from the global zone.
      zonecfg:s10-zone:fs> set special=share/zone/s10-zone
    3. Specify the mount point.
      zonecfg:s10-zone:fs> set dir=/opt/shared
    4. End the specification.
      zonecfg:s10-zone:fs> end

    This step can be performed more than once to add more than one file system.

  7. Delegate a ZFS dataset named sales in the storage pool tank.
    zonecfg:s10-zone> add dataset
    1. Specify the path to the ZFS dataset sales.
      zonecfg:s10-zone> set name=tank/sales
    2. End the dataset specification.
      zonecfg:s10-zone> end
  8. Set the hostid to be the hostid of the source system.
    zonecfg:s10-zone> set hostid=80f0c086
  9. Verify the zone configuration for the zone.
    zonecfg:s10-zone> verify
  10. Commit the zone configuration for the zone.
    zonecfg:s10-zone> commit
  11. Exit the zonecfg command.
    zonecfg:s10-zone> exit

    Note that even if you did not explicitly type commit at the prompt, a commit is automatically attempted when you type exit or an EOF occurs.

  12. Use the info subcommand to verify that the brand is set to solaris10.
    global$ zonecfg -z s10-zone info
  13. (Optional) Use the info subcommand to check the hostid:
    global$ zonecfg -z s10-zone info hostid

Next Steps

Tip  - After you have configured the zone, it is a good idea to make a copy of the zone's configuration. You can use this backup to recreate the zone in the future. As root or an administrator with the correct profile, print the configuration for the zone s10-zone to a file. This example uses a file named s10-zone.config.
global$ zonecfg -z s10-zone export > s10-zone.config

See Also

For additional components that can be configured using zonecfg, see Chapter 1, Configuration Resources for Non-Global Zones in Oracle Solaris Zones Configuration Resources. This guide also provides information on using the zonecfg command in either command-line or command-file mode. Note that for shared-IP zones, a static address must be assigned in a zonecfg net resource. For more information about adding ZFS file systems, see Adding ZFS File Systems to a Non-Global Zone in Managing ZFS File Systems in Oracle Solaris 11.3.