1. Overview
This document describes:
- How to obtain and install the Solaris™ Express: Community Release required to run a Linux application in a branded non-global zone on your system
- How to configure, install, boot, and log in to the non-global zone that will support the execution of Linux (lx branded) binaries
2. System Requirements
Your machine must be running the Solaris Express: Community Release. The following primary machine considerations are associated with the use of lx branded zones.
- The machine must be either x64 or x86 based.
- Sufficient disk space to hold the files that are unique within each lx zone must be available. The disk space requirements for an lx zone are determined by the size and number of RPMs (Linux packages) that are installed. The lx brand supports only the whole root model, so each installed zone will have its own copy of every file.
There are no limits on how much disk space can be consumed by a zone. The global administrator is responsible for space restriction. The global administrator must ensure that local storage is sufficient to hold a non-global zone's root file system. Even a small uniprocessor system can support a number of zones running simultaneously.
If you intend to install a Linux zone from a standard distribution, whether from CD media or the associated ISO images, please be aware that the lx brand installer currently only supports Red Hat Enterprise Linux 3.x and the equivalent CentOS distributions.
If you intend to install a Linux zone from a filesystem tarball other than the one available on the OpenSolaris site, please be aware that the lx brand emulates the 2.4.21 kernel and glibc 2.3, as modified by Red Hat. Distros based on other versions of either may or may not work.3. Installing the BrandZ Solaris Build Now that BrandZ has integrated into Solaris, this whole section has been obsoleted.
4. Before You Begin the Zone Configuration
This section describes the information you must collect before you can configure a zone, and covers the format of the zonecfg command.
4.1 Determine the Zone Name and Path
You must choose a name and a path for your zone.
The zone name identifies the zone to the configuration utility. The following rules apply to zone names:
- Each zone must have a unique name.
- A zone name is case-sensitive.
- A zone name must begin with an alpha-numeric character.
- The name can contain alpha-numeric characters, underbars (_), hyphens (-), and periods (.).
- The name cannot be longer than 64 characters.
- The name global and all names beginning with SUNW are reserved and cannot be used.
The zonepath property is the path to the zone root. The system creates the directory with the correct permissions.
4.2 Obtain the Network Address
Each zone that requires network connectivity has one or more unique IP addresses. You must assign an IPv4 address or manually configure and assign an IPv6 address for the zone.
The IP address must be specified in the slash format. For example, for an address of 10.6.10.233 with a netmask of 255.255.255.0, you would specify the address as 10.6.10.233/24.
4.3 About Using the zonecfg Command
The zonecfg command is used to create the zone configuration.
The zonecfg prompt is of the following form:
zonecfg:zonename>
When you are configuring a specific resource type, such as a network interface resource, that resource type is also included in the prompt:
zonecfg:zonename:net>
5. How to Configure the lx Branded Zone
You must be the global administrator in the global zone to perform this procedure. Note that steps 5-8 are optional. These steps only need to be performed if you want to add a network interface to the zone.
Steps
- Become superuser, or assume the Primary Administrator role.
- Set up a zone configuration with the zone name you have chosen.
The name myzone is used in this example procedure.
global# **zonecfg -z myzone**
If this is the first time you have configured this zone, you will see the following system message:
myzone: No such zone configured Use 'create' to begin configuring a new zone.
- Create the new zone configuration for the lx zone.
zonecfg:my-zone> **create -t SUNWlx**
- Set the zone path, /export/my-zone_root in this procedure.
zonecfg:myzone> **set zonepath=/export/myzone_root**
- (Optional) Configure a network device in the zone.
1* Add a network virtual interface.
zonecfg:myzone> **add net**
1* Set the address in the form < ip address of zone>/<netmask>. In this procedure, 10.6.10.233/24 is used.
zonecfg:myzone:net> **set address=****10.6.10.233/24**
1* Set the physical device type for the network interface, the bge device in this procedure.
zonecfg:myzone:net> **set physical=bge0**
1* End the net specification.
zonecfg:myzone:net> **end**
- (Optional) Enable the audio device in the zone. (NOTE: this requires that a working audio device be present in the global zone.)
zonecfg:myzone> **add attr**
zonecfg:myzone:attr> **set name="audio"**
zonecfg:myzone:attr> **set type=boolean**
zonecfg:myzone:attr> **set value=true**
zonecfg:myzone:attr> **end**
- Commit the zone configuration for the zone.
zonecfg:myzone> **commit**
- Exit the zonecfg command.
zonecfg:myzone:net> **exit**
Note that even if you did not explicitly type commit at the prompt, a commit is automatically attempted when you type exit or an EOF occurs.
Tip: The zonecfg command also supports multiple subcommands, quoted and separated by semicolons, from the same shell invocation. Type as one line.
global# **zonecfg -z myzone "create -t SUNWlx; set zonepath=/export/myzone_root"**
6. How to Install the lx Zone
You must be the global administrator in the global zone to perform this procedure.
Steps
- Become superuser, or assume the Primary Administrator role.
- If you intend to install from CD, you must 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
- Install the zone using one of the following methods. Note that if the -d option is not specified, a CD installation is performed by default.
1* Install the zone from a tarball:
global# **zoneadm -z myzone install -d **//<path to tarball>//
A tarball based on the CentOS Linux distribution is available on the OpenSolaris website in http://opensolaris.org/os/community/brandz/downloads.
1* Install the zone from Red Hat or CentOS CDs, for example, /cdrom/cdrom0:
global# **zoneadm -z myzone install -d** **/cdrom/cdrom0**
1* Install the zone from ISO images of Red Hat or CentOS install media:
global# **zoneadm -z myzone install -d** //<path to directory containing ISO images>//
You will see system messages as the non-global zone is installed.
Note: When installing from CD or ISO images, you can install a subset of the packages available on the install media. The available subsets are: core, server, desktop, developer, and all. Each cluster in this list includes the packages in all previous clusters. So, the 'desktop' cluster includes everything in 'core' and 'server', as well as the packages useful for a developer.
For example, to install the server packages, type:
global# **zoneadm -z myzone install -d** //<install path>// **server**
- Verify the status of the zone.
global# **zoneadm list -iv**
You will see a display similar to the following:
ID NAME STATUS PATH BRAND
0 global running / native
1 myzone installed /export/zones/myzone lx
7. How to Boot the lx Zone
You must be the global administrator in the global zone to perform this procedure.
Steps
- Become superuser, or assume the Primary Administrator role.
- Boot the zone.
global# **zoneadm -z myzone boot**
- Verify the status of the zone.
global# **zoneadm list -iv**
You will see a display similar to the following:
ID NAME STATUS PATH BRAND
0 global running / native
1 myzone running /export/zones/myzone lx
8. How to Log In to the lx Zone
You must be the global administrator in the global zone to perform this procedure.
Steps
- Become superuser, or assume the Primary Administrator role.
- Log in to the zone myzone.
global# **zlogin myzone**
You will see a display similar to the following:
[Connected to zone 'myzone' pts/2] You have mail. #
- Verify that you are running in a Linux environment under Solaris.
[root@myzone root]# **uname -a**
You will see a display similar to the following:
Linux myzone 2.4.21 BrandZ fake linux i686 i686 i386 GNU/Linux
- To exit the zone, type:
# **exit**
You will see a display similar to the following:
[Connection to zone 'myzone' pts/2 closed]
9. How to Enable Networking in an lx Zone
When you install an lx branded zone, networking is disabled. To enable networking, edit the /etc/sysconfig/network file in the zone as follows:
NETWORKING=yes HOSTNAME=//<hostname>//
To set up a NIS domain, add a line similar to the following:
NISDOMAIN=//<Grp.South.Sun.COM>//
If you are not using NIS, modify the /etc/nsswitch.conf file to use files or the DNS naming services for hostname lookups.