<chapter id="gchhy"><title>About Branded Zones and the Linux Branded
Zone</title><highlights><para>The branded zones facility in the <trademark>Solaris</trademark> Operating
System is a simple extension of Solaris Zones. This chapter discusses the
branded zones concept and the <literal>lx</literal> brand, which implements
Linux branded zones functionality. Linux branded zones are also known as Solaris
Containers for Linux Applications.</para><note><para>Although you can configure and install branded zones on a <trademark>Trusted Solaris</trademark> system that has labels enabled, you cannot boot
branded zones on this system configuration.</para>
</note>
</highlights><sect1 id="gcxco"><title>About Using Zones on a Solaris System</title><para>See <olink targetptr="zones.intro-1" remap="internal">Chapter&nbsp;16, Introduction to
Solaris Zones</olink> for general information on the use of zones on a Solaris
system.</para><para>You should be familiar with the following zones and resource management
concepts:</para><itemizedlist><listitem><para>The global zone and the non-global zone, described in <olink targetptr="zones.intro-5" remap="internal">How Zones Work</olink></para>
</listitem><listitem><para>The global administrator and the zone administrator, described
in <olink targetptr="zones.intro-11" remap="internal">How Non-Global Zones Are Administered</olink> and <olink targetptr="zones.intro-8" remap="internal">How Non-Global Zones Are Created</olink>.</para>
</listitem><listitem><para>The zone state model, discussed in <olink targetptr="zones.intro-12" remap="internal">Non-Global Zone State Model</olink>.</para>
</listitem><listitem><para>The zone isolation characteristics covered in <olink targetptr="zones.intro-7" remap="internal">Non-Global Zone Characteristics</olink>.</para>
</listitem><listitem><para>Privileges, described in <olink targetptr="z.admin.ov-18" remap="internal">Privileges
in a Non-Global Zone</olink>.</para>
</listitem><listitem><para>Networking, described in <olink targetptr="z.admin.ov-9" remap="internal">Networking
in Shared-IP Non-Global Zones</olink></para>
</listitem><listitem><para>The Solaris Container concept, which is the use of resource
management features, such as resource pools, with zones. The use and interaction
of zones and resource management features are described in <olink targetptr="zones.intro-13" remap="internal">Using Resource Management Features With Non-Global
Zones</olink>, <olink targetptr="z.config.ov-13" remap="internal">Setting Zone-Wide Resource
Controls</olink>, <olink targetptr="z.admin.ov-1" remap="internal">Chapter&nbsp;26, Solaris
Zones Administration (Overview)</olink>, and the individual chapters in Part
1 Resource Management of this manual that document each resource management
feature. For example, resource pools are covered in <olink targetptr="rmpool-1" remap="internal">Chapter&nbsp;12,
Resource Pools (Overview)</olink> and <olink targetptr="rmpool.task-1" remap="internal">Chapter&nbsp;13,
Creating and Administering Resource Pools (Tasks)</olink> </para>
</listitem><listitem><para>The fair share scheduler (FSS), a scheduling class that enables
you to allocate CPU time based on shares, is covered in <olink targetptr="rmfss-1" remap="internal">Chapter&nbsp;8, Fair Share Scheduler (Overview)</olink> and <olink targetptr="rmfss.task-1" remap="internal">Chapter&nbsp;9, Administering the Fair Share Scheduler
(Tasks)</olink>.</para>
</listitem><listitem><para>The resource capping daemon (<literal>rcapd</literal>), which
can be used from the global zone to control resident set size (RSS) usage
of branded zones. The <literal></literal> property of the <literal>zonecfg</literal> <literal>capped-memory</literal> resource sets the <literal>max-rss</literal> for a
zone. This value is enforced by <literal>rcapd</literal><literal></literal> running
in the global zone. For more information, see <olink targetptr="rm.rcapd-1" remap="internal">Chapter&nbsp;10,
Physical Memory Control Using the Resource Capping Daemon (Overview)</olink>, <olink targetptr="rm.rcapd.task-1" remap="internal">Chapter&nbsp;11, Administering the Resource Capping
Daemon (Tasks)</olink> and the <olink targetdoc="group-refman" targetptr="rcapd-1m" remap="external"><citerefentry><refentrytitle>rcapd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</listitem>
</itemizedlist><para>The <olink targetptr="glossary-1" remap="internal">Glossary</olink> provides definitions
for terms used with zones and resource management features.</para><para>Any additional information required to use branded zones on your system
is provided in this part of the guide.</para><note><para>The following chapters in this guide are not applicable to branded
zones:</para><itemizedlist><listitem><para><olink targetptr="z.pkginst.ov-1" remap="internal">Chapter&nbsp;24, About Packages
and Patches on a Solaris System With Zones Installed (Overview)</olink></para>
</listitem><listitem><para><olink targetptr="z.pkginst.task-1" remap="internal">Chapter&nbsp;25, Adding
and Removing Packages and Patches on a Solaris System With Zones Installed
(Tasks)</olink></para>
</listitem>
</itemizedlist>
</note>
</sect1><sect1 id="gcvgi"><title>Branded Zones Technology</title><para>The Solaris Zones
infrastructure is documented in this manual in <olink targetptr="zone" remap="internal">Part&nbsp;II,
Zones</olink>. By default, a non-global zone has the same characteristics
as operating system in the global zone, which is running the Solaris 10 Operating
System or later Solaris 10 release. These <emphasis>native</emphasis> non-global
zones and the global zone share their conformance to standards, runtime behavior,
command sets, and performance traits in common. The branded zone (BrandZ)
framework extends the zones infrastructure to include the creation of brands,
or alternative sets of runtime behaviors. The term <emphasis>brand</emphasis> can
refer to a wide range of operating environments. For example, the  non-global
zone can emulate another version of the Solaris Operating System, or an operating
environment such as Linux. Or, it might augment the native brand behaviors
with additional characteristics or features. Every zone is configured with
an associated brand.</para><para>A brand can provide a simple or a complex environment. For example,
a simple environment could replace the standard Solaris utilities with their
GNU equivalents. A complex environment could provide a complete Linux user
space which supports the execution of Linux applications.</para><para>The brand defines the operating environment that can be installed in
the zone and determines how the system will behave within the zone so that
the non-native software installed in the zone functions correctly. In addition,
a zone's brand is used to identify the correct application type at application
launch time. All branded zone management is performed through extensions to
the native zones structure. Most administration procedures are identical for
all zones.</para><para>You can change the brand of a zone in the <emphasis>configured</emphasis> state.
Once a branded zone has been <emphasis>installed</emphasis>, the brand cannot
be changed or removed.</para><para>BrandZ extends the zones tools in the following ways:</para><itemizedlist><listitem><para>The <command>zonecfg</command> command is used to set a zone's
brand type when the zone is configured.</para>
</listitem><listitem><para>The <command>zoneadm</command> command is used to report a
zone's brand type as well as administer the zone.</para>
</listitem>
</itemizedlist><note><para>You can change the brand of a zone in the configured state. Once
a branded zone has been installed, that brand cannot be changed or removed.</para>
</note><sect2 id="gcvyd"><title>Processes Running in a Branded Zone</title><para>Branded zones provide a set of interposition points in the kernel
that are only applied to processes executing in a branded zone.</para><itemizedlist><listitem><para>These points are found in such paths as the <literal>syscall</literal> path,
the process loading path, and the thread creation path.</para>
</listitem><listitem><para>At each of these points, a brand can choose to supplement
or  replace the standard Solaris behavior.</para>
</listitem>
</itemizedlist><para>A brand can also provide a plug-in library for <literal>librtld_db</literal>.
The plug-in library allows Solaris tools such as the debugger, described in <olink targetdoc="refman" targetptr="mdb-1" remap="external"><citerefentry><refentrytitle>mdb</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>, and DTrace, described in <olink targetdoc="refman" targetptr="dtrace-1m" remap="external"><citerefentry><refentrytitle>dtrace</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>, to access the symbol information
of processes running inside a branded zone.</para>
</sect2><sect2 id="gcvxq"><title>Branded Zone Device Support</title><para>The devices supported by each zone are documented in the man pages
and other documentation for that brand. Device support is defined by the brand.
A brand can choose to disallow the addition of any unsupported or unrecognized
devices.</para>
</sect2><sect2 id="gcycb"><title>Branded Zone File System Support</title><para>The file systems required for a branded zone are defined by the
brand.</para>
</sect2><sect2 id="gcybn"><title>Privileges in a Branded Zone</title><para>The privileges available in a branded zone are defined by the
brand. For more information about privileges, see <olink targetptr="z.admin.ov-18" remap="internal">Privileges in a Non-Global Zone</olink> and <olink targetptr="gcxai" remap="internal">Configurable Privileges in an lx Branded Zone</olink>.</para>
</sect2>
</sect1><sect1><title>About the <literal>lx</literal> Brand</title><para>The <literal>lx</literal> brand
uses the branded zones framework to enable Linux binary applications to run
unmodified on a machine with a Solaris Operating System kernel.</para><para>The machine must have one of the following supported i686 processor
types:</para><itemizedlist><listitem><para>Intel</para><itemizedlist><listitem><para>Pentium Pro</para>
</listitem><listitem><para>Pentium II</para>
</listitem><listitem><para>Pentium III</para>
</listitem><listitem><para>Celeron</para>
</listitem><listitem><para>Xeon</para>
</listitem><listitem><para>Pentium 4</para>
</listitem><listitem><para>Pentium M</para>
</listitem><listitem><para>Pentium D</para>
</listitem><listitem><para>Pentium Extreme Edition</para>
</listitem><listitem><para>Core</para>
</listitem><listitem><para>Core 2</para>
</listitem>
</itemizedlist><para>AMD</para><itemizedlist><listitem><para>Opteron</para>
</listitem><listitem><para>Athlon XP</para>
</listitem><listitem><para>Athlon 64</para>
</listitem><listitem><para>Athlon 64 X2</para>
</listitem><listitem><para>Athlon FX</para>
</listitem><listitem><para>Duron</para>
</listitem><listitem><para>Sempron</para>
</listitem><listitem><para>Turion 64</para>
</listitem><listitem><para>Turion 64 X2</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist><sect2 id="gdlqp"><title>Supported Linux Distributions</title><para>The <literal>lx</literal> brand
includes the tools necessary to install a CentOS 3.<replaceable>x</replaceable> or
Red Hat Enterprise Linux 3.<replaceable>x</replaceable> distribution inside
a non-global zone. Versions 3.5 to 3.8 of each distribution are supported.
The brand supports the execution of  32-bit Linux applications on x86 and
x64  machines running the Solaris system in either 32-bit or 64-bit mode.</para><para>The <literal>lx</literal> brand emulates the system call interfaces
provided by the Linux 2.4.21 kernel, as modified by Red Hat in the RHEL 3.<replaceable>x</replaceable> distributions. This kernel provides the system call interfaces
consumed by the <literal>glibc</literal> version 2.3.2 released by Red Hat.</para><para>In addition, the <literal>lx</literal> brand partially emulates the
Linux <literal>/dev</literal> and <literal>/proc</literal> interfaces.</para><caution><para>Note that you must maintain a supported configuration if you
add packages to an <literal>lx</literal> branded zone. See <olink targetptr="gdrqv" remap="internal">About Maintaining a Supported Configuration</olink> for
more information.</para>
</caution>
</sect2><sect2 id="gdlps"><title>Application Support</title><para>The Solaris system imposes no limit on the number of Linux applications
you can run in an <literal>lx</literal> branded zone. Sufficient memory must
be available. Also see <olink targetptr="gcxax" remap="internal">System and Space Requirements</olink>.</para><para>Regardless of the underlying kernel, only 32-bit Linux applications
are able to run.</para><para>The <literal>lx</literal> zone supports only user-level Linux applications.
You cannot use Linux device drivers, Linux kernel modules, or Linux file systems
from inside an <literal>lx</literal> zone.</para><para>See <ulink url="http://opensolaris.org/os/community/brandz/applications" type="url">Applications tested under the lx brand</ulink> for a list of some
applications that have been successfully run under the <literal>lx</literal> brand.
See <olink targetptr="gdquy" remap="internal">How to Install an Application in an lx Branded
Zone</olink> for an example of installing an application.</para><para>You cannot run Solaris applications inside an <literal>lx</literal> zone.
However, the <literal>lx</literal> zone enables you to use the Solaris system
to develop, test, and deploy Linux applications. For example, you can place
a Linux application in an <literal>lx</literal> zone and analyze it using
Solaris tools run from the global zone. You can then make improvements and
deploy the tuned application on a native Linux system.</para>
</sect2>
</sect1><sect1 id="gcxek"><title>Debugging Tools</title><para>Solaris debugging tools such as DTrace and <literal>mdb</literal> can
be applied to Linux processes executing inside the zone, but the tools themselves
must be running in the global zone. Any core files generated are produced
in the Solaris format and can only be debugged with Solaris tools.</para><para>DTrace is enabled for Linux applications by the DTrace <literal>lxsyscall</literal> dynamic
tracing provider. The provider acts like the DTrace <literal>syscall</literal> provider.
The <literal>lxsyscall</literal> provider provides probes that fire whenever
a thread enters or returns from a Linux system call entry point.</para><para>For more information on debugging options, see the Solaris Dynamic Tracing
Guide, and the <olink targetdoc="refman" targetptr="dtrace-1m" remap="external"><citerefentry><refentrytitle>dtrace</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman" targetptr="mdb-1" remap="external"><citerefentry><refentrytitle>mdb</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man pages. The <olink targetdoc="dynmctrcggd" remap="external"><citetitle remap="book">Solaris Dynamic Tracing Guide</citetitle></olink> describes
the public documented interfaces available for the DTrace facility. The documentation
about the <literal>syscall</literal> provider can be used for the <literal>lxsyscall</literal> provider.</para><note><para>Because NFS is dependent on name services, which are zone specific,
you cannot access any NFS file system that is mounted outside of the current
zone. Thus, you cannot debug NFS-based Linux processes from the global zone.</para>
</note>
</sect1><sect1 id="gdcln"><title>Commands and Other Interfaces</title><para>The
commands identified in the following table provide the primary administrative
interface to the zones facility.</para><table frame="all" id="gdefg"><title>Commands and Other Interfaces Used With <literal>lx</literal> Branded Zones</title><tgroup cols="2" colsep="1" rowsep="1"><colspec colwidth="30*"/><colspec colwidth="70*"/><thead><row><entry><para>Command Reference</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><olink targetdoc="group-refman" targetptr="zlogin-1" remap="external"><citerefentry><refentrytitle>zlogin</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink></para>
</entry><entry><para>Log in to a non-global zone</para>
</entry>
</row><row><entry><para><olink targetdoc="group-refman" targetptr="zoneadm-1m" remap="external"><citerefentry><refentrytitle>zoneadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry><entry><para>Administers zones on a system</para>
</entry>
</row><row><entry><para><olink targetdoc="group-refman" targetptr="zonecfg-1m" remap="external"><citerefentry><refentrytitle>zonecfg</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry><entry><para>Used to set up a zone configuration</para>
</entry>
</row><row><entry><para><olink targetdoc="group-refman" targetptr="getzoneid-3c" remap="external"><citerefentry><refentrytitle>getzoneid</refentrytitle><manvolnum>3C</manvolnum></citerefentry></olink></para>
</entry><entry><para>Used to map between zone ID and name</para>
</entry>
</row><row><entry><para><citerefentry><refentrytitle>brands</refentrytitle><manvolnum>5</manvolnum></citerefentry></para>
</entry><entry><para>Provides description of branded zones facility</para>
</entry>
</row><row><entry><para><citerefentry><refentrytitle>lx</refentrytitle><manvolnum>5</manvolnum></citerefentry></para>
</entry><entry><para>Provides description of Linux branded zones</para>
</entry>
</row><row><entry><para><olink targetdoc="group-refman" targetptr="zones-5" remap="external"><citerefentry><refentrytitle>zones</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink></para>
</entry><entry><para>Provides description of zones facility</para>
</entry>
</row><row><entry><para><citerefentry><refentrytitle>lx_systrace</refentrytitle><manvolnum>7D</manvolnum></citerefentry></para>
</entry><entry><para>DTrace Linux system call tracing provider</para>
</entry>
</row><row><entry><para><olink targetdoc="group-refman" targetptr="zcons-7d" remap="external"><citerefentry><refentrytitle>zcons</refentrytitle><manvolnum>7D</manvolnum></citerefentry></olink></para>
</entry><entry><para>Zone console device driver</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The <command>zoneadmd</command> daemon is the primary process for managing
the zone's virtual platform. The man page for the <command>zoneadmd</command> daemon
is <citerefentry><refentrytitle>zoneadmd</refentrytitle><manvolnum>1M</manvolnum></citerefentry>. The daemon does not constitute a programming interface.</para><note><para><olink targetptr="z.admin.ov-tbl-34" remap="internal">Table&nbsp;26&ndash;5</olink> covers
commands that can be used in the global zone to display information about
all non-global zones, including branded zones. <olink targetptr="gekhm" remap="internal">Table&nbsp;26&ndash;4</olink> covers commands used with the resource capping daemon.</para>
</note>
</sect1><sect1 id="gcxjv"><title>Setting Up <literal>lx</literal> Branded Zones on
Your System (Task Map)</title><para>The following table provides an overview of the tasks that are involved
in setting up <literal>lx</literal> zones on your system for the first time.</para><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Identify each 32&ndash;bit Linux application that you would like to
run in a zone.</para>
</entry><entry><para>Assess the system needs of the application.</para>
</entry><entry><para>Refer to your business goals and to your system documentation if necessary.</para>
</entry>
</row><row><entry><para>Determine how many zones to configure.</para>
</entry><entry><para>Assess:</para><itemizedlist><listitem><para>The number of Linux applications you intend to run.</para>
</listitem><listitem><para>The disk space requirements for Linux branded zones.</para>
</listitem><listitem><para>Whether you need to use a script.</para>
</listitem>
</itemizedlist>
</entry><entry><para>See <olink targetptr="gdlps" remap="internal">Application Support</olink>, <olink targetptr="gcxax" remap="internal">System and Space Requirements</olink>, <olink targetptr="z.conf.start-3" remap="internal">Evaluating the Current System Setup</olink>, <olink targetptr="gdbkd" remap="internal">Script to Configure Multiple lx Branded Zones</olink>.</para>
</entry>
</row><row><entry><para>Determine whether you will use resource pools with your zone to create
a container.</para>
</entry><entry><para>If you are using resource pools, configure the pools before you configure
zones.</para><para>Note that you can add zone-wide resource controls and pool functionality
to a zone quickly by using <literal>zonecfg</literal> properties.</para>
</entry><entry><para>See <olink targetptr="gcziw" remap="internal">How to Configure the lx Branded Zone</olink>, <olink targetptr="rmpool.task-1" remap="internal">Chapter&nbsp;13, Creating and Administering Resource
Pools (Tasks)</olink>.</para>
</entry>
</row><row><entry><para>Perform the preconfiguration tasks.</para>
</entry><entry><para>Determine the zone name and the zone path for each zone. If network
connectivity is required, obtain IP addresses. Determine the scheduling class
for the zone. Determine the set of privileges that processes inside the zone
should be limited to, if the standard default set is not sufficient.</para>
</entry><entry><para>For information on the zone name, zone path, IP addresses, and scheduling
class, see <olink targetptr="gekrh" remap="internal">lx Branded Zone Configuration Components</olink>.
For a listing of default privileges and privileges that can be configured
in a non-global zone, see <olink targetptr="z.admin.ov-18" remap="internal">Privileges in a
Non-Global Zone</olink>.</para><para>For information on resource pool association, see <olink targetptr="zones.intro-5" remap="internal">How Zones Work</olink> and <olink targetptr="gcziw" remap="internal">How
to Configure the lx Branded Zone</olink>.</para>
</entry>
</row><row><entry><para>Develop configurations.</para>
</entry><entry><para>Configure non-global zones.</para>
</entry><entry><para>See <olink targetptr="z.conf.start-85" remap="internal">Configuring, Verifying, and Committing
a Zone</olink> and the <olink targetdoc="group-refman" targetptr="zonecfg-1m" remap="external"><citerefentry><refentrytitle>zonecfg</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</entry>
</row><row><entry><para>As global administrator, verify and install configured zones.</para>
</entry><entry><para>Zones must be verified and installed prior to booting the zone. You
must obtain a Linux distribution before you install a Linux branded zone.</para>
</entry><entry><para>See <olink targetptr="gdbki" remap="internal">Chapter&nbsp;32, About Installing, Booting,
Halting, Cloning, and Uninstalling lx Branded Zones (Overview)</olink> and <olink targetptr="gdduh" remap="internal">Chapter&nbsp;33, Installing, Booting, Halting, Uninstalling
and Cloning lx Branded Zones (Tasks)</olink>.</para>
</entry>
</row><row><entry><para>As global administrator, boot the non-global zones.</para>
</entry><entry><para>Boot each zone to place the zone in the running state.</para>
</entry><entry><para>See <olink targetptr="gdduh" remap="internal">Chapter&nbsp;33, Installing, Booting, Halting,
Uninstalling and Cloning lx Branded Zones (Tasks)</olink>.</para>
</entry>
</row><row><entry><para>Prepare the new zone for production use.</para>
</entry><entry><para>Create user accounts, add additional software, and customize the zone's
configuration using standard Linux system administration tools and methodologies
from within the zone.</para>
</entry><entry><para>Refer to the documentation you use to set up a newly installed machine
and install applications. Special considerations applicable to a system with
zones installed are covered in this guide.</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1>
</chapter>