Softpanorama
(slightly skeptical) Open Source Software Educational Society

May the source be with you, but remember the KISS principle ;-)

Google   


Solaris Zones Creation Examples

News

See also

Recommended Links

Example 1

Example 2

History Humor Etc

The following steps that are involved in setting up zones on your system for the first time.

  1. Perform the preconfiguration tasks. Determine zone name z1 and zone path (for example /export/z1), obtain IP address (zone needs to have a unique IP address), determine shared directories and devices for the zone. check resources req:
     
  2. Use the zonecfg Command to Configure, Verify, and Commit a Zone and zonecfg(1M).
     
  3. As root, verify and install configured zones.  Zones must be verified and installed prior to login.
     
  4. As root, log in to the zone to perform the initial internal configuration, including assigning the zone root password. 
     
  5. As root, boot the non-global zone.

Zones can be created using zone manager gui or command line tools:

Notes:
  • This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Some amount of grammar and spelling errors should be expected.
  • The site contain some broken links as it develops like a living tree... Please try to use Google, Open directory, etc. to find a replacement link (see HOWTO search the WEB for details). We would appreciate if you can mail us a correct link.
Google Search
Open directory

Research Index

Old News ;-)

[Mar, 2005] System Administration Guide- Solaris Containers [PDF] -- Jan 2005 update. This is a large old guide (334 pp). Contains an example of zone creation.

Example 1: simple zone using zoneadm

# mkdir -m 700 /export/z1 # -- create zone directory

# zoneadm list -cv
ID NAME             STATUS         PATH
0 global           running        /

# zonecfg -z z1
z1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:z1> create
zonecfg:z1> set zonepath=/export/z1
zonecfg:z1> set autoboot=true
zonecfg:z1> add inherit-pkg-dir
zonecfg:z1:inherit-pkg-dir> set dir=/opt
zonecfg:z1:inherit-pkg-dir> end
zonecfg:z1> add net
zonecfg:z1:net> set address=192.168.1.10
zonecfg:z1:net> set physical=hme0
zonecfg:z1:net> end
zonecfg:z1> add attr
zonecfg:z1:net> set name=comment
zonecfg:z1:net> set type=string
zonecfg:z1:net> set value="First zone"
zonecfg:z1:net> end
zonecfg:z1> verify
zonecfg:z1> commit
zonecfg:z1>exit
At this point file /etc/zones/z1.xml should be created and it is recommended to view it
# zoneadm list -cv
ID NAME             STATUS         PATH
0 global           running        /
- z1           configured     /z1

Example 2:  usage of the info command

It looks like you can add arbitrary number of directories in add inherit-pkg-dir (info command can be invoked either as dialog subcommand or as zonecfg -z z1 info):

zonecfg:zone1> info
zonepath: /zone/z1
autoboot: true
pool:
inherit-pkg-dir:
        dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /sbin
inherit-pkg-dir:
        dir: /usr
inherit-pkg-dir:
        dir: /opt
net:
        address: 192.168.1.10
        physical: hme1

 


Copyright © 1996-2008 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Standard disclaimer: The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

Last modified: March 15, 2008