Skip to content

Creating New Zones in Solaris 10⚓︎

  1. Login and sudo to system
  2. list the zones :

    Bash
    1
    zoneadm list –vc
    
  3. Create the new directory under /zones and give the same name of the new zone and change permissions to root access only.

    Bash
    1
    2
    3
    cd /zones
    mkdir  testZone2
    chmod 700
    
  4. Now configure and create new Zone.

    Bash Session
    1
    2
    3
    4
    5
    6
    7
    8
    zonecfg -z testZone2
    zonecfg:testZone2> create
    zonecfg:testZone2> set zonepath=/zones/testZone2
    zonecfg:testZone2> set autoboot=false
    zonecfg:testZone2> add net
    zonecfg:testZone2:net> set address=172.1.1.1/24
    zonecfg:testZone2:net> set physical=bge0
    zonecfg:testZone2:net> end
    
  5. Modify the inherit-pkg-dir

    Add inherited directories as needed, may not be needed.

    Bash Session
    1
    2
    3
    zonecfg:testZone2> add inherit-pkg-dir
    zonecfg:testZone2:inherit-pkg-dir> set dir=/usr/local/bin
    zonecfg:testZone2:inherit-pkg-dir> end
    
  6. Check the configuration

    Bash Session
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    zonecfg:testZone2> info
    zonename: testZone2
    zonepath: /zones/testZone2
    brand: native
    autoboot: false
    bootargs: 
    pool: 
    limitpriv: 
    scheduling-class: 
    ip-type: shared
    inherit-pkg-dir:
      dir: /lib
    inherit-pkg-dir:
      dir: /platform
    inherit-pkg-dir:
      dir: /sbin
    inherit-pkg-dir:
      dir: /usr
    inherit-pkg-dir:
      dir: /usr/local/bin
    net:
      address: 172.18.177.228
      physical: bge0
    
  7. Verify the configuration

    Bash Session
    1
    zonecfg:testZone2> verify
    
  8. Commit the configuration

    Bash Session
    1
    2
    zonecfg:testZone2>commit
    zonecfg:testZone2>exit
    
  9. Check the Zone is configured.

    Bash
    1
    zoneadm list –vc
    
  10. Create Zone.

    Bash
    1
    zoneadm -z testZone2 install
    
  11. Before boot the new Zone make sure to copy the sysidcfg file from jumphost.company.com

    1. scp the file from jumphost.company.com:/ jumpstart/OS/Solaris_10_u5/sysidcfg
    2. mv the file sysidcfg to /zones/testZone2/root/etc
  12. Boot the newZone

    Bash
    1
    zoneadm -z testZone2 boot
    
  13. Login into Zone Console

    Bash
    1
    zlogin -C -e \@ testZone2
    

    This screen asks a few questions. 1. Setup hostname, and asks for confirmation. 2. Name Service information. Select the name service that will be used by this system. 3. Rebooting system to allow for changes to apply. 4. Login in as root and check the zone.

  14. Exit out of Console

    Text Only
    1
    @.
    
  15. Check the zone is running

    Bash
    1
    zoneadm list –vc
    
  16. Halting the Zone

    Bash
    1
    zoneadm -z testZone2 halt
    
  17. Set up DNS for the Zone

    Bash
    1
    2
    3
    cd /etc
    vi resolv.conf
    cp nsswitch.dns nsswitch.conf
    
  18. Copy passwd, shadow, and groups files as needed

  19. Copy home directories, you may need to create /home

    Bash
    1
    mkdir –p /home
    
  20. Create any application specific annotations and adjustments to the zone.

  21. As root, turn off unneeded services:

    Bash
    1
    2
    3
    4
    svcadm disable finger
    svcadm disable telnet
    svcadm disable rlogin
    svcadm disable /network/shell:default