How to Install and Configure Branded Zone

What is a Branded Zones ?
    Branded zones(BrandZ) provides the framework to create non-global zones that contain non-native
operating environments. This allows individual zones to emulate an OS environment other than the native
one of the global OS. The brand for a zone is set at the time the zone is created, and is implemented with interposition points within the OS kernel that can be used to change the behavior of syscalls, process
loading, thread creation, and other elements. Three brands that have been implemented are Solaris
Containers for Linux Applications, Solaris 8 Containers, and Solaris 9 Containers.


Supported Brands based on architecture
***  Solaris on "SPARC"
        Solaris 8 – full root only
        Solaris 9 – full root only
        Solaris 10 – sparse or full root
        Solaris 11/OpenSolaris – sparse or full root
***  Solaris on "Intel/AMD x86/x64 processors"
        Solaris 10 – sparse or full root
        Solaris 11/OpenSolaris – sparse or full root
***  Linux – full root only
            Recent Intel/AMD chipsets
            CentOS 3.5 to 3.8 or Red Hat Enterprise Linux 3.5 to 3.8
            32-bit applications
            
We will see the procedure to install only Solaris 8 and Solaris 9 branded zones.

Step 1 - Download and Install Container Packages
        Download Solaris 8 or Solaris 9 branded container package from here
        Solaris 8 Containers: s8containers-1_0-06-solaris10-sparc.tar.gz
        Solaris 9 Containers: s9containers-1_0-rr-solaris10-sparc.tar.gz
        
Step 2 - Untar and install the container packages
        Solaris 8
        # gunzip  s8containers-1_0-06-solaris10-sparc.tar.gz                                    
        # tar xvf s8containers-1_0-06-solaris10-sparc.tar
        # pkgadd -d ./s8containers-1_0-06/Product SUNWs8brandr
        # pkgadd -d ./s8containers-1_0-06/Product SUNWs8brandu
        # pkgadd -d ./s8containers-1_0-06/Product SUNWs8p2v
        
        Solaris 9
        # gunzip s9containers-1_0-rr-solaris10-sparc.tar.gz
        # tar xvf s9containers-1_0-rr-solaris10-sparc.tar
        # pkgadd -d ./s9containers-1_0-rr/Product SUNWs9brandk
        # pkgadd -d ./s9containers-1_0-rr/Product SUNWs9brandr
        # pkgadd -d ./s9containers-1_0-rr/Product SUNWs9brandu

Step 3 - Download and Install Container Patches
    Solaris 8
    you can download Solaris 8 patch from here and install it using patchadd
    Solaris 9
    you can download Solaris 9 patch from here and install it using patchadd
    
Step 4 - Create/download flar image
    You can create flar image from an existing Solaris 8 or 9 server using flarcreate command
    or
    Download example solaris 8 or 9 flar images from here (you should have been downloaded this in Install
    package step already ) 

Step 5 - Create branded zones
    # mkdir -p /zones/testzone
    # chmod 700 /zones/testzone
    # zonecfg -z testzone
       testzone: No such zone configured
       Use 'create' to begin configuring a new zone.
    zonecfg:testzone> create -t SUNWsolaris9      # to create solaris9 branded zone
    or
    zonecfg:testzone> create -t SUNWsolaris8     # to create solaris8 branded zone
    zonecfg:testzone> set zonepath=/zones/testzone
    zonecfg:testzone> set autoboot=true
    zonecfg:testzone> add net
    zonecfg:testzone:net> set address=[provide ip here]
    zonecfg:testzone:net> set physical=[provide interface name here]
    zonecfg:testzone:net> end
    zonecfg:testzone> commit
    zonecfg:testzone> exit

Step 6 - Install Branded Zones
    Install the branded zones using  zoneadm command by passing solaris 8 or 9 flar image location
    # zoneadm -z testzone install -u -a /solaris9.flar     
          Log File: /var/tmp/testzone.install.log
            Source:     Installing: This may take several minutes...
    Postprocessing: This may take several minutes...
            Result: Installation completed successfully.
          Log File: /zones/testzone/root/var/log/testzone.install.log
    # zoneadm list -iv
      ID NAME       STATUS   PATH                 BRAND    IP
       0 global           running      /                           native   shared
       - testzone        installed     /zones/testzone     solaris9 shared
    #

Step 7 - Zone Booting
    Bootup the zone using zoneadm boot command and do the initial system configuration
    #zoneadm -z testzone boot
    # zlogin -C testzone
     Select a Language
       0. English
       1. French
       2. German
       3. Italian
       4. Japanese
       5. Korean
       6. Simplified Chinese
       7. Spanish
       8. Swedish
       9. Traditional Chinese
    Please make a choice (0 - 9), or press h or ? for help: 0
    ...
    
    User "~." key press to come out of the zone console

....proceed to configure system kernel, IP addresses and services....