System Administration Guide: Virtualization Using the Solaris Operating System

Installing and Booting lx Branded Zones

Use the zoneadm command described in the zoneadm(1M) man page to perform installation tasks for a non-global zone.

ProcedureHow to Obtain the Linux Archives

Before you can install the lx branded zone, you must first obtain the Linux archives. The archives are distributed in the following forms:

  1. Obtain the Linux distribution using one of the following methods:

ProcedureHow to Install an lx Branded Zone

This procedure is used to install a configured lx branded zone. Once the zone is installed, all software configuration and management has to be done by the zone administrator using Linux tools from inside the zone.

See Example 33–1, Example 33–2, and Example 33–3 for examples of zone installation command lines using the different distribution paths. If you install from discs or from an ISO image, you must specify Sun package cluster categories. See lx Branded Zone Installation Methods for information on package cluster categories.

Note that you can verify a zone prior to installing it. If you skip this procedure, the verification is performed automatically when you install the zone. The procedure is documented in (Optional) How to Verify a Configured Zone Before It Is Installed.

You must be the global administrator in the global zone to perform this procedure.


Note –

In Step 2, if the zonepath is on ZFS, the zoneadm install command automatically creates a ZFS file system (dataset) for the zonepath when the zone is installed. You can block this action by including the -x nodataset parameter.


  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. (Optional) If you intend to install from DVD or CD, enable volfs on your system and verify that it is running.


    global# svcadm enable svc:/system/filesystem/volfs:default
    

    global# svcs | grep volfs
    

    You will see a display similar to the following:


    online  17:30 svc:/system/filesystem/volfs:default
  3. Install the configured zone lx-zone by using the zoneadm command with the install option and the path to the archive.

    • Install the zone, automatically creating a ZFS file system if the zonepath is on ZFS.


      global# zoneadm -z lx-zone install -d archive_path
      

      The system will display:


      A ZFS file system has been created for this zone.
    • Install the zone that has a zonepath on ZFS, but do not automatically create the ZFS file system.


      global# zoneadm -z lx-zone install -x nodataset -d archive_path
      

    You will see various messages as the files and directories needed for the zone's root file system, as well as the package files, are installed under the zone's root path.


    Note –

    If you do not specify archive_path, the default is CD.


  4. (Optional) If an error message is displayed and the zone fails to install, type the following to get the zone state:


    global# zoneadm -z lx-zone list -iv
    
    • If the state is listed as configured, make the corrections specified in the message and try the zoneadm install command again.

    • If the state is listed as incomplete, first execute this command:


      global# zoneadm -z lx-zone uninstall
      

      Then make the corrections specified in the message, and try the zoneadm install command again.

  5. When the installation completes, use the list subcommand with the -i and -v options to list the installed zones and verify the status.


    global# zoneadm list -iv
    

    You will see a display that is similar to the following:


    ID  NAME     STATUS       PATH                           BRAND      IP
     0  global   running      /                              native     shared
     -  lx-zone  installed    /export/home/lx-zone           lx         shared

Example 33–1 Install Command Using a CentOS Compressed tar Archive


global# zoneadm -z lx-zone install -d /export/centos_fs_image.tar.bz2


Example 33–2 Install Command Using CentOS CDs

For CD or DVD installation, volfs must be enabled on your system. You must specify a software cluster package. For example, use development to install a full environment, or type the names of particular clusters. If you do not specify a cluster package, desktop is installed by default. The CD device is /cdrom/cdrom0.


global# zoneadm -z lx-zone install -d /cdrom/cdrom0 development


Example 33–3 Install Command Using CentOS ISO Images

You must specify a software cluster package. Use development to install a full environment, or specify particular clusters. If you do not specify a cluster package, desktop is installed by default. The CentOS ISO images reside in the directory /export/centos_3.7.


global# zoneadm -z lx-zone install -d /export/centos_3.7 development

See Also

For more information on datasets, see Solaris ZFS Administration Guide

Troubleshooting

If a zone installation is interrupted or fails, the zone is left in the incomplete state. Use uninstall -F to reset the zone to the configured state.

ProcedureHow to Install a Subset of the Packages

When installing from CD or ISO images, you can install a subset of the packages on the install media. The available subsets are core, server, desktop, developer, and all.

You must be the global administrator in the global zone to perform this procedure.

  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. Install only the server package:


    global# zoneadm -z lx-zone install -d archive_path server
    

ProcedureHow to Enable Networking in an lx Branded Zone

When you install an lx branded zone, networking is disabled. Use a procedure such as this one to enable networking.

You must be the zone administrator to perform this procedure.

  1. Edit the /etc/sysconfig/network file in the zone.


    NETWORKING=yes
    HOSTNAME=your.hostname
  2. To set up a NIS domain, add a line similar to the following:


    NISDOMAIN=domain.Sun.COM
Configuring Networking and Naming Services

For more information on configuring networking or naming services, consult the documentation for your Linux distribution.

ProcedureHow to Obtain the UUID of an Installed Branded Zone

A universally unique identifier (UUID) is assigned to a zone when it is installed. The UUID can be obtained by using zoneadm with the list subcommand and the -p option. The UUID is the fifth field of the display.

  1. View the UUIDs for zones that have been installed.


    global# zoneadm list -p
    

    You will see a display similar to the following:


    0:global:running:/::native
        1:centos38:running:/zones/centos38:27fabdc8-d8ce-e8aa-9921-ad1ea23ab063:lx

Example 33–4 How to Use the UUID in a Command


global# zoneadm -z lx-zone -u 61901255-35cf-40d6-d501-f37dc84eb504 list -v

If both -u uuid-match and -z zonename are present, the match is done based on the UUID first. If a zone with the specified UUID is found, that zone is used, and the -z parameter is ignored. If no zone with the specified UUID is found, then the system searches by the zone name.


About the UUID

Zones can be uninstalled and reinstalled under the same name with different contents. Zones can also be renamed without the contents being changed. For these reasons, the UUID is a more reliable handle than the zone name.

See Also

For more information, see zoneadm(1M) and libuuid(3LIB).

ProcedureHow to Mark an Installed lx Branded Zone Incomplete

If administrative changes on the system have rendered a zone unusable or inconsistent, it is possible to change the state of an installed zone to incomplete.

You must be the global administrator in the global zone to perform this procedure.

  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. Mark the zone testzone incomplete.


    global# zoneadm -z testzone mark incomplete
    
  3. Use the list subcommand with the -i and -v options to verify the status.


    global# zoneadm list -iv
    

    You will see a display that is similar to the following:


    ID  NAME       STATUS        PATH                   BRAND      IP
    0   global     running       /                       native     shared
    -   testzone   incomplete    /export/home/testzone   lx         shared
Marking a Zone Incomplete

Note –

Marking a zone incomplete is irreversible. The only action that can be taken on a zone marked incomplete is to uninstall the zone and return it to the configured state. See How to Uninstall a Branded Zone.


(Optional) Placing an Installed lxBranded Zone in the Ready State

Transitioning into the ready state prepares the virtual platform to begin running user processes. Zones in the ready state do not have any user processes executing in them.

You can skip this procedure if you want to boot the zone and use it immediately. The transition through the ready state is performed automatically when you boot the zone.

See (Optional) How to Transition the Installed Zone to the Ready State

ProcedureHow to Boot an lx Branded Zone

Booting a zone places the zone in the running state. A zone can be booted from the ready state or from the installed state. A zone in the installed state that is booted transparently transitions through the ready state to the running state. Zone login is allowed for zones in the running state.

You must be the global administrator in the global zone to perform this procedure.


Tip –

Note that you cannot boot an lx branded zone on a Solaris Trusted Extensions system that has labels enabled.


  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. Use the zoneadm command with the -z option, the name of the zone, which is lx-zone, and the boot subcommand to boot the zone.


    global# zoneadm -z lx-zone boot
    
  3. When the boot completes, use the list subcommand with the -v option to verify the status.


    global# zoneadm list -v
    

    You will see a display that is similar to the following:


    ID  NAME     STATUS       PATH                  BRAND      IP
     0  global   running      /                     native     shared
     1  lx-zone  running      /export/home/lx-zone  lx         shared

Example 33–5 Specifying Boot Arguments for Zones

Boot a zone using the -i altinit option:


global# zoneadm -z lx-zone boot -- -i /path/to/process

Troubleshooting

If a message indicating that the system was unable to find the netmask to be used for the IP address specified in the zone's configuration displays, see netmasks Warning Displayed When Booting Zone. Note that the message is only a warning and the command has succeeded.

ProcedureHow to Boot an lx Branded Zone in Single-User Mode

You must be the global administrator in the global zone to perform this procedure.

  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. Boot the zone in single-user mode.


    global# zoneadm -z lx-zone boot -- -s
    

Where to Go From Here

To log in to the zone , see configuration, see Logging In to an lx Branded Zone.