Vous êtes sur la page 1sur 90

Composed May 7, 2008

Getting Started With OpenSolaris 2008.05

Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A.
Part No: 8196394 May 2008

Composed May 7, 2008


Copyright 2008 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. All rights reserved.

Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more U.S. patents or pending patent applications in the U.S. and in other countries. U.S. Government Rights Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. This distribution may include materials developed by third parties. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, the Solaris logo, the Java Coffee Cup logo, docs.sun.com, NetBeans, OpenSolaris, Sun HPC ClusterTools, VirtualBox, Java, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and SunTM Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun's licensees who implement OPEN LOOK GUIs and otherwise comply with Sun's written license agreements. Products covered by and information contained in this publication are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical or biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited. DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright 2008 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. Tous droits rservs.

Sun Microsystems, Inc. dtient les droits de proprit intellectuelle relatifs la technologie incorpore dans le produit qui est dcrit dans ce document. En particulier, et ce sans limitation, ces droits de proprit intellectuelle peuvent inclure un ou plusieurs brevets amricains ou des applications de brevet en attente aux Etats-Unis et dans d'autres pays. Cette distribution peut comprendre des composants dvelopps par des tierces personnes. Certaines composants de ce produit peuvent tre drives du logiciel Berkeley BSD, licencis par l'Universit de Californie. UNIX est une marque dpose aux Etats-Unis et dans d'autres pays; elle est licencie exclusivement par X/Open Company, Ltd. Sun, Sun Microsystems, le logo Sun, le logo Solaris, le logo Java Coffee Cup, docs.sun.com, NetBeans, OpenSolaris, Sun HPC ClusterTools, VirtualBox, Java et Solaris sont des marques de fabrique ou des marques dposes de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. Toutes les marques SPARC sont utilises sous licence et sont des marques de fabrique ou des marques dposes de SPARC International, Inc. aux Etats-Unis et dans d'autres pays. Les produits portant les marques SPARC sont bass sur une architecture dveloppe par Sun Microsystems, Inc. L'interface d'utilisation graphique OPEN LOOK et Sun a t dveloppe par Sun Microsystems, Inc. pour ses utilisateurs et licencis. Sun reconnat les efforts de pionniers de Xerox pour la recherche et le dveloppement du concept des interfaces d'utilisation visuelle ou graphique pour l'industrie de l'informatique. Sun dtient une licence non exclusive de Xerox sur l'interface d'utilisation graphique Xerox, cette licence couvrant galement les licencis de Sun qui mettent en place l'interface d'utilisation graphique OPEN LOOK et qui, en outre, se conforment aux licences crites de Sun. Les produits qui font l'objet de cette publication et les informations qu'il contient sont rgis par la legislation amricaine en matire de contrle des exportations et peuvent tre soumis au droit d'autres pays dans le domaine des exportations et importations. Les utilisations finales, ou utilisateurs finaux, pour des armes nuclaires, des missiles, des armes chimiques ou biologiques ou pour le nuclaire maritime, directement ou indirectement, sont strictement interdites. Les exportations ou rexportations vers des pays sous embargo des Etats-Unis, ou vers des entits figurant sur les listes d'exclusion d'exportation amricaines, y compris, mais de manire non exclusive, la liste de personnes qui font objet d'un ordre de ne pas participer, d'une faon directe ou indirecte, aux exportations des produits ou des services qui sont rgis par la legislation amricaine en matire de contrle des exportations et la liste de ressortissants spcifiquement designs, sont rigoureusement interdites. LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.

080507@19860

Composed May 7, 2008

Contents

Getting Started With OpenSolaris 2008.05 ...................................................................................... 7 Overview of OpenSolaris 2008.05 ........................................................................................................7 Live CD and Installer ......................................................................................................................7 Image Packaging System (IPS) ......................................................................................................9 Upgrading and Managing Your Boot Environments .................................................................9 OpenSolaris Documentation .........................................................................................................9 Roadmap .............................................................................................................................................. 10 System Requirements .......................................................................................................................... 11 Login and Root Specifications ........................................................................................................... 11 How to Troubleshoot OpenSolaris Login ................................................................................. 12 Limitations for the OpenSolaris 2008.05 Release ............................................................................ 13 Using Device Driver Utility Version 1.0 ........................................................................................... 13 Preparing for a Multiboot Environment .......................................................................................... 14 Partitioning a Multiboot System ........................................................................................................ 15 How to Partition a System ........................................................................................................... 15 Installing OpenSolaris 2008.05 .......................................................................................................... 17 How to Install OpenSolaris 2008.05 ........................................................................................... 17 Setting up Your Developer Environment ......................................................................................... 23 Running OpenSolaris Using VirtualBox .......................................................................................... 24 How to Download the OpenSolaris Live CD ............................................................................ 24 How to Download the VirtualBox Application ........................................................................ 25 How to Install VirtualBox on a Windows Machine ................................................................. 25 How to Install VirtualBox on a Linux Machine ........................................................................ 26 How to Install VirtualBox on a Macintosh (Intel) Machine ................................................... 27 How to Set up VirtualBox for Use with OpenSolaris ............................................................... 28 How to Start OpenSolaris 2008.05 Using VirtualBox .............................................................. 29 Installing on a Mac OS X System and Parallels ................................................................................ 30 How to Install When Using Parallels ......................................................................................... 30
3

Composed May 7, 2008 Contents

nwamd(1M) Man Page ........................................................................................................................... 31

Getting Started With the Image Packaging System ...................................................................... 35 IPS Overview ........................................................................................................................................ 36 IPS Commands ............................................................................................................................. 36 Package Manager (IPS GUI) ....................................................................................................... 37 IPS for End Users (Tasks) ................................................................................................................... 37 Installing, Upgrading, and Managing Packages ....................................................................... 37 How to Perform a Dry-Run Installation Inside a New Image ......................................... 39 How to Install a Package ...................................................................................................... 40 How to Verify a Package Installation ................................................................................. 41 How to Search for Packages ................................................................................................. 41 How to Update All Installed Packages ............................................................................... 42 How to Display the State of Packages ................................................................................. 42 How to List the Action Attributes of a Package ................................................................. 43 How to List Information About a Package ........................................................................ 45 How to Uninstall Packages .................................................................................................. 46 How to Add or Update an Authority .................................................................................. 46 How to Remove Authority Configuration ......................................................................... 47 How to Display Authority Information ............................................................................. 47 Installing Developer Software (Tasks) .............................................................................................. 48 How to Install OpenOffice.org ................................................................................................... 48 How to Install NetBeans 6.0.1 ..................................................................................................... 49 How to Install Sun Studio Express 5/08 ..................................................................................... 49 How to Install Sun HPC ClusterTools 7.1 ................................................................................. 50 How to Install Web Stack Tools and UI .................................................................................... 51 How to Install GlassFish Java EE 5 Application Server ............................................................ 52 IPS for Developers (Commands) ...................................................................................................... 53 The Publication Client pkgsend(1) ............................................................................................ 53 Actions in IPS ............................................................................................................................... 55 Overview of the Depot Server pkg.depotd ............................................................................... 58 IPS For Developers (Tasks) ................................................................................................................ 59 How to Create Your Own OpenSolaris Repository Using pkg.depotd(1) Command ........ 60 How to Create Your Own OpenSolaris Repository Using Smf Commands ......................... 60 How to Create and Publish an IPS Package .............................................................................. 61

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Contents

How to Publish SVR4 Packages to Your Repository ................................................................ 63 Further Information ............................................................................................................................ 64 Building JDS on OpenSolaris 2008.05 ....................................................................................... 64 Contributing to IPS ...................................................................................................................... 64 How to File a Bug Report for IPS ................................................................................................ 64 pkg(1) Command Reference ............................................................................................................. 65 Glossary ................................................................................................................................................ 67 NetBeans Packages .............................................................................................................................. 68 Sun Studio Express 5/08 Packages ..................................................................................................... 68 Web Stack Packages ............................................................................................................................ 69

Upgrading and Managing Your Boot Environments ..................................................................... 73 Upgrading a Boot Environment ........................................................................................................ 73 Updating Specific Packages ........................................................................................................ 74 Upgrading from OpenSolaris Preview 2 to OpenSolaris 2008.05 ................................................. 75 Managing Your Boot Environments (Tasks) ................................................................................... 75 Advantages of BE Utility ............................................................................................................. 76 BE Utility Requirements ............................................................................................................. 76 Limitations in Current Release ................................................................................................... 77 How to Create a New BE, Based on the Active BE .................................................................... 77 How to Create a New BE, Based on an Inactive BE .................................................................. 79 How to Create a Snapshot of a BE .............................................................................................. 80 How to Create a BE From an Existing Snapshot ...................................................................... 80 How to Activate an Existing BE .................................................................................................. 81 How to Mount a BE ...................................................................................................................... 81 How to Unmount an Existing BE ............................................................................................... 81 How to Destroy an Existing BE .................................................................................................. 82 How to Rename a Boot Environment ........................................................................................ 83 How to Display Information About Your BE, Snapshots, and Datasets ............................... 83 beadm Command Reference ............................................................................................................... 85 Glossary ................................................................................................................................................ 88

Composed May 7, 2008

Composed May 7, 2008

C H A P T E R

Getting Started With OpenSolaris 2008.05

This Getting Started guide provides instructions for installing and using the OpenSolarisTM 2008.05 release, including the following topics: How to prepare for and to install the OpenSolaris 2008.05 release on your x86 system. See Roadmap. How to run the OpenSolaris 2008.05 release as a VirtualBoxTM guest operating system. See Running OpenSolaris Using VirtualBox. How to install packages and update existing packages on your installed or mounted system, including how to install developer tools such as NetBeansTM 6.0.1, OpenOffice.org, and SunTM Studio Express 5/08. See Image Packaging System Documentation. How to upgrade your boot environment, and how to manage multiple boot environments. See Upgrading and Managing Your Boot Environments.

Overview of OpenSolaris 2008.05


The OpenSolaris 2008.05 release is an OpenSolaris binary distribution. This release provides a Live CD for x86 platforms. This Live CD includes a basic core operating system and GNOME desktop environment, with the option to install the OpenSolaris operating system from the Live CD. Or, you can mount the OpenSolaris OS on a VirtualBox. After the OpenSolaris OS has been mounted or installed, additional packages, including developer tools, can be downloaded to the system by using the Image Packaging System (IPS). A new beadm utility enables you to manage multiple boot environments.

Live CD and Installer


The Live CD boots to a functional GNOME desktop. The desktop includes Firefox, Thunderbird, and other core applications. nwamd(1M) is enabled to automatically manage your network interfaces.
7

Composed May 7, 2008 Overview of OpenSolaris 2008.05

For a general description of the purpose and function of a Live CD, see What is a Live CD? To download the Live CD image, go to the www.opensolaris.com/get site and select a link to download OpenSolaris 2008.05.
Note At this site, you can choose between a complete installation with all available languages,

or a slimmer installation with selected languages and faster installation time. Note the following Live CD options:

You can choose another language for the Live CD. OpenSolaris has language support for more than forty languages. Input and output support for these additional languages can be activated on the Live CD as follows: 1. Log out of the Live CD desktop. 2. Use the Option button on the login screen to choose the desired language. 3. Log in to the Live CD.

If you are prompted to log in to the Live CD, both the user name and password are jack. Root login is not enabled either on the Live CD or on the installed system. You must log in as the user that you created during the installation. After you log in, you can then become superuser to configure the system. Because root is a role, open a terminal window and use the su command to assume the role, or the pfexec sh command to run commands in a privileged shell. The root password for the Live CD is opensolaris. For further information, see Login and Root Specifications on page 11. You can install the OpenSolaris 2008.05 release from the Live CD. Start the installer by selecting the Installer icon on the Live CD desktop. The installer enables an initial installation of the CD's contents to an x86 system. The installed root(/) file system is ZFS.
Caution The installer can perform an initial installation into a Solaris partition or use an

entire disk. Installation overwrites all software and data on the selected target. See the complete installation instructions at Roadmap. To mount the OpenSolaris OS in a VirtualBox, see instructions for Running OpenSolaris Using VirtualBox on page 24. To upgrade an existing OpenSolaris OS, do not use the installer. Instead, see the instructions at Upgrading a Boot Environment on page 73.

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Overview of OpenSolaris 2008.05

Image Packaging System (IPS)


The OpenSolaris 2008.05 release includes the Image Packaging System. With IPS, you can select versioned builds of components to manage or create your own custom OpenSolaris distribution. IPS packages that are not included in the initial installation image, including developer tools such as NetBeans 6.0.1, OpenOffice.org, and Sun Studio Express 5/08, can be downloaded after the installation. IPS commands access packages from network repositories and install them to your image. Both IPS packages and SVR4 packages are supported. For information, see Image Packaging System Documentation. This documentation includes general instructions about IPS and specific instructions that describe how to download developer tools using IPS.

Upgrading and Managing Your Boot Environments


The OpenSolaris 2008.05 release provides new and enhanced tools that enable you to upgrade an existing OpenSolaris system and to manage multiple boot environments (BEs). You can upgrade an installed boot environment by using the Image Packaging System. Use the pkg image-update command to update all installed packages in the current image to the latest available version. In the OpenSolaris 2008.05 release, you can use a new BE utility to create and manage snapshots and clones of your BEs. The BE utility enables you to efficiently manage your boot environments. This new utility is particularly useful for managing multiple OpenSolaris boot environments on a single system. For information, see Upgrading and Managing Your Boot Environments.

OpenSolaris Documentation
For more information about the OpenSolaris environment, see the following sites.
TABLE 11 Resource

Additional Documentation
Topic

Getting Started With OpenSolaris 2008.05 OpenSolaris Documentation Hub

A local copy of this introductory document is available on the Live CD desktop. Highlights key documentation for the OpenSolaris 2008.05 release.

Chapter 1 Getting Started With OpenSolaris 2008.05

Composed May 7, 2008 Roadmap

TABLE 11 Resource

Additional Documentation

(Continued)
Topic

OpenSolaris Documentation Index

Lists complete documentation for all OpenSolaris releases, including documents targeted for developers, system administrators, and end users. Main hub for ZFS documentation in the OpenSolaris community. Main hub for xVM hypervisor documentation in the OpenSolaris community Release Notes for the OpenSolaris 2008.05 release.

ZFS Documentation xVM Documentation Release Notes

Roadmap
With the OpenSolaris 2008.05 release, choose from the following installation options:

To run the OpenSolaris ISO image as a guest in a VirtualBox, see instructions for Running OpenSolaris Using VirtualBox. To install an OpenSolaris guest on a hypervisor, based on the Xen open source project, see Installing OpenSolaris on Xen. For further information about the OpenSolaris xVM hypervisor, see OpenSolaris xVM Documentation. To install the OpenSolaris OS from the Live CD onto your system, use the following installation procedure. Verify that your x86 system meets the System Requirements. Review the Login and Root Specifications and the Limitations for the OpenSolaris 2008.05 release. Verify that you have installed all necessary device drivers by using the Device Driver Utility 1.0. If the OpenSolaris OS will be the only operating system installed on your x86 system, see instructions to Install the OpenSolaris OS. If you will be setting up a multiboot environment, review specifications at Multiboot Environment. a. Back up your system. This step is strongly recommended when repartitioning your system. b. Create a Partition for installing the OpenSolaris OS on your system. If you already have a Solaris fdisk partition on your system, the installation overwrites this partition.

1. Check the requirements and limitations for running the installer on your x86 system:

2. Choose one of the following alternatives:

10

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Login and Root Specifications

c. Install the OpenSolaris OS.

System Requirements
Requirement Description

Memory Disk space Multiboot capability

The minimum requirement is 512 MB. Recommended size is at least 10 GB. If you are installing OpenSolaris on a system that will have more than one OS, use the fdisk command or a third-party partitioning tool to create a new partition or to make adjustments to preexisting partitions. See Create a Partition. For multibooting information about specific operating systems, see Preparing for a Multiboot Environment.

In addition to these system requirements, also review Login and Root Specifications and Limitations for OpenSolaris 2008.05 Release.

Login and Root Specifications


During the OpenSolaris 2008.05 installation, you are prompted to create a user account and a root password for your system. Review the following login, user account, and root specifications.

Root login is not enabled either on the Live CD or on the installed system. You must log in as the user that you created during the installation. After you log in, you can then become superuser to configure the system. Because root is a role, open a terminal window and use the su command to assume the role, or the pfexec sh command to run commands in a privileged shell.
Note If you try to log in to the installed system as root, an error message displays. Click OK and log in as the local user that you created during the installation.

Root is a role per Role-Based Access Control (RBAC) specifications. However, if you do not create a user account during the installation, root is set up as a normal account on the installed system, instead of as a role. This is the only situation where you can log in to the installed system as root without manually changing the role assignment for root. After you install the OpenSolaris 2008.05 release, if you wish to manually change the installed system to permit root logins, remove root as an assigned role for users. Then, type the following at the command line:
11

Chapter 1 Getting Started With OpenSolaris 2008.05

Composed May 7, 2008 Login and Root Specifications

# rolemod -K type=normal root

This command converts root to a normal account.

If you forget the local user name or password that you entered during the installation, you must boot the system into Maintenance Mode as described in How to Troubleshoot OpenSolaris Login.

For additional instructions, see the following resources.


TABLE 12 Resource

RBAC Documentation
Topic

rbac(5) man page RBAC: An Alternative to the Superuser Model Using RBAC (Task Map)

Instructions for Role-Based Access Control Introduction to roles in the OpenSolaris environment Instructions about using existing roles or customizing roles

How to Troubleshoot OpenSolaris Login


If you are unable to login to your installed system, use the following procedure. Boot the system in single user mode. For instructions, see x86: How to Boot a System to Run Level S (Single-User Level).
Note For this release, use the kernel$ line option in the instructions instead of kernel line option.

Optional: To view the existing users and roles, type:


-bash-3.2# cat /etc/user_attr

Optional: To delete a user, type:


-bash-3.2# userdel username

Create the user name that you want.


-bash-3.2# useradd username

Assign a password for the username.


-bash-3.2# passwd username

You will be prompted to enter the password twice.


12 Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Using Device Driver Utility Version 1.0

Assign the root role to that user.


-bash-3.2# usermod -R root username

Type Exit to return to the installed system.

Limitations for the OpenSolaris 2008.05 Release


The OpenSolaris 2008.05 release, has the following limitations:

At this time, the OpenSolaris 2008.05 release is for x86 platforms only. The installer cannot upgrade an existing operating system. The installer can perform an initial installation into Solaris partition or use an entire disk. Installation overwrites all software and data on the selected target. This release does not support JumpStart installations. And, this release does not support Live Upgrade. However, you can upgrade all installed packages on your installed system by using the Image Packaging System. See Upgrading and Managing Your Boot Environments. The entire content of a preexisting Solaris partition is overwritten during the installation. Existing file systems cannot be preserved. The OpenSolaris OS installs a ZFS root file system, not a UFS root file system, on the disk selected during installation. The ZFS pool installed initially consists of the entire Solaris fdisk partition on the selected disk. After the initial installation is complete, you can add additional disks to this pool to create a mirrored pool configuration . For further information, see ZFS Documentation.

Using Device Driver Utility Version 1.0


Device Driver Utility version 1.0 is a tool with a graphical user interface that displays information about the devices installed on your system and their corresponding device driver availability status. This utility checks whether a driver exists in the Image Packaging System (IPS) for devices that do not have an attached driver. Device Driver Utility enables you to install the device drivers from IPS for those devices on your system that do not have an attached driver. Another function of this tool is to submit system configuration information to the OpenSolaris Hardware Compatibility List (HCL). The utility is included in the OpenSolaris 2008.05 release, both on the Live CD and on installed systems. On the Live CD, select the Device Driver Utility icon on the Live CD desktop. You should run the utility prior to installing the OpenSolaris 2008.05 release, in order to find out what drivers are available for your computer's devices. If drivers are missing, they might be available in the IPS repository. If so, the drivers can be downloaded while running the Live CD,
Chapter 1 Getting Started With OpenSolaris 2008.05 13

Composed May 7, 2008 Preparing for a Multiboot Environment

provided there is an active network connection. Any drivers that are downloaded from the IPS repository on the Live CD will also be included in the OpenSolaris OS that is installed from the Live CD. On the installed system, the Device Driver Utility can be started from the System>Administration menu. The DDU finds drivers that are missing on your installed system and downloads these drivers from the IPS repository. Drivers can also be updated from the repository, using the same update process that is used to update other packages. For instructions about how to use the IPS repository, see Image Packaging System Documentation. For further information, refer to the online help in the utility menu. If you have questions, email the support alias, driver-utility-feedback@sun.com.

Preparing for a Multiboot Environment


If you are installing OpenSolaris 2008.05 as part of a multiboot environment, review the following multibooting specifications for various operating systems.
Note If you choose to mount the OpenSolaris OS in a VirtualBox, see the instructions for

Running OpenSolaris Using VirtualBox. If you are installing on a system that is running the Mac OS X, and you have installed Parallels, see Installing on a Mac OS X System and Parallels.
TABLE 13 Existing OS

Multiboot Environments
Description

Windows

If you have Windows installed, and you set up enough space to install the OpenSolaris OS, the installation should be straightforward. All versions of the OpenSolaris OS release use the GRUB bootloader. These OpenSolaris releases recognize Windows and ensure that the Windows partitions remain unchanged by default. When the OpenSolaris installation is finished, the GRUB menu gives you the option to boot either the Windows system or the OpenSolaris system. If you are using VMware, see Getting Started With OpenSolaris Using VMware.

14

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Partitioning a Multiboot System

TABLE 13 Existing OS

Multiboot Environments
Description

(Continued)

Linux, or Windows and Linux

If you have Linux installed, or Linux and Windows installed, and you are currently booting through GRUB, save and print out your /boot/grub/menu.lst GRUB menu file from the Linux system before installing the OpenSolaris OS. You must replace this information in the /boot/grub/menu.lst file when you finish booting. See grub(5) man page.
Note If you are installing the OpenSolaris OS on a multiboot system that also

contains the Linux OS, the Solaris partition must precede the Linux swap partition. Solaris 10 OS The installer cannot be used to multiboot the OpenSolaris OS. However, the installer can be used to replace instances of Solaris 10 1/06 and later, and instances of Solaris Express, in an existing multiboot Solaris system. If you have another OS on an extended partition, the existing extended partition is not changed and is not lost during an OpenSolaris release installation. Existing extended partitions are not visible during the OpenSolaris release installation, but the primary fdisk partition in which the extended partition resides is visible. No data in these partitions is lost due to the installation. The OS on an extended partition is not displayed on the GRUB menu. To update the GRUB menu, see the GRUB overview at x86: Administering the GRUB Bootloader. See also menu.lst file specifics at x86: Booting a Solaris System with GRUB.

Extended Partitions

Partitioning a Multiboot System


The installer uses the open source GRUB bootloader, which supports installing multiple operating systems on one drive. Prior to installing, you need to create a partition for installing the OpenSolaris software. After partitioning and installing the operating systems, one of the operating systems can be deployed by choosing between the different operating systems at boot time.

How to Partition a System


Back up your system! Backing up your system is strongly recommended before repartitioning your hard drive. See the Backing Up the Disk Media Content demo. The G4U open source tool was designed to back up x86based operating systems. This demo provides sample step-by-step instructions for using the G4U open source tool to backup a system that has Windows XP installed on it.

Chapter 1 Getting Started With OpenSolaris 2008.05

15

Composed May 7, 2008 Partitioning a Multiboot System

Create a partition on your hard drive for installing the OpenSolaris OS. If you are installing OpenSolaris on a system that will have more than one OS, use the fdisk command or a third-party partitioning tool to create a new partition or to make adjustments to preexisting partitions. Choose one of the following options:

Use the fdisk command to create or modify a Solaris fdisk partition. For instructions, see x86: How to Create a Solaris fdisk Partition. See, also, the fdisk(1M) man page.
Note The OpenSolaris 2008.05 installer automatically creates a swap slice within the fdisk partition that you set up.

Use commercial products or open-source tools to partition your hard drive. GParted is an open-source tool for disk partitioning. The ISO image for the GParted tool can be downloaded from the GParted web site. Use this download to burn a CD that includes the GParted tool. See the dual-boot partitioning video. This video provides sample step-by-step instructions that explain how to shrink a Windows XP system in order to make room for a Linux swap partition. Linux-swap is the same partition ID that Solaris uses. During the installation, in the disk partitioning step, you can change this Linux-swap partition to a Solaris partition.

Use the installer to install the OpenSolaris OS to the Solaris fdisk partition as described in the next section. The demos that are referenced in this section show you how to partition a system that has Windows XP installed on it. See Backing Up the Disk Media Content and dual-boot partitioning. Additional sample instructions are posted in the OpenSolaris community for the following dual-boot procedures:

See Also

OpenSolaris with MacOS on MacBook Pro OpenSolaris and Ubuntu Linux Dual-Boot Installation Instructions OpenSolaris and Microsoft Vista Dual-Boot Installation Instructions

16

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Installing OpenSolaris 2008.05

Installing OpenSolaris 2008.05


This release provides an initial installation of the OpenSolaris OS from the Live CD. An existing Solaris fdisk partition is overwritten during the initial installation. Review the Release Notes for this release. Use the following procedure for most installations. However, if you are installing on a system that is running the Mac OS X, and you have installed Parallels, see Installing on a Mac OS X System and Parallels. If you are using VMware, see Getting Started With OpenSolaris Using VMware. To install an OpenSolaris guest on a hypervisor, based on the Xen open source project, see Installing OpenSolaris on Xen. For further information about the OpenSolaris xVM hypervisor, see OpenSolaris xVM Documentation.

Before You Begin

How to Install OpenSolaris 2008.05


Before installing the OpenSolaris OS, review the system requirements and limitations described in the preceding sections of this document. Review, also, the
Note Before you install the OpenSolaris OS on a system that is running the Linux OS, save a

copy of the menu.lst file. The contents of the GRUB menu.lst file dictate what is displayed in the GRUB menu when you boot the system. You will need to update the GRUB menu after the installation. For further information, see menu.lst file specifics at x86: Booting a Solaris System with GRUB. The following default settings are used for this release.

The installation uses a previously created Solaris fdisk partition to create a ZFS storage pool. If a second disk is available, you can add a second disk to the ZFS pool to create a mirrored configuration. This release installs an OpenSolaris system that is automatically networked by using DHCP with DNS name resolution. The nwamd daemon is enabled by default. nwamd introduces an alternate instance of the network or physical SMF service that enables automated network configuration. For further information, see the man page at nwamd(1M). The nwamd(1M) man page provides instructions about how to disable or enable the network/physical:nwam instance.

IPv6 is disabled. The DNS domain and server IP addresses are retrieved from the DHCP server.
17

Chapter 1 Getting Started With OpenSolaris 2008.05

Composed May 7, 2008 Installing OpenSolaris 2008.05

The NFSv4 domain is dynamically derived. Kerberos is disabled.

To start the installer from the Live CD desktop, select the Installer icon on the Live CD desktop.
Note If you are prompted to log in to the Live CD, both the user name and password are jack. The root password is opensolaris.

A text prompt enables you to select an installer language before the installer begins. The default language is English. The installer begins.
2

Complete any additional selections in the preliminary installation panels. Note the following important considerations:

The installation overwrites the whole disk layout if one of the following is true:

The disk table cannot be read. The disk was not previously partitioned.

If an existing Solaris fdisk partition is on a multiboot system, and the user makes no modifications to the existing partitions, the installation overwrites the Solaris fdisk partition only. Other existing partitions are not changed.

In the Disk panel, select disk and partition location for the OpenSolaris OS. a. In the top portion of the Disk panel, select the disk where the OpenSolaris OS will be installed. The top portion of this panel displays the internal disks, external disks, and solid-state drives that are available on the system. This panel also displays the size of each disk in gigabytes.
Note To be recognized by the installer, the disks and solid-state drives must be plugged in before the installer begins.

The recommended size and minimum size for the OpenSolaris OS installation are displayed. Disks that are too small for a successful installation are labeled as such. The recommended size is at least 10 Gbytes. b. In the bottom portion of the Disk panel, click to either Use the whole disk or Partition the disk. The bottom portion of this panel displays the existing disk partitioning.

18

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Installing OpenSolaris 2008.05

Caution If the existing partition table cannot be read, a warning is displayed, and the panel

displays proposed partitioning. In this case, all data on the disk is destroyed.

If you choose to partition the disk, review the following partitioning guidelines, then revise the partitioning panel settings as needed.

Only one Solaris partition is allowed. If an existing Solaris partition is available, that Solaris partition will be the target for the installation. Or, if you do not have an existing Solaris partition, you can change any existing partition to a Solaris partition. You can resize existing partitions, delete partitions, and create new partitions in this panel. For this option, one existing Solaris partition must be available as the target for the installation.
Caution The partitions are displayed in physically sequential order as they are laid out on the disk. Resizing a Solaris partition destroys the data on that partition and all physically subsequent partitions. Existing data is not moved to conform to a new partition layout. However, resizing the last partition or appending a new partition does not affect the data that already exists in other partitions. Non-Solaris partitions cannot be resized.

Caution To make additional space available, you can change an existing partition to Unused. However, if you change an existing partition to Unused, all subsequent non-Solaris partitions are also changed to Unused.

Caution New partitions can only use the available space that follows the last defined partition. The installer cannot utilize unallocated chunks of space between existing defined partitions. Use the fdisk(1M) command to create new partitions that use the free space between exiting partitions.

If you used a third-party partitioning tool such as GParted, then the Disk panel displays a partition named Linux-swap on which you can install the OpenSolaris OS.
Note In this panel, use the drop-down list for the Linux-swap partition name to change the partition name to Solaris.

Chapter 1 Getting Started With OpenSolaris 2008.05

19

Composed May 7, 2008 Installing OpenSolaris 2008.05

Note Manual control of the OpenSolaris file system layout is not supported. During the installation, the Solaris fdisk partition is reformatted with a default ZFS file system layout. All existing file systems on the Solaris partition are destroyed.

The installation uses a Solaris fdisk partition to create a ZFS storage pool. If a second disk is available, you can, after the installed system has been booted, add a second disk to the ZFS pool to create a mirrored configuration. To create a mirrored configuration, use the ZFS attach command to add a second disk to the storage pool. For example:
# zpool attach rpool c0t2d0s0 c0t4d0s0

The following example illustrates a ZFS file system setup with a non-redundant configuration:
# zpool pool: state: scrub: config: status rpool ONLINE none requested

NAME rpool mirror c0t2d0s0 c0t4d0s0

STATE ONLINE ONLINE ONLINE ONLINE

READ WRITE CKSUM 0 0 0 0 0 0 0 0 0 0 0 0

errors: No known data errors

In the same panel, you can choose instead to install the OpenSolaris OS on the whole disk.
Caution This option erases the existing disk. The entire disk is overwritten with the new OpenSolaris OS.

When you have revised the partitioning as needed, click Next.

20

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Installing OpenSolaris 2008.05

Complete time zone, date, and time settings. The next panel enables you to type the correct time zone, date, and time for the system to be installed. The top half of the panel displays a world map with major cities marked. The bottom half of the panel provides drop-down selections. You can choose the time zone either from the map or from the drop-down list.

If you select the time zone from the map, click on a city or click anywhere on the map. If you click on the map, but not on a city, the map automatically magnifies that area. You can click on a location within that magnified area. You can drag the cursor to move the magnified area to a different location on the map. When you select a site on the map, the drop-down selections automatically populate with the time zone, date, and current time for that map selection. You can right-click to deselect magnification.

Instead of using the map, you can make your selections in the drop-down fields. Select your region, then select Location. Finally, select time zone. The options for each drop-down are determined by the selection made in the prior drop-down.

Note You can edit the default date and time that is provided.

When the settings are correct, click Next.


5

Select language and locale, then click Next. The next panel enables you to select a language and locale. These selections determine the language support, the default date and time, and other data formats for the installed system.

You can accept the default language selection or change the selection. A language selection is required. You can select no default language support. The language chosen automatically determines the available locales in the drop-down box. Only one locale can be selected.

Note Anytime that you log in to the installed system, you can change either the locale for that

particular session or the default locale by using the Options button in the Login dialog box.
6

Complete the user settings and click Next. Review the following guidelines:

Root login is not enabled either on the Live CD or on the installed system. You must log in as the user that you create in this panel. After you log in, you can then become superuser to configure the system.

Chapter 1 Getting Started With OpenSolaris 2008.05

21

Composed May 7, 2008 Installing OpenSolaris 2008.05

Note If you do not create a user account in this panel, root is set up as a normal account on

the installed system, instead of as a role. This is the only situation where you can log in to the installed system as root. For further information, see Login and Root Specifications on page 11.

Both the root password and user account are optional. However, for better security, do complete these fields. If the root password is not defined, a reminder is displayed when you click Next. If you do not want to define a root password, you can proceed.

A user account requires only a Login name for the account to be valid. For better security, however, do complete all fields. If the user account information is not valid, a reminder is displayed when you click Next. If you do not want to define a user account, you can proceed.

Type a computer name or accept the default. The computer name field cannot be blank.

In the Install panel, review and confirm installation specifications.


Caution The installation begins when you click Install. Do not interrupt an installation in progress.

During the installation, a progress bar is displayed. The final panel displays completion messages. You can review the installation log in this panel. You can either quit or reboot from this panel.

After a successful installation, to start the installed system, select Reboot. The reboot process might take a few minutes.
Note Eject the Live CD as the next boot begins. Or, select the "Boot from Hard Disk" option on the GRUB menu.

To exit, select Quit and shut down your system.

22

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Setting up Your Developer Environment

Next Steps

After you have installed the OpenSolaris OS, complete the following optional tasks.

After you have installed the OpenSolaris OS, if you have another operating system on your system, you might need to update the GRUB menu. The GRUB menu displays a list of operating systems that can be booted. Solaris and Windows operating systems are displayed automatically on the GRUB menu. The contents of the GRUB menu.lst file dictate what is displayed in the GRUB menu when you boot the system. If you have an additional OpenSolaris OS or a Linux OS that is not displayed on the menu, you need to edit the GRUB menu.lst file. For further information, see menu.lst file specifics at x86: Booting a Solaris System with GRUB. If you are unable to log in to your installed system, or if you want to customize the roles that were set up during the installation, see Login and Root Specifications on page 11.

If you want to add software to your installed operating system, you can use the tools that are included in the OpenSolaris 2008.05 release.

The OpenSolaris OS includes the Image Packaging System. With IPS, you can select versioned builds of components to manage or create your own custom OpenSolaris distribution. IPS packages that are not included in the initial installation image, such as developer tools, can be downloaded after the installation. IPS commands access packages from the network repositories. Both IPS packages and SVR4 packages are supported. Image Packaging System Documentation contains man pages and a Getting Started guide.

The OpenSolaris 2008.05 release provides new and enhanced tools that enable you to upgrade an existing OpenSolaris system and to manage multiple boot environments. You can upgrade an installed boot environment (BE) by using the Image Packaging System. Use the pkg image-update command to update all installed packages in the current image to the latest available version. In the OpenSolaris 2008.05 release, you can use a new BE utility to create and manage snapshots and clones of your BEs. The BE utility enables you to effectively manage multiple OpenSolaris boot environments on a single system. For information, see Upgrading and Managing Your Boot Environments.

Setting up Your Developer Environment


After you have installed the OpenSolaris 2008.05 release, you can add developer tools and other applications such as NetBeans 6.0.1, OpenOffice.org, and Sun Studio Express 5/08 to your environment. Download these tools by using the Image Packaging System commands as described in Installing Developer Software (Tasks) on page 48.

Chapter 1 Getting Started With OpenSolaris 2008.05

23

Composed May 7, 2008 Running OpenSolaris Using VirtualBox

Running OpenSolaris Using VirtualBox


The VirtualBox runs as an application in your operating system, providing an environment, called a virtual machine, which enables you to install other operating systems as guests inside the virtual machine. The VirtualBox software supports the following host operating systems:

Windows

Windows 2000 Service Pack 3 at minimum Windows XP All service packs Windows Server 2003 Windows Vista 32-bit and 64-bit Debian GNU/Linux 3.1 at minimum Fedore Core 4 at minimum Gentoo Linux Redhat Enterprise Linux 3 at minimum SuSE Linux 9 at minimum OpenSuSE 10.1 at minimum Ubuntu 5.10 at minimum Mandriva 2007.1 and 2008.0

Linux on 32-bit and 64-bit systems


Apple Mac OS X (Intel)

Use these steps to set up OpenSolaris in VirtualBox: 1. 2. 3. 4. Download the OpenSolaris ISO image. Download and install VirtualBox. Set up VirtualBox for OpenSolaris. Start OpenSolaris inside VirtualBox.

After the VirtualBox software is successfully installed on your machine, you can run the OpenSolaris ISO image as a virtual guest. You do not need to burn a DVD.

Before You Begin 1 2


24

How to Download the OpenSolaris Live CD


The Live CD image requires about 647 Mbytes on your hard drive. Go to www.opensolaris.com/get site. Select a link to download OpenSolaris 2008.05.
Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Running OpenSolaris Using VirtualBox

Note At this site, you can choose between a complete installation with all available languages,

or a slimmer installation with selected languages and faster installation time.


3

Save the Live CD image to a location on your machine. Depending on the speed of your Internet connection, the download takes several minutes.

How to Download the VirtualBox Application


VirtualBox is available at the Sun Download Center. Go to the Downloading VirtualBox and select the VirtualBox Binaries option. Select the platform for your machine from the drop-down menu. Mark acceptance of the license agreement and click Continue. Click the link for virtualbox_1.6. Alternatively, you can use the Sun Download Manager.
Note The Mac OS X version is now 1.6.

1 2 3 4

5 6

Save the file to your local disk. When the download is complete, close the browser.

How to Install VirtualBox on a Windows Machine


Navigate to the downloaded VirtualBox installation file. On Windows, the default location is your desktop. To start the installation, double-click the VirtualBox installation file and click Next on the pop-up window. Accept the license agreement and click Next. In the pop-up window, choose a location for the VirtualBox software.

3 4

Accept the default location, C:\Program Files\Sun\VirtualBox\. Or click the Browse button and type your preferred location.
25

Chapter 1 Getting Started With OpenSolaris 2008.05

Composed May 7, 2008 Running OpenSolaris Using VirtualBox

Then click Next.


5 6

Click the Install button. When the completion message is displayed, click Finish.

How to Install VirtualBox on a Linux Machine


Note Download the latest version of VirtualBox as described previously even if your Linux distribution comes with a VirtualBox version preinstalled. The preinstalled VirtualBox software is usually the Open Source Edition (OSE), which might not be suitable for running the OpenSolaris 2008.05 release.

1 2 3

Open a terminal window and become root. Navigate to the downloaded VirtualBox installation file. Depending on your Linux distribution, start the installation process by using one of the following commands:

On rpm-based systems, such as Fedora, SuSE, or Red Hat, type the following:
rpm -ihv filename

Replace filename with the name of the downloaded installation file.

On deb-based systems, like Debian, or Ubuntu, type the following:


dpkg -i filename

Replace filename with the name of the downloaded installation file.


Note You might need to install additional packages to fulfill dependencies.

The installer searches for a precompiled kernel module. If no kernel module is available that is precompiled for your system, the installer attempts to compile and install a kernel module.

26

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Running OpenSolaris Using VirtualBox

Note You need to have basic build utilities, such as gcc, make, binutils, and kernel header, installed for the installer to be able to build the kernel module. Usually, these utilities are part of the standard installation of your Linux system. If these utilities are not present, the installer will be unable to build the kernel module. In this case, install the build utilities and manually start the kernel module compilation later by running /etc/init.d vboxdrv setup as root. 4

Add the current user to the vboxusers group. a. In a terminal window, type:
sudo usermod -G vboxusers -a username

Replace username with the name of the current user. b. Log out and log in again to apply the changes.
5 6

Open a terminal window, type VirtualBox, and press Enter to start the VirtualBox. Accept the license agreement.

How to Install VirtualBox on a Macintosh (Intel) Machine


Navigate to and mount the downloaded VirtualBox .dmg disk image file. To start the installation, double-click the VirtualBox .mpkg file and click Continue. Accept the license agreement and click Continue. Select the destination volume and click Continue Click Install to install VirtualBox in the default Applications folder, or click Change Install Location to install in another location. Enter your user password. When the completion message displays, click Close.

1 2 3 4 5

6 7

Chapter 1 Getting Started With OpenSolaris 2008.05

27

Composed May 7, 2008 Running OpenSolaris Using VirtualBox

How to Set up VirtualBox for Use with OpenSolaris


Start VirtualBox by using one of the following steps:

On Windows, click the Start button, and select VirtualBox from the list of programs. On Linux, open a terminal window, type VirtualBox, and press Enter. On Mac OS X, open Applications in the Finder and double-click VirtualBox.

On the first start of VirtualBox, type your registration information and click Confirm. The main VirtualBox window appears. Click the New icon on the left side of the GUI, and click Next in the pop-up window. Type a name for your virtual machine, and select Solaris as the operating system, from the drop-down list. Click Next. Select the amount of RAM to allocate to the OpenSolaris installation inside VirtualBox. Click Next.
Note 512 Mbytes is the recommended minimum size. If you have 2 Gbytes or more of memory on your machine, you should choose 1 Gbytes for optimum performance. See the substep C in the following step.

3 4

Add a Virtual Disk Image (vdi) by selecting a name or adding a new name to the list. For the initial installation, follow these substeps: a. Select New and click Next. b. Accept the default Dynamically Expanding Image and click Next. c. Accept the default name, or type a path and name, and allocate space for the image. d. When you've completed the settings, click Next. e. Click Finish to create the disk image.

7 8

When the initial Virtual Disk Manager GUI appears with your new vdi file selected, click Next. Review the Summary GUI and Click Finish. The main VirtualBox window appears. Your virtual OpenSolaris machine is displayed in the left panel, and is ready to use as a virtual machine.
Getting Started With OpenSolaris 2008.05 May 2008

28

Composed May 7, 2008 Running OpenSolaris Using VirtualBox

9 10 11

Click the CD/DVD-ROM link on the right-hand side, in the Details tab. Check Mount CD/DVD Drive and select ISO Image File. In the drop-down list, select the downloaded OpenSolaris ISO image. If the ISO image is not in the list, add the image as follows: a. Click the Select icon in the right of the drop-down list. b. Click the CD/DVD Images tab. c. Click the Add icon. d. Navigate to the downloaded OpenSolaris ISO image file and click Open. e. Click Select and close the Settings screen.

How to Start OpenSolaris 2008.05 Using VirtualBox


Start VirtualBox by using one of the following options:

On Windows, click the Start button and select VirtualBox from the list of programs. On Linux, select VirtualBox from the System Tools menu (GNOME desktop) or from the System menu (KDE desktop). On Mac OS X, open Applications in the Finder and double-click VirtualBox.

Double-click your virtual machine icon or select it and click Start.


Caution Unless you have the ISO on a CD, click the CD/DVD-ROM link and verify that the

OpenSolaris ISO image file is selected. The GRUB boot menu with three options is displayed. Then a SunOS Release message is displayed. Finally, a list of languages appears.
3

When the list of keyboard layouts appears, type the number for your keyboard layout. For example, type 41 for US-English. Then press Enter.

Chapter 1 Getting Started With OpenSolaris 2008.05

29

Composed May 7, 2008 Installing on a Mac OS X System and Parallels

Note When you click inside the VirtualBox window with your virtual machine running, the mouse cursor is trapped inside the virtual desktop. Use the Host Key to release the mouse cursor again. The Host Key is indicated at the lower right corner of the VirtualBox window. By default, the Host Key is the right Ctrl key on Windows and Linux, and the left Cmd key on Mac OS X. 4 5

Select the language for the desktop and press Enter. Review and close the licensing agreement. When the desktop screen appears, you are in the box and running OpenSolaris 2008.05 in Live CD mode. To install OpenSolaris 2008.05 on your virtual hard disk, click the Install OpenSolaris icon on the desktop. See Installing OpenSolaris 2008.05 on page 17 for installation instructions. The following resources provide supplemental information about how to use OpenSolaris in a VirtualBox environment. OpenSolaris VirtualBox on MacOS See the following blog for specific instructions for setting up an OpenSolaris OS in a VirtualBox on Ubuntu.

See Also

Install VirtualBox on Ubuntu 7.04 Getting Started With Indiana on Ubunto 7.04 and VirtualBox Installing Indiana on Ubuntu 7.04 using VirtualBox

Installing on a Mac OS X System and Parallels


If you are installing on a system and are running the Mac OS X and have installed Parallels, use the following procedure to install an OpenSolaris OS.

Before You Begin

How to Install When Using Parallels


See Solaris Network Driver Installation instructions in the Parallels Desktop for Mac User Guide. During the Parallels pseudo environment setup, set the networking choice to Ethernet bridge. Using Parallels, boot the Live CD.
Getting Started With OpenSolaris 2008.05 May 2008

1 2
30

Composed May 7, 2008 nwamd(1M) Man Page

Continue the installation of the OpenSolaris OS. For installation instructions, see Slim Install Documentation.

After installation of the OpenSolaris 2008.095 release, install the network driver. For a sample installation that includes instructions for installing the network driver, see OpenSolaris in Parallels VM on Mac OS X.

nwamd(1M) Man Page


NAME: nwamd - network auto-magic daemon SYNOPSIS: /lib/inet/nwamd DESCRIPTION: nwamd is a system daemon to manage network interfaces. This daemon is started automatically and should not be invoked directly. It does not constitute a programming interface. OPERATION: Whether this daemon is enabled or not depends on your installation medium. To check, enter the following at the command line:
% svcs svc:/network/physical

The two instances will be listed: one as disabled, the other as online. If the nwam instance is online then this daemon will be running. The two instances correspond to the two modes of network configuration: the default instance is for manual mode, while the nwam instance is for auto-magic mode. To go from manual mode to auto-magic mode:
% svcadm disable svc:/network/physical:default % svcadm enable svc:/network/physical:nwam

To go from auto-magic mode to manual mode:


% svcadm disable svc:/network/physical:nwam % svcadm enable svc:/network/physical:default

CAUTION: When switching modes like this, all network interfaces will be brought down then back up, thus if a different IP address is configured in this process, existing applications and sessions may be disrupted.

Chapter 1 Getting Started With OpenSolaris 2008.05

31

Composed May 7, 2008 nwamd(1M) Man Page

Note In auto-magic mode, there is a limitation that only one link is active at a time. This mode

is thus not recommended for machines which use more than one link at once. For machines with wired and wireless links, wired is preferred by default, although this can be adjusted by altering the order of the lines in the plain text file /etc/nwam/llp. Note, however, that this interface is Volatile and may change in a future release. PROFILES: Note that all interfaces listed in this section are Volatile and may change in a future release. They are documented here so that those wishing to experiment with this may do so. Profiles are a mechanism for making multiple related changes to the system configuration after IP service is available. There is not direct support for them yet, but a roll your own mechanism is provided for now. Once an interface is brought up and an IP address is configured for it, the daemon looks for /etc/nwam/ulp/check-conditions; if it exists and is executable, it is run. This is expected to print a single line of output, which is the name of the profile which the user wishes to be activated based on the current conditions. If such a line is read successfully (foo in this example), then /etc/nwam/ulp/foo/bringup is executed. Likewise, when the interface gets torn down for whatever reason, /etc/nwam/ulp/foo/teardown is executed. The bringup and teardown scripts are invoked via pfexec(1) with default basic privileges. Samples for each of these scripts can be found at:

http://opensolaris.org/os/project/nwam/prototype/check-conditions http://opensolaris.org/os/project/nwam/prototype/bringup http://opensolaris.org/os/project/nwam/prototype/teardown

WIRELESS: When no wired link is available, a scan for wireless LANs will be done, and the resulting list offered via a GUI pop-up to prompt the console user to select his/her preference. If a successful connection is made, the WLAN in question will be stored in the plain text file /etc/nwam/known_wifi_nets and subsequently the daemon may connect to any WLAN in that list without prompting again. Should a user wish to revoke his/her preference for a WLAN in that list, editing the file and deleting the line with the entry should suffice. Note, however, that this interface is Volatile and may change in a future release. ATTRIBUTE: See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE

Availability Interface Stability

SUNWcsr Volatile

SEE ALSO: svcs(1), svcadm(1M), attributes(5), smf(5) NOTES: The networking service is managed by the service management facility, smf(5), under the service identifier:
32 Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 nwamd(1M) Man Page

svc:/network/physical

Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using svcadm(1M). The service's status can be queried using the svcs(1) command.

Chapter 1 Getting Started With OpenSolaris 2008.05

33

Composed May 7, 2008

34

Composed May 7, 2008

C H A P T E R

Getting Started With the Image Packaging System

This section provides an overview of the Image Packaging System software (IPS). The OpenSolaris 2008.05 release uses IPS as its packaging system. The IPS software allows you to create images, and install, search, update, and manage packages in the image. You can also use IPS to create your own packages and OpenSolaris repositories, and publish and manage packages to the repositories. An image is a location where the packages, their files, and their corresponding actions can be installed. An image acts as an IPS client, which interacts with the package depot server. A package depot server, also called the repository, must be run for the IPS client to access the packages. For the OpenSolaris 2008.05 release of Indiana , http://pkg.opensolaris.org, is such a server. If the system on which IPS is installed is on the network, IPS can automatically access the OpenSolaris repository. You can also create your own OpenSolaris repository and set up your IPS client to access your repository. This book discusses the following topics:

IPS Overview on page 36 IPS for End Users (Tasks) on page 37 Installing Developer Software (Tasks) on page 48 IPS for Developers (Commands) on page 53 IPS For Developers (Tasks) on page 59 Further Information on page 64 pkg(1) Command Reference on page 65 Glossary on page 67

35

Composed May 7, 2008 IPS Overview

IPS Overview
The Image Packaging System software is a network-centric packaging system written in Python.
Note

At this time, the OpenSolaris 2008.05 release is for x86 platforms only. Both IPS and SVR4 packages are supported for the OpenSolaris 2008.05 release.

With IPS, users can perform the following basic tasks:


You can create your own image. After you have created your own image, you can install new packages and update existing packages from an IPS repository to your image. You can manage and search the packages on your image by using IPS commands that reference package attributes. See IPS for End Users (Tasks) on page 37.

With IPS, developers can perform the following additional tasks:

You can download developer software such as NetBeans and SunTM Studio Express. See Installing Developer Software (Tasks) on page 48. You can create your own network repository. Create and submit your own packages to an existing network repository. See IPS for Developers (Commands) on page 53 and IPS For Developers (Tasks) on page 59.

IPS Commands
Image Packaging System provides the following commands: pkg(1) pkgsend(1) pkg.depotd(1M) Use the pkg(1) command to create an image, to install packages to your image, and to manage packages on your image. Use the pkgsend(1) command to publish packages from your image to an existing repository. Use the pkg.depotd(1M) command to create and manage your own network repository.

36

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS for End Users (Tasks)

Note The pkg(5) man page describes the overall Image Packaging System. The pkg(1) man page describes the image packaging retrieval client.

Package Manager (IPS GUI)


The Package Manager is a graphical user interface for IPS. Users can install, update, and manage packages on their system using the Package Manager. See the screencast to learn how to use the Package Manager.

IPS for End Users (Tasks)


The following section provides information for end users to install, upgrade, search, and manage packages in the IPS repository.

Installing, Upgrading, and Managing Packages


The pkg(1) command is the retrieval client for the image packaging system. pkg(1) can be invoked to perform the following actions :

Create an image pkg image-create. Install new packages or update existing packages pkg install. Search for packages pkg search. Update all existing packages within an image pkg image-update. Display information about the state of packages pkg list. Verify packages have been installed correctly pkg verify. Display information about a package pkg info. Display attributes of actions pkg contents. Uninstall packages pkg uninstall. Update an existing authority or add additional package authority pkg set-authority. Remove the configuration associated with the given authority pkg unset-authority. Display authority information pkg authority.

Refer to the pkg(1) Command Reference on page 65 and the pkg(1) man page to learn more about the subcommands and options for the pkg(1) command.

Chapter 2 Getting Started With the Image Packaging System

37

Composed May 7, 2008 IPS for End Users (Tasks)

pkg(1) Uses FMRIs


Each IPS package is represented by a Fault Management Resource Identifier (FMRI). Thepkg(1) command uses valid FMRI package information to perform its command actions. The FMRI includes descriptive information about the package, such as the package name, version information, and date. For example, the FMRI, pkg://opensolaris.org/library/libc@5.11,5.11-0.75:20071001T163427Z, consists of the following sequence of information :

Scheme pkg Authority opensolaris.org Package Name libc Version String Consists of four components :

Component Version 5.11 Build Version 5.11 Branch Version 0.75 Timestamp 20071001T163427Z

Creating Images
The pkg(1) command is used to create an image. An installed OpenSolaris 2008.05 release on your system, constitutes an image. Packages can be installed directly within this image. New images are created to mark a boundary between the packages installed in different images. The image-create command sets up a relationship between the image and a server that can be accessed to add packages to the image. Images can be of three types:

Full images, capable of providing a complete system. Partial images, which are linked to a full image (parent image), but do not provide a complete system on their own. User images, which contain only relocatable packages.

How to Create an Image


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command.

38

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS for End Users (Tasks)

Ensure that you have write privileges to the directory where you are attempting to create an image.

Use the following command to create an image. A user image is created by default. pkg image-create -[FPUz] -a prefix=repository_url directory_location

Example 21

Creating a Full Image


In this example, a full image is created with a repository server, http://pkg.example.com. The image is created in the directory, /aux0/example_root. The -a option is used to specify a server such as http://pkg.example.com:10000.
$ pkg image-create -F -a example.com=http://pkg.example.com:10000 /aux0/example_root

How to Perform a Dry-Run Installation Inside a New Image


Before installing packages , you have the option to perform a dry run installation. A dry run enables you to execute the command without making persistent changes to the image. The dry run option does not install any packages and only shows the changes that are made if the packages are installed.
Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Use the following command to execute a dry-run installation. $ pkg install [-nv] pkg_fmri
Note pkg_fmri refers to a package name along with a version number and a subversion

number, if applicable.
Example 22

Performing a Dry-Run Installation of the SUNWzsh Package


The following example shows a dry-run (-n) installation of the SUNWzsh package with verbose (-v) output.
$ pkg install -nv SUNWzsh UNEVALUATED:+pkg:/SUNWzsh@4.2.5,5.11-0.75:20071019T203321Z one -> pkg:/SUNWlibms@0.5.11,5.11-0.75:20071024T204210Z [dir, file, link, and other actions for each resource delivered by this package and succeeding packages omitted]

Chapter 2 Getting Started With the Image Packaging System

39

Composed May 7, 2008 IPS for End Users (Tasks)

None None None None None None None None None None None

-> -> -> -> -> -> -> -> -> -> ->

pkg:/SUNWzlib@1.2.3,5.11-0.75:20071024T204906Z pkg:/SUNWlxml@2.6.23,5.11-0.75:20071024T204221Z pkg:/SUNWpool@0.5.11,5.11-0.75:20071024T204717Z pkg:/SUNWpr@0.5.11,5.11-0.75:20071024T204720Z pkg:/SUNWlibsasl@0.5.11,5.11-0.75:20071024T204217Z pkg:/SUNWtls@0.5.11,5.11-0.75:20071024T202854Z pkg:/SUNWopenssl@0.9.8,5.11-0.75:20071024T204623Z pkg:/SUNWcsl@0.5.11,5.11-0.75:20071024T202529Z pkg:/SUNWlibC@0.5.11,5.11-0.75:20071024T204202Z pkg:/SUNWpcre@7.0,5.11-0.75:20071019T202909Z pkg:/SUNWzsh@4.2.5,5.11-0.75:20071019T203321Z

How to Install a Package


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Use the following command to install a package. $ pkg install [-v] pkg_fmri
Note The pkg install command is also used to update specific packages on the system. The pkg install command automatically checks for newer versions of specific packages or package groups and installs them if they are available. Any dependent packages are also automatically updated.

Example 23

Install a Package
This example installs a SUNWphp524-mysql package. The output displays the status of the download, number of packages that were installed, number of files that were installed and the size (in megabytes) of the download.
$ pkg install SUNWphp524-mysql DOWNLOAD PKGS FILES Completed 3/3 301/301 PHASE Update Phase Install Phase ACTIONS 2/2 404/404

XFER (MB) 123.70/123.70

Example 24

Install a Package From a Different Repository


See the How to Add or Update an Authority on page 46 section to set an authority. The package is then installed from the set authority.

40

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS for End Users (Tasks)

This example installs the SUNWphp524-mysql package from the http://example.opensolaris.org authority.
$ pkg install pkg:/example.opensolaris.org/SUNWphp524-mysql

How to Verify a Package Installation


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Use the following command to verify the installation of a package. Use the -v option for verbose output. # pkg verify [-fv] pkg_fmri
Note Switch to root user before executing the pkg verify command.

Example 25

Verify Package Installation


In this example, the installation of SUNWphp524-mysql package is verified.
# pkg verify -v SUNWphp524-mysql PACKAGE STATUS pkg:/SUNWphp524-mysql OK

How to Search for Packages


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command.
Note If you are searching for a package in a remote repository, switch to root user and run the

pkg refresh command to retrieve updated contents of the repository associated with the current image.

Use the following command to search for packages based on the various properties indexed by the packaging system. $ pkg search [-lr] [-s repository_url] token

Example 26

Search for a Package in the Installed Image


The following example searches and locates the SUNWbash package in the installed image.

Chapter 2 Getting Started With the Image Packaging System

41

Composed May 7, 2008 IPS for End Users (Tasks)

pkg search SUNWbash legacy_pkg legacy SUNWbash pkg:/SUNWbash@3.2.25,5.11-0.79:20080205T152506Z

Example 27

Search for a Package in a Remote Repository


In this example, the pkg search command searches for the token bge in the remote (-r) repository associated with the current image.
$ pkg search -r bge basename pkg:/SUNWbge@0.5.11,5.11-0.75:20071114T203134Z driver_name pkg:/SUNWbge@0.5.11,5.11-0.75:20071114T203134Z basename pkg:/SUNWbge@0.5.11,5.11-0.79:20080205T180828Z driver_name pkg:/SUNWbge@0.5.11,5.11-0.79:20080205T180828Z basename pkg:/SUNWbge@0.5.11,5.11-0.75:20071031T180039Z driver_name pkg:/SUNWbge@0.5.11,5.11-0.75:20071031T180039Z

How to Update All Installed Packages


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Use the following command to update all packages in the current image to the latest version. $ pkg image-update

See Also

The pkg image-update command can also be used to upgrade an installed boot environment. For more information, see theUpgrading a Boot Environment on page 73 section.

How to Display the State of Packages


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Use the following command to see the state of packages. $ pkg list [-aHsuv] pkg_fmri

Example 28

Displaying the State of an Installed Package


The following example shows the status of the SUNWbash package with the -v option, which displays the full FMRI information. This example shows information only about the installed SUNWbash package.
$ pkg list -v SUNWbash FMRI

STATE

UFIX

42

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS for End Users (Tasks)

pkg:/SUNWbash@3.2.25,5.11-0.79:20080205T152506Z

installed ----

Example 29

Displaying the State of All Instances of a Package


This example shows the state of all instances of the SUNWbash package.
pkg list -a SUNWbash NAME (AUTHORITY) VERSION SUNWbash 3.2.25-0.86 SUNWbash 3.2.25-0.79 SUNWbash 3.2.25-0.75 SUNWbash 3.2.25-0.75

STATE installed known known known

UFIX ---u--u--u---

How to List the Action Attributes of a Package


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. See the Actions in IPS on page 55 section to become familiar with the actions associated with a package.

Use the following command to list the action attributes of a package. $ pkg contents [-Hm] [-o attribute] [-s sort_key] [-t action_type] pkg_fmri

Example 210

Listing the Contents of a Package


In this example, we will list the name, mode of the file, size, path and the target of the following actions in the zfs package:

dir file link hardlink

$ pkg contents -t dir,file,link,hardlink -o action.name,mode,pkg.size,path,target zfs NAME dir dir dir link link dir dir dir MODE 0755 0755 0755 SIZE PATH etc etc/fs etc/fs/zfs etc/fs/zfs/mount etc/fs/zfs/umount etc/zfs lib lib/amd64 TARGET

../../../sbin/zfs ../../../sbin/zfs

0755 0755 0755

Chapter 2 Getting Started With the Image Packaging System

43

Composed May 7, 2008 IPS for End Users (Tasks)

link lib/amd64/libzfs.so file 0755 469616 lib/amd64/libzfs.so.1 file 0644 62057 lib/amd64/llib-lzfs.ln link lib/libzfs.so [ ... ]

libzfs.so.1

libzfs.so.1

Example 211

Displaying Complete Contents of a Package


This example uses the -m option with the pkg contents command to display all actions of the SUNWbash package.
$ pkg contents -m SUNWbash set fmri = pkg://opensolaris.org /SUNWbash@3.2.25,5.11-0.79:20080205T152506Z dir owner=root path=usr group=sys mode=0755 dir owner=root path=usr/bin group=bin mode=0755 dir owner=root path=usr/gnu group=bin mode=0755 dir owner=root path=usr/gnu/bin group=bin mode=0755 depend fmri=pkg:/SUNWcsl@0.5.11-0.79 type=require file 66d09735123ad3a7bdcf7640dd60acbe843d8a13 elfhash=28106285f73f97274cf99b1a7e63d7d73c31c153 elfarch=i386 mode=0555 pkg.size=730604 owner=root group=bin path=usr/bin/bash elfbits=32 legacy category=system vendor="Sun Microsystems, Inc." name="GNU Bourne-Again shell (bash)" version=11.11.0,REV=2007.11.29.14.44 hotline="Please contact your local service provider" pkg=SUNWbash arch=i386 desc="GNU Bourne-Again shell (bash) version 3.2" license ed881c52c54b67457db33ba23a1d53615e366440 path=copyright license=SUNWbash.copyright transaction_id=1202253906_pkg%3A%2FSUNWbash% 403.2.25%2C5.11-0.79%3A20080205T152506Z pkg.size=1207 link path=usr/gnu/bin/sh target=../../bin/bash set name=description value="GNU Bourne-Again shell (bash)" set fmri = pkg://VERSION_1 /SUNWbash@3.2.25,5.11-0.79:20080205T152506Z dir owner=root path=usr group=sys mode=0755 dir owner=root path=usr/bin group=bin mode=0755 dir owner=root path=usr/gnu group=bin mode=0755 dir owner=root path=usr/gnu/bin group=bin mode=0755 depend fmri=pkg:/SUNWcsl@0.5.11-0.79 type=require file 66d09735123ad3a7bdcf7640dd60acbe843d8a13 elfhash=28106285f73f97274cf99b1a7e63d7d73c31c153 elfarch=i386 mode=0555 pkg.size=730604 owner=root group=bin path=usr/bin/bash elfbits=32 legacy category=system vendor="Sun Microsystems, Inc." name="GNU Bourne-Again shell (bash)" version=11.11.0,REV=2007.11.29.14.44 hotline="Please contact your local service provider" pkg=SUNWbash arch=i386 desc="GNU Bourne-Again shell (bash) version 3.2" license ed881c52c54b67457db33ba23a1d53615e366440 path=copyright

44

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS for End Users (Tasks)

license=SUNWbash.copyright transaction_id=1202253906_pkg%3A%2FSUNWbash%403.2.25 %2C5.11-0.79%3A20080205T152506Z pkg.size=1207 link path=usr/gnu/bin/sh target=../../bin/bash set name=description value="GNU Bourne-Again shell (bash)"

How to List Information About a Package


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Use the following command to view information about a package. If no pkg_fmri is specified, information about all installed packages are displayed.
$ pkg info [--license] pkg_fmri

Example 212

Display Package Information


This example displays information about the SUNWbash package.
Name: SUNWbash Summary: GNU Bourne-Again shell (bash) Authority: pkg.com (preferred) Version: 3.2.25 Build Release: 5.11 Branch: 0.79 Packaging Date: Tue Feb 5 15:25:06 2008 Size: 714 kB FMRI: pkg:/SUNWbash@3.2.25,5.11-0.79:20080205T152506Z

Example 213

Display Copyright and License Information About a Package


This example displays the copyright and license information about the SUNWGlib package.
$ pkg info --license -r SUNWGlib Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

Chapter 2 Getting Started With the Image Packaging System

45

Composed May 7, 2008 IPS for End Users (Tasks)

Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. Modified by the GLib Team and others 1997-1999. See the AUTHORS file for a list of people on the GLib Team. See the ChangeLog files for a list of changes. These files are distributed with GLib at ftp://ftp.gtk.org/pub/gtk/.

How to Uninstall Packages


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Use the following command to uninstall existing packages. $ pkg uninstall [-nvr] pkg_fmri

Example 214

Uninstalling a Package
This example uninstalls the SUNWphp524-mysqlpackage.
$ pkg uninstall SUNWphp524-mysql PHASE ACTIONS Removal Phase 39/39

How to Add or Update an Authority


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Become root user before executing this command.

Type the following command to update an existing authority or add an additional package authority. # pkg set-authority [-P] [-k ssl_key] [-c ssl_cert] [-O origin_url] authority
Note The option -O should be specified in upper case.

Example 215

Adding an Additional Package Authority


# pkg set-authority -O http://pkg.sunfreeware.com:80 sunfreeware.com

46

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS for End Users (Tasks)

# pkg authority AUTHORITY URL opensolaris.org (preferred) http://pkg.opensolaris.org:80/ sunfreeware.com http://pkg.sunfreeware.com:80/

How to Remove Authority Configuration


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Become root before executing this command.

Type the following command to remove the configuration information associated with a given authority. # pkg unset-authority authority

Example 216

Removing an Authority
# pkg unset-authority sunfreeware.com # pkg authority AUTHORITY opensolaris.org (preferred)

URL http://pkg.opensolaris.org:80/

How to Display Authority Information


Before You Begin

Refer to the pkg(1) Command Reference on page 65 for a table of all the options associated with this command. Type the following command to display information about an authority. If no arguments are specified, a list of configured authorities and their associated URLs is displayed. $ pkg authority [-H] authority

Example 217

Displaying Authority Information


$ pkg authority AUTHORITY opensolaris.org (preferred) URL http://pkg.opensolaris.org:80/

Chapter 2 Getting Started With the Image Packaging System

47

Composed May 7, 2008 Installing Developer Software (Tasks)

Installing Developer Software (Tasks)


This section provides information for users interested in downloading and installing software applications such as NetBeans and Sun Studio Express on their OpenSolaris 2008.05 system. The Setting up Your Development Environment document provides details on how to set up your OpenSolaris 2008.05 system for AMP (Apache, MySQL, Perl,PHP,Python) , C, C++, and Ruby development. This section shows how to download and install the following applications:

How to Install OpenOffice.org on page 48 How to Install NetBeans 6.0.1 on page 49 How to Install Sun Studio Express 5/08 on page 49 How to Install Sun HPC ClusterTools 7.1 on page 50 How to Install Web Stack Tools and UI on page 51 How to Install GlassFish Java EE 5 Application Server on page 52

Note Some of the software applications are not available as a package on the OpenSolaris

repository, pkg.opensolaris.org. You will need to download the software separately from the application's web site.

How to Install OpenOffice.org


OpenOffice.orgTM is a suite of open-source office applications that runs on a variety of operating systems. It includes applications for creating word processing documents, spreadsheets, presentations, and graphics. The OpenOffice.org software is available for downloading and installation as a single package in the Open Solaris Binary Repository. Package name : openoffice Version: 2.4.0

Use the following command to install the OpenOffice.org package. The latest package will be installed.
pkg install openoffice

See Also

Go to the OpenOffice.org site at http://www.openoffice.org to learn more about the OpenOffice.org project .

48

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Installing Developer Software (Tasks)

Troubleshooting

See the Openoffice.org Release Notes and the FAQ sections.

How to Install NetBeans 6.0.1


NetBeansTM IDE 6.0.1 is a minor update to NetBeans IDE 6.0. NetBeans IDE 6.0.1 is targeted specifically for the OpenSolaris environment. The changes since the NetBeans IDE 6.0 release are described in the NetBeans IDE 6.0.1 Release Notes. The NetBeans IDE 6.0.1 release is available for downloading and installation as a single package in the Open Solaris Binary Repository. The netbeans package includes 16 components and each package can also be installed individually. For a list of all the NetBeans packages that are contained in the netbeans package, see the NetBeans Packages on page 68 table. Package name : netbeans Version: 6.0.1

Use the following command to install the NetBeans package. The latest package will be installed.
$ pkg install netbeans

See Also Troubleshooting

For NetBeans IDE 6.0.1 documentation, see NetBeans IDE 6.0 documentation. Join the NetBeans community, where you can subscribe to mailing lists, search the mailing list archives, and check the NetBeans User FAQs.

How to Install Sun Studio Express 5/08


The Sun Studio Express 5/08 release is a fully functional preview that focuses on new features in the Sun Studio product. Sun Studio Express 5/08 is available only from the OpenSolaris repository. This express release is based on Sun Studio Express's February 2008 build, and is tailored for use and distribution in the OpenSolaris environment. The features that have been added or changed since the Sun Studio 12 release are described in the Sun Studio Express 5/08 Readme at http://developers.sun.com/sunstudio/downloads/ssx/express_May2008_readme.html. A key highlight of the Sun Studio Express 5/08 release is that the Sun Studio team has joined the OpenSolaris community to provide a binary distribution that is redistributable by the community governed by the OpenSolaris Binary License.

Chapter 2 Getting Started With the Image Packaging System

49

Composed May 7, 2008 Installing Developer Software (Tasks)

The Sun Studio Express 5/08 release is available for download and installation as a single package in the Open Solaris Binary Repository. It is also part of a cluster of packages, called ss-dev, which includes gmake, Java Development Kit and so on. For a complete list of packages in the ss-dev package, see the Sun Studio Express 5/08 Packages on page 68 table. Package name : sunstudioexpress Version: 0. 2008.05
Note The sunstudio package in the repository points to the sunstudioexpress package.

To install the Sun Studio Express package, type:


pkg install sunstudioexpress

Next Steps

After you have installed the Sun Studio 5/08 Express release, update your PATH and MANPATH environment variables to include the paths to the Sun Studio 5/08 installation directory, install_dir/SunStudioExpress/bin, and man page directory install_dir/SunStudioExpress/man, respectively. The default installation directory is /opt. To view documentation for Sun Studio 12 software, the latest official release of the Sun Studio product, see the Sun Studio Information Center. Sign on to the Sun Studio User Forums to post questions to Sun engineering and the community. Be sure to state that you are using the Sun Studio Express 5/08 release.

See Also

Troubleshooting

How to Install Sun HPC ClusterTools 7.1


Sun HPC ClusterToolsTM 7.1 software is an integrated toolkit that enables developers to create and tune Message-passing Interface (MPI) applications that run on high performance clusters of Sun systems. Sun HPC ClusterTools 7.1 is a binary distribution of the open-source Open MPI 1.2 software. Sun HPC ClusterTools includes MPI libraries, a parallel job launcher (mpirun), and other tools to support compiling and running complex, compute-intensive MPI applications on Sun systems and clusters of Sun systems. Sun HPC ClusterTools 7.1 includes plug-ins to support parallel job launching through Sun Grid Engine and MPI communication over shared memory, TCP, Infiniband, and Myrinet MX interconnects. Package Name : clustertools_7.1 Version : 7.1

50

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Installing Developer Software (Tasks)

Note The clustertools package in the repository points to the clustertools_7.1 package.

To install the Sun HPC ClusterTools package, type :


$ pkg install clustertools

Next Steps

The installed Sun HPC ClusterTools 7.1 software is located in /opt/SUNWhpc/HPC7.1. To verify that the software is installed properly, you can launch a simple non-MPI parallel job by using mpirun. For example, use the following command. % /opt/SUNWhpc/HPC7.1/bin/mpirun hostname

See Also

For more information about advanced features of ctinstall, such as installing on multiple nodes in a cluster or installing the Sun HPC ClusterTools 7.1 packages on an NFS server, please consult the Sun HPC ClusterTools 7.1 Software Installation Guide provided with this product. For more information about the Sun HPC ClusterTools 7.1 software, see http://www.sun.com/software/products/clustertools. The Sun HPC ClusterTools 7.1 software documentation is included with this product. Documentation is also located online at Sun HPC ClusterTools 7.1 Documentation.

Troubleshooting

Sign on to the Sun Studio User Forums to post questions to Sun engineering and the community. Be sure to state that you're using a Sun Studio Express build.

How to Install Web Stack Tools and UI


The WebStack Options and Desktop Menus package is developed as an OpenSolaris project. The WebStack Options and Desktop Menus package adds desktop features to operate the SAMP (Solaris, Apache, MySQL, PHP) stack. This package provides the following tools:

Menu to initialize the stack for a particular user Menu to start/stop the Apache2 and MySQL services Menu to view the log files Menu to create and run samples Menu to view the getting started guide Menu to launch a SAMP UI console that exposes the key parameters of the stack:

Chapter 2 Getting Started With the Image Packaging System

51

Composed May 7, 2008 Installing Developer Software (Tasks)

Apache Port Number Apache Document directory PHP debug mode PHP log level Access to the httpd.conf file in edit mode Access to the php.ini file in edit mode Show a detailed status of the stack View a phpinfo page

WebStack Options and Desktop Menus package is available for download and installation as a single package in the Open Solaris Binary Repository. Package Name : webstackui Version : 0.5.11

Install this package by using the following command:


pkg install webstackui

See Also

After installation, documentation for this package is located at /usr/share/webstack/doc/html/index.html. For the most current information regarding downloading and installation of Web Stack packages in the repository, refer to the online documentation. For a complete list of webstack packages that are available in the pkg.opensolaris.org repository, see the WebStack Packages table.

Troubleshooting

Join the OpenSolaris WebStack User Mailing List to post questions to WebStack engineering and the community. You might find that your problem has already been solved.

How to Install GlassFish Java EE 5 Application Server


GlassFish Java EE 5 Application Server is an Open Source Application Server for JavaTM EE 5 developed at https://glassfish.dev.java.net/. GlassFish Java EE 5 Application Server is available for download and installation as a single package in the OpenSolaris binary repository. Package name : glassfishv2 Version: 0.5.11

52

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS for Developers (Commands)

Before You Begin

Installation of GlassFish requires that JDK 1.6, JavaDB, and ANT packages are installed. Also, the default domain, domain1, has to be created manually. To install this package, type the following command:
pkg install glassfishv2

See Also

Online documentation is available at https://glassfish.dev.java.net/javaee5/docs/DocsIndex.html. Join the GlassFish Java EE 5 Application Server User Forums to post questions to GlassFish engineering and the community.

Troubleshooting

IPS for Developers (Commands)


The following section provides an overview of the pkgsend(1) and pkg.depotd(1) commands. These commands enable you to create and administer an IPS repository. Additionally, this section describes the role of actions in IPS.

The Publication Client pkgsend(1)


The image packaging system publication client, pkgsend, allows the publication of new packages and new package versions to an image packaging repository. Each publication is structured as a transaction. Transactions may contain actions as described in the section Actions in IPS on page 55. The pkgsend(1) command supports the following subcommands :
Note The default repository server is http://localhost:10000. To specify a different repository server , use the -s repository-server option with the pkgsend subcommands.

Chapter 2 Getting Started With the Image Packaging System

53

Composed May 7, 2008 IPS for Developers (Commands)

TABLE 21

pkgsend(1) Subcommands
Description

Subcommand

open

Begins a transaction on the package specified by pkg_fmri. A transaction_id is outputted when the command executes successfully. Syntax : pkgsend open -en pkg_fmri -e Use this option to prepend export PKG_TRANS_ID= to the transaction_id. This can be used by the shell to evaluate the output and set the environment variable PKG_TANS_ID. This environment variable can be used when executing future pkgsend commands within the same transaction. For information about FMRI, see the Solaris Basic Administration Guide.

add

Adds a resource associated with an action to the current transaction. Syntax : pkgsend add actions pkg_fmri

include

Adds resources associated with the multiple actions present in each manifest file to the current transaction. Each line in the file should be the string representation of an action. Do not use this sub command with the add, open or close sub-commands. Syntax : pkgsend include filename

import bundlefile close

Adds each given bundle file into the current transaction. Close the current transaction. Syntax : pkgsend close [-a] The -a option abandons the current transaction.

send bundlefile

Sends each given bundlefile as a new package version, in an appropriate series of transactions Syntax : pkgsend send bundlefile

Limitations of the pkgsend(1) Command


Note the following limitations of using the pkgsend command:

Use the pkgsend command only if one or two packages at a time are being published to the repository. The pkgsend command does not resolve dependencies. If more than one package is being published to the repository, the user must manually resolve all package dependencies. Note the following points when publishing a newer version of a package to the repository.

Specify the FMRI of the package correctly. The new version of the package will coexist with any prior version already in the repository. Use the same command such as pkgsend send or pkgsend include to publish the newer version, as that was used to publish the previous version of the package.

54

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS for Developers (Commands)

Actions in IPS
IPS manages software in units of packages. Packaging a product aids in easy distribution and installation of the software product. A package is a collection of files, directories, links, drivers, and dependencies in a defined format. This collection represents the installable objects of a package. In IPS terminology, this collection is referred to as actions. Actions are described in a package's manifest. Every action consists primarily of its name and a key attribute. Together, these attributes refer to a unique object and include a version history. Actions can have other attributes. Some of these attributes are interpreted directly by the packaging system, others are useful only to the system administrator or the end user.
Note The attributes of a package are different from the attributes of an action. See the Package Tags and Attributes section to learn about the supported tags and attributes for a package.

Typically, only an action's key attribute is required, though some actions might work properly only with a more complete set of attributes. The following list provides an overview of the type of actions and their standard attributes that are available with IPS. For additional details, see the pkg(5) man page.
Note pkg(5) refers to the image packaging system and is different from the pkg(1) command,

which is the retrieval client and is used to create, install, and manage images on the system

Note The following table shows a list of the actions and their key attributes. For a complete list,

refer to the pkg(5) man page.


TABLE 22 Action

Actions and Key Attributes


Description and Key Attributes

Directory

The directory action represents a directory as a file system object. path The filesystem path where the file is installed.

File

The file action represents an ordinary file as a file system object. path The file system path where the file is installed.

Chapter 2 Getting Started With the Image Packaging System

55

Composed May 7, 2008 IPS for Developers (Commands)

TABLE 22 Action

Actions and Key Attributes


Description and Key Attributes

(Continued)

Link

The link action represents a symbolic link. path The file system path where the symlink is installed.

Hardlink

The hardlink action represents a physical link. path The file system path where the link is installed.

Driver

The driver action represents a device driver. It does not reference a payload, the driver files must be installed as file actions. name The name of the driver. This is usually, but not always, the file name of the driver binary.

Depend

The depend action represents a dependency between packages. A package might depend on another package to work or to install. Dependencies are optional. No key attribute defined.

License

The license action represents a license or other information associated with the package contents. A package can deliver licenses or disclaimers to the package installer through the use of the license action. The payload of the license action is delivered into the image metadata directory associated with the package. license The keyword identifying the license type, for use in filter and query operations

Legacy

The legacy action represents package data used by a legacy packaging system. The attributes associated with this action are added to the legacy system's databases so that the tools querying those databases might operate as if the legacy package were actually installed. pkg The abbreviation for the package being installed. The name of the package in the package FMRI is the default value.

Set

The set action represents a package-level attribute, such as the package description. No key attribute defined.

Group

The group action defines a UNIX group as defined in group(4). No support is present for group passwords. Groups defined with this action initially have no user-list. Users can be added with the user action. No key attribute defined.

User

The User action defines a UNIX user as defined in /etc/passwd, /etc/shadow, /etc/group and /etc/ftpd/ftpusers files. Users defined with this attribute have entries added to the appropriate files. No key attribute defined.

Package Attributes and Tags


The attributes and tags of a package can be set with the set action.

56

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS for Developers (Commands)

Packages carry information about themselves in the form of metadata, which is also informally known as attributes and tags. Attributes refer to settings that apply to an entire package. Tags are the settings that affect individual files within a package. The package developer provides specific information about the package through the tags and attributes. The pkg attribute is the attribute that is common to all packages, regardless of any particular OS platforms that a specific package might target. The IPS packages can contain the following set of tags and attributes.
TABLE 23 Attribute

Package Attributes
Description

Package Name : pkg.name

Short, descriptive name of the package.

Package Description : A short paragraph describing the package. pkg.description Package URL: pkg.detailed_url
TABLE 24 Tag

Used to provide links to sites with further information about the package.

Tags
Description

Debug Information: pkg.debug ISA

Used to specify if the package needs to be installed in a debug configuration. Distinguishes between different x86 platforms.

The opensolaris attribute is the attribute that is common to all OpenSolaris packages.
Note In the following table, except ISA attribute, all atributes have opensolaris appended to them. For example, the attribute arc.url should be specified as opensolaris.arc_url.
TABLE 25

OpenSolaris Attributes
Description

OpenSolaris Attribute

arc_url

One or more URLs associated with the ARC case(s) associated with the component(s) delivered by the package. A human readable string describing the entity that provides the package. For an individual, this string is their name, or name and email address. Distinguishes between different x86 platforms.

maintainer

ISA

Chapter 2 Getting Started With the Image Packaging System

57

Composed May 7, 2008 IPS for Developers (Commands)

TABLE 25

OpenSolaris Attributes
Description

(Continued)

OpenSolaris Attribute

upstream

A humanreadable string describing the entity that creates the software. For an individual, this string is expected to be the individual's name, or name and email. A URL associated with the entity that creates the software delivered within the package. A URL to the source code bundle, if appropriate, for the package. A URL to the source code repository, if appropriate, for the package. A changeset ID for the version of the source code contained in opensolaris.repository_url attribute. A list of labels classifying the package into the categories shared among pkg(5)graphical clients.

upstream_url

source_url repository_url repository_changeset

gui.classification

Overview of the Depot Server pkg.depotd


The pkg(1) command makes requests of the repository, also called the depot server, for catalogs and packages. The pkgsend(1) command sends new versions of packages to the depot server. The depot server is typically run as a service on the system. Package and software developers can run private copies for various testing purposes. The pkg.depotd service is managed by the service management facility, smf(5), under the service identifier: svc:/application/pkg/server. Because the depot server expects to be run by a smf(5) restarter, it does not run daemon processes. Error messages are generally sent to standard output, or to the syslogd(1M) system. The pkg.depotd server is usually configured through the smf(5) properties associated with its service instance. The following properties are recognized.
TABLE 26

pkg.depotd(1M) Properties
Description The file system path where this instance of the depot server should look for its repository data. The default value is /var/pkg/repo. The port number on which this instance of the depot server should listen to for incoming package requests. The default value is 80.

Property pkg/inst_root

pkg/port

The pkg.depotd(1M) command has the following options to alter the default settings from the service instance.
58 Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS For Developers (Tasks)

TABLE 27

pkg.depotd(1M) Options
Description Specify a different repository directory. Overrides pkg/inst_root with the value given by repo_dir. Specify a different port number. Overrides pkg/port with the value given by port.

Option -d repo_dir -p port

For further information, see the pkg.depotd(1M) man page.


EXAMPLE 218

Enabling the Depot Server

Type the following command as root user to enable the depot server. In this example, application/pkg/server is the depot server.
# svcadm enable application/pkg/server
EXAMPLE 219

Changing the Listening Port of The Depot Server

Type the following sequence of commands as root user to change the listening port of the depot server. This example sets the listening port of the depot server to 9999.
# svccfg -s application/pkg/server set pkg/port = 9999 # svcadm refresh application/pkg/server # svcadm restart application/pkg/server

IPS For Developers (Tasks)


This section provides information for developers who are interested in creating their own OpenSolaris repositories, and creating and publishing IPS packages andSVR4 packages. The IPS software in the 2008.05 release of OpenSolaris enables developers to perform a variety of tasks related to creating and publishing packages. The following tasks are supported for the 2008.05 release.

How to Create Your Own OpenSolaris Repository Using pkg.depotd(1) Command on page 60 How to Create Your Own OpenSolaris Repository Using Smf Commands on page 60 How to Create and Publish an IPS Package on page 61 How to Publish SVR4 Packages to Your Repository on page 63

Chapter 2 Getting Started With the Image Packaging System

59

Composed May 7, 2008 IPS For Developers (Tasks)

How to Create Your Own OpenSolaris Repository Using pkg.depotd(1) Command


Type the following command to create your repository: $ /usr/lib/pkg.depotd -d repository_directory -p port_value To confirm that the repository has been created, open your browser and type the following command http://localhost:port_value . Check the contents of the repository. $ ls repository_directory

Example 220

Creating Your Own Repository Using pkg.depotd


This example creates an OpenSolaris repository repository1 with a port value of 9000 and shows the content of the repository.
$ /usr/lib/pkg.depotd -d /export/home/user1/repository1 -p 9000 $ ls /export/home/user1/repository1 catalog file pkg search.dir search.pag trans updatelog

How to Create Your Own OpenSolaris Repository Using Smf Commands


Become superuser. Set the value of the port. # svccfg -s application/pkg/server setprop pkg/port=port_value Set the value of the repository. # svccfg -s application/pkg/server setprop pkg/inst_root=repository_directory Refresh the repository. # svcadm refresh application/pkg/server Restart the repository. # svcadm restart application/pkg/server

1 2

60

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS For Developers (Tasks)

Open your browser and type http://localhost:port_value to confirm that the repository has been created. Check the contents of the repository. # ls repository_directory

Example 221

Creating Your OpenSolaris Repository Using smf Commands


This example creates an OpenSolaris repository repository2 with a port value of 8000 and shows the contents of the repository.
# # # # svccfg svccfg svcadm svcadm -s application/pkg/server setprop pkg/port=8000 -s application/pkg/server setprop pkg/inst_root=/export/home/user1/repository2 refresh application/pkg/server restart application/pkg/server

# ls /export/home/user1/repository2 catalog file pkg search.dir search.pag trans updatelog

How to Create and Publish an IPS Package


There are different types of IPS packages that can be created. As mentioned previously, a package is a collection of files, directories, drivers, and dependencies in a defined format. This task shows how to create a package that consists of a directory , a file, a dependency, and a name attribute. The package is then published to the repository using the pkgsend(1) command.

Before You Begin

Read the section Actions in IPS on page 55 and become familiar with actions and the attributes of each action. Create a temporary directory on your system. $ mkdir my_tmp Change the directory to the temporary directory. $ cd / my_tmp Create a directory called my_package. $ mkdir my_package Change the directory to my_package. $ cd my_package
Chapter 2 Getting Started With the Image Packaging System 61

Composed May 7, 2008 IPS For Developers (Tasks)

Create a text file under the directory my_package. $ vi my_text_file


Note The files can be of any type. This example uses a text file.

Export the directory my_package. Specify a version number and a sub-version number for the package. In this example, the my_package has a version number of 1.0 and a subversion number of 1. Note the back quotes used in this command. $ eval pkgsend open my_package@1.0-1
Note Specify the package name, version number and subversion number correctly. This cannot be changed afterwards.

Add attributes to the package. In this task you add a directory action with attributes of mode, owner, group, and path. Path is the key attribute for the directory action and has to be specified. $ pkgsend add dir mode=055 owner=root group=bin path=/etc/my_package

Add the file my_text_file under the my_package directory. $ pkgsend add file my_package/my_text_file

Add attributes to the file. In this example, you add the file action with the attributes of mode, owner, group, and path. Path is the key attribute for the file action and has to be specified. $ pkgsend add file mode=055 owner=root group=bin path=/etc/my_package
Note Actions can also be included in a file. This file can then be added to the current transaction by using the pkgsend include command.

Note The path attribute specifies the directory where the file will be created. This path should

exist on the IPS client although it can be different from the file's location on the IPS server.
10 11

We have now created a package my_package consisting of a directory and a file. We will add a dependency for this package and set a name attribute. $ pkgsend add depend fmri=pkg:/depends_on_this_package@1.0-1 type=require $ pkgsend add set name=description value="Example Package"

62

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 IPS For Developers (Tasks)

Note If the resources have been specified in a file, use the pkgsend include resource_filename

command instead of the pkgsend add command, to add the resources to the current transaction.
12

Use the following option to close the transaction. $ pkgsend close

Example 222

Creating and Publishing a Simple Package


This example uses the pkgsend(1) command to create and publish a package.
$ eval pkgsend open my_package@1.0-1 $ pkgsend add file my_package mode=0555 owner=root group=bin\ path=/usr/bin/my_package $ pkgsend close

How to Publish SVR4 Packages to Your Repository


SVR4 packages can be installed directly on your system by using the pkgadd(1M) and related commands. To learn more about the SVR4 packaging commands, see the Application Packaging Programmer's Guide. SVR4 packages can be published to the IPS repository by using the pkgsend(1) command.

Before You Begin

See the The Publication Client pkgsend(1) on page 53 section to become familiar with the workings and limitations of the command. The default repository is http://localhost:10000. If you are publishing a package to a repository other than the default repository, ensure that the repository is created.

Use the following command to publish the SVR4 package to your repository. The default repository is http://localhost:10000 $ pkgsend -s repository_url send SVR4_package_fmri

Example 223

Publishing a SVR4 package, SUNWitos to Your Repository


$ pkgsend -s http://localhost:9000 send SUNWitos

Chapter 2 Getting Started With the Image Packaging System

63

Composed May 7, 2008 Further Information

Further Information
The following section provides additional information about the IPS project.

Building JDS on OpenSolaris 2008.05


To build a SVR4 package, you will need to download and build the Java Desktop System's (JDS) Common Build Environment (CBE). The steps to build JDS on a OpenSolaris 2008.05 system are documented on the JDS project page on opensolaris.org.
Note The instructions on this page and the overall process to build a SVR4 package will change in the weeks following the OpenSolaris 2008.05 release. Watch this page for the latest information.

To build the JDS sources, use Sun Studio 10 or Sun Studio 11. To download and install Sun Studio 10 or Sun Studio 11, go to the Sun Studio Download Center.
Note For the pkgbuild command, which is used to build a SVR4 package, any compiler, including gcc, can be used.

Contributing to IPS
See the main IPS page for details and subscribe to the pkg-discuss mailing list to join the discussion.

How to File a Bug Report for IPS


Ensure that the bug you want to file is not already present in the Bugzilla database before filing a report. Use the Development option for classification and the pkg option for product when filing the report.

64

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 pkg(1) Command Reference

pkg(1) Command Reference


The pkg(1) command enables users to create images, install and manage packages on their system. For the OpenSolaris 2008.05 release, the pkg command has the following sub-commands and options.
TABLE 28

pkg(1) Command
Description

Subcommands

pkg image-create

Creates an image suitable for package operations at the specified directory. Syntax : pkg image-create [-FPUz] -a -F Creates a Full image -P Creates a partial image -U Creates a user image (default) -z Run the image in a non-global zone context -a Specify a repository server

pkg image-update

Updates all installed packages in the current image to the latest available version. Syntax: pkg image-update [-nv] -n - Execute the requested operation but make no persistent changes to the image. -v - Issue verbose progress messages during the requested operation.

pkg refresh

Retrieves updated catalogs for each authority registered within the image. Syntax: pkg refresh

pkg install

Installs a package. Syntax: pkg install [-nv] pkg_fmri -n - Execute the requested operation but make no persistent changes to the image. -v - Issue verbose progress messages during the requested operation.

pkg uninstall

Uninstalls a package. Syntax: pkg uninstall [-nrv] pkg_fmri -n - Execute the requested operation but make no persistent changes to the image. -v - Issue verbose progress messages during the requested operation. -r - Recursively uninstall any packages which are dependent on the initial package.

Chapter 2 Getting Started With the Image Packaging System

65

Composed May 7, 2008 pkg(1) Command Reference

TABLE 28

pkg(1) Command
Description

(Continued)

Subcommands

pkg info

Displays information about a package. Syntax : pkg info [--license] pkg_fmri --license Display License and copyright information for a pacakge.

pkg list

Displays information about the state of packages in the current image. Syntax: pkg list [-aHsuv] pkg_fmri -a - Display information on all known packages, whether they are installed or not installed. -s - Display only package name and description of the package. -u - Show information only about packages which have newer versions available. -r - Show detailed package FMRIs.

pkg search

Search for token, and display the FMRIs in which token was found. Syntax: pkg search [-lr] [-s server] token -l - Search the installed packages on the image. -r - Search the repository that is linked to by the image. -s - Search for packages in the specified server. Multiple servers can be specified.

pkg contents

Display the attributes of actions in the current image. Syntax : pkg contents [-Hm] [-o attribute] [ -s sort_key] [-t action_type] -m - Shows complete contents of the action as represented in the package manifest. -o - Specify the attribute you are searching for. Multiple attributes may be specified with a single -o option by separating the attributes with commas. -s - Sort the display based on the specified attribute. -t - Display information only pertaining to the specified action. -H - Do not display any headers.

pkg verify

Validate the installation of packages in the current image. Syntax: pkg verify -[fv] pkg_fmri -v - Display verbose information. -f - Fully validate the contents of files against the hash values in the package manifests, as well as checking for file and directory presence

66

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Glossary

TABLE 28

pkg(1) Command
Description

(Continued)

Subcommands

pkg set-authority

Update an existing authority or add an additional package authority. Syntax: pkg set-authority [-P] [-k ssl_key] [-c ssl_cert] [-O origin_url] authority -P - Set the specified authority as the preferred authority. -c - Specify client SSL certificate. -k - Specify client key. -O - Set the URL prefix for the origin packaging repository for the authority.

pkg unset-authority Remove the configuration associated with the given authority. Syntax: pkg unset-authority authority pkg authority Display authority information. If an authority is specified, configuration values associated with the authority is displayed. Syntax: pkg authority [-H] authority No argument - Display the list of all configured authorities, and their origin URLs -H- Remove headers from the listing.

Glossary
TABLE 29 Term

Image Packaging System Terms


Definition

package FMRI

A package is a collection of files, directories, links, drivers and dependencies in a defined format. FMRI stands for Fault Management Resource Identifier. Each package is represented by a FMRI. See the FMRI section for more information. An image is a location where sets of packages can be consistently installed. An action comprises of a name and a key attribute. A repository is a location where packages are available for download. Also called the depot server.

image action repository

tag attribute

A tag represents the settings of a file. An attribute represents the settings of a package or an action.

Chapter 2 Getting Started With the Image Packaging System

67

Composed May 7, 2008 NetBeans Packages

NetBeans Packages
This table lists all the NetBeans packages that are available in the http://pkg.opensolaris.org:80 repository. The netbeans package is a super set of all the packages listed in the table below.
TABLE 210

netBeans Packages
Description

Package Name

SUNWnetbeans-desktop SUNWnetbeans-ide SUNWlibnb-apisupport1 SUNWlibnb-cnd1 SUNWlibnb-enterprise4 SUNWlibnb-ide8 SUNWlibnb-java1 SUNWlibnb-platform7 SUNWlibnb-profiler2 SUNWlibnb-ruby1 SUNWlibnb-visualweb1 SUNWlibnb-xml1 SUNWnetbeans-cpp SUNWnetbeans-javaee SUNWnetbeans-javase SUNWnetbeans-ruby

GNOME integration icon NetBeans IDE base package NetBeans cluster API support NetBeans C/C++ support NetBeans Java EE support NetBeans cluster IDE NetBeans Java support NetBeans platform NetBeans profiler NetBeans Ruby support NetBeans Web support NetBeans XML support Netbeans C/C++ distribution NetBeans Web & Java EE distribution NetBeans Java SE distribution NetBeans Ruby support

Sun Studio Express 5/08 Packages


Sun Studio Express 5/08 is available as an individual package (sunstudioexpress) and also as part of a larger cluster of packages(ss-dev). The following table lists the components of the ss-dev package:

68

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Web Stack Packages

TABLE 211

Sun Studio Development Packages


Package Name Version Description

Component Name

Sun Studio Express

sunstudioexpress

0.2008.05

Sun Studio Express: C, C++, and Fortran compilers and tools JDK 6.0 Demo Programs JDK 6.0 Host Config JDK 6.0 64bit Runtime Environment JDK 6.0 Runtime Environment JDK 6.0 Man Pages JDK 6.0 Dev Tools JDK 6.0 64bit Dev Tools JDK 6.0 64bit Demo Programs GNU Automake 1.9.6 GNU Automake 1.10 libtool-GNU libtool utility Flex Lexer bison A YACC Replacement Solaris bundled tools

SUNWj6dmo SUNWj6cfg SUNWj6rtx

1.6.0_04 1.6.0_04 1.6.0_04 1.6.0_04 1.6.0_04 1.6.0_04 1.6.0_04 1.6.0_04 1.9.6 1.10 1.5.22 2.5.33 2.3

SUNWj6rt

SUNWj6man SUNWj6dvx SUNWj6dev SUNWj6dmx automake

SUNWgnu-automake-19 SUNWgnu-automake-110

libtool flex bison make gmake cvs

SUNWlibtool

SUNWflexlex SUNWbison

SUNWsprot SUNWgmake SUNWcvs 3.8.1 1.12.13

gmake-GNU make The CVS version control system

Web Stack Packages


The web stack packages, namely , Apache, MySQL, PHP/Perl/Python (AMP) are available to download and install from pkg.opensolaris.org repository. The packages are all bundled together in one single package called amp-dev. The following table lists the individual components of the amp-dev package , these components can be also be downloaded separately.
Chapter 2 Getting Started With the Image Packaging System 69

Composed May 7, 2008 Web Stack Packages

TABLE 212 Component Name

Web Stack Packages


Package Name Version Description

NetBeans

netbeans

6.0.1

Open-source Integrated Development Environment for enterprise, web and mobile applications in Java, C/C++, and Ruby PHP Server PHP Server Documentation PHP Server man pages PHP5 module for PsotgreSQL PHP5 module for MySQL The Python Interpreter, libraries and utilities Event-based framework for internet applications Apache Web Server V2.2 TomCat Connector Plugin for Apache Web Server V2.2 Mod Security For Apache Web Server V2.2 Apache Web Server V2.2 documentation PHP5 module for Apache Web Server V2.2 FastCGI plugin for Apache Web Server V2.2 Dtrace Plugin for Apache Web Server V2.2

PHP

SUNWphp524 SUNWphp524 >doc SUNWphp524 >man SUNWphp524>pgsql SUNWphp524 >-mysql

5.2.4 5.2.4 5.2.4 5.2.4 5.2.4 2.4.4 2.4.4 2.2.8 1.2.25 2.1.5 2.2.8 2.2.6 2.2 0.3.1 5.5.26 5.0.45 5.0.45

Python

SUNWPython SUNWpython>twisted

Apache

SUNWapch22 SUNWapch22m>jk SUNWapch22m>security SUNWapch22d SUNWapch22>php5 SUNWapch22>fcgid SUNWapch22m>dtrace

TomCat MySQL

SUNWtcat SUNWmysql15

mysql MySQL Database Management System(usr component) MySQL Database Management System(Base)

SUNWmysql5>base

70

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Web Stack Packages

TABLE 212 Component Name

Web Stack Packages


Package Name

(Continued)
Version Description

Squid

SUNWsquid

2.6.17

Squid Web Proxy Cache memcached Subversion The CVS version control system WebStack Tools and UI package adds desktop features to operate the Solaris, Apache, MySQL, PHP stack

memcached SUNWmemcached 1.2.2 Subversion cvs WebStack Tools and UI SUNWsvn SUNWcvs webstackui 1.4.3 1.12.13 0.5.11

Chapter 2 Getting Started With the Image Packaging System

71

Composed May 7, 2008

72

Composed May 7, 2008

C H A P T E R

Upgrading and Managing Your Boot Environments

The OpenSolaris 2008.05 release provides new and enhanced tools that enable you to upgrade a boot environment (BE) and to manage multiple boot environments. The following topics are discussed:

How to upgrade an existing boot environment by using the Image packaging System How to create new boot environments and BE snapshots How to activate, mount, or destroy boot environments How to list and manage your boot environments

Upgrading a Boot Environment


The OpenSolaris 2008.05 release enables you to upgrade an installed boot environment (BE) by using the Image Packaging System.
Note This section describes how to upgrade an installed OpenSolaris 2008.05 release with new and revised packages as they become available. Do not use this procedure to upgrade the OpenSolaris Developer Preview 2 release. Instead, see Upgrading from OpenSolaris Preview 2 to OpenSolaris 2008.05 on page 75.

For the OpenSolaris 2008.05 release, use the pkg image-update command to update all installed packages in the current image to the latest available version. Syntax: pkg image-update [-nv] The pkg image-update command upgrades all installed packages in the current boot environment to their latest available version. With the -n option, the command executes, but makes no persistent changes to the image. With the -v option, progress messages are displayed during the operation.
73

Composed May 7, 2008 Upgrading a Boot Environment

In the OpenSolaris 2008.05 release, the upgrade process has been enhanced. In this release, the upgrade process automatically creates a clone: a new, bootable BE. The upgrade process applies the upgrade changes to the clone instead of to the original BE. After successfully completing the changes to the clone and rebooting the system, the upgraded clone is provided as the default, active BE in the GRUB menu. The original BE remains on the GRUB menu as an alternate selection.
Note A clone of the boot environment includes everything hierarchically under the main root dataset of the original boot environment. Shared file systems are not under the root dataset and are not cloned. Instead, the boot environment accesses the original shared file systems.

After upgrading your system, you can use the beadm list command to see a list of the boot environments on the system, including the new BE created by the pkg image-update command. See the following example.
os# pkg image-update A clone of opensolaris exists and has been updated and activated. On next boot the Boot Environment opensolaris-1 will be mounted on /. Reboot when ready to switch to this updated BE. os# beadm list BE Name ---opensolaris opensolaris-1 Active Active on reboot ------ --------yes no no yes Mountpoint Space Used ---------- ----legacy 57.5K 2.59G

In this example, the initial boot environment created by the installer is named opensolaris. The boot environment created by the pkg image-update command is automatically named opensolaris-1. After rebooting to the upgraded boot environment, any inactive boot environment can be destroyed to save space by running the beadm destroy command. For instructions, see How to Destroy an Existing BE on page 82. For further information about the pkg command, see Image Packaging System Documentation and the pkg(1) man page.

Updating Specific Packages


As an alternative to upgrading your entire BE, you can update specific installed packages or package groups in the active BE by using the pkg install command. The pkg install command automatically checks for newer versions of specific packages or package groups, and installs them if they are available. Any dependent packages are also automatically updated.
74 Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

Note The pkg image-update command potentially changes all packages on your system. The pkg install command changes only specific packages or groups of packages.

For further information about updating specific packages, see Image Packaging System Documentation and the pkg(1) man page.

Upgrading from OpenSolaris Preview 2 to OpenSolaris 2008.05


If you have the OpenSolaris Developer Preview 2 release installed on your system, you can either replace Preview 2 with the new OpenSolaris 2008.05 release, or you can use a script to upgrade the OpenSolaris Developer Preview 2 release to the OpenSolaris 2008.05 release. The script to update the Preview 2 release can be dowloaded at: http://opensolaris.org/ os/project/indiana/resources/update_guidelines/indiana-upgrade.sh. A minimum of 2 free Gbytes in your root pool is required to upgrade successfully. Execute this script either with the pfexec command or as root. The script takes a snapshot and makes a clone of the current root(/) and opt file systems. Then, the script updates the clones to the OpenSolaris 2008.05 release. The script also adds the OpenSolaris 2008.05 release as default on the GRUB boot menu.
Caution While this script has received significant testing and does not destroy any existing file systems, back up any irreplaceable data before performing this procedure.

Note You cannot upgrade the OpenSolaris Preview 1 release to the OpenSolaris 2008.05

release. We recommend a fresh install of any machine which was initially installed with Preview 1.

Managing Your Boot Environments (Tasks)


In the OpenSolaris 2008.05 release, you can use a new BE utility to create and manage snapshots and clones of your BEs. The BE utility interface enables you to efficiently manage your boot environments. This new utility is particularly useful for system administrators who want to manage multiple OpenSolaris boot environments on a single system.
Chapter 3 Upgrading and Managing Your Boot Environments 75

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

Advantages of BE Utility
The new BE utility has the following advantages:

The BE utility aggregates all datasets in a BE and performs actions on the entire BE at once. You no longer need to perform ZFS commands to modify each dataset individually. The BE utility manages the dataset structures within BEs. For example, when the BE utility clones a BE that has shared file systems, the utility automatically recognizes and manages those shared file systems for the new BE. The BE utility enables you to perform administrative tasks on your BEs, independent from upgrading your system. The BE utility automatically manages and updates the GRUB menu. For example, when you use the BE utility to create a new BE, that BE is automatically added to the GRUB menu.

The new BE utility, enables you to perform the following tasks:


Create a new BE, based on the active BE Create a new BE, based on an inactive BE Create a snapshot of an existing BE Create a new BE, based on an existing snapshot Activate an existing, inactive BE Mount a BE Unmount a BE Destroy a BE Destroy a snapshot of a BE Rename an existing, inactive BE Display information about your BE snapshots and datasets

Note A clone is a bootable copy of a boot environment. A snapshot is a read-only copy of a file system or boot environment at a given point in time. A snapshot is not bootable.

BE Utility Requirements
To use the new BE utility to manage your boot environments, your system must meet the following requirements.

76

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

TABLE 31

System Requirements
Description

Requirement

OpenSolaris 2008.05 release ZFS file systems

You must have OpenSolaris 2008.05 release installed on your system. Prior OpenSolaris releases did not include the BE utility. For information about installing this release, see Getting Started With OpenSolaris 2008.05. All OpenSolaris Developer releases have ZFS file systems. The BE utility is designed for ZFS file systems.

Limitations in Current Release


Note the following limitations for the OpenSolaris 2008.05 release.

The installation of the OpenSolaris OS supports only one pool on one disk. The BE utility is implemented with ZFS support only. The BE utility manages BEs and snapshots that were created by the BE utility. If a user manually creates the datasets for a BE by using the zfs(1M) command, the BE utility should recognize the BE, but management of this BE might be undefined.

How to Create a New BE, Based on the Active BE


You can use the beadm command to create and mount a new BE that is based on your active BE.
Note When you create a new BE, the process first automatically takes a snapshot of the original BE, then the process makes a new clone that is derived from this snapshot. Both the new snapshot and the new clone are retained by the system.

1 2

Become superuser or assume an equivalent role. At the command line, type the following:
$ beadm create beName

beName is a variable for the name of the new boot environment. This new BE is inactive.
Note beadm create does not create a partial BE. The command either successfully creates a full BE, or the command fails. 3

(Optional) You can use the beadm mount command to mount the new boot environment as follows:
$ beadm mount beName mountpoint
Chapter 3 Upgrading and Managing Your Boot Environments 77

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

Note The mount point must be an already existing directory that is empty.

If the BE is already mounted, the beadm mount command fails and does not remount the BE at the newly specified location. The BE is mounted, but remains inactive. You can upgrade a mounted, inactive BE.
4

(Optional) If you want to boot to this new BE, use the following command to activate the BE:
$ beadm activate beName

beName is a variable for the name of the BE to be activated. On reboot, the newly active BE is displayed as the default selection in the GRUB menu.
Note The GRUB menu always displays the mostly recently activated BE as the default.

Example 31

Creating a New, Cloned BE Dataset (BE2)


The following example illustrates the dataset in a newly created BE. Type the following command.
$ beadm create BE2

The original dataset in this example is BE1. The new boot environment, BE2, is contained in its own dataset. The new BE can also contain separate datasets for traditional file systems, such as /var or /opt.
rpool/ROOT/BE1 rpool/ROOT/BE1/usr rpool/ROOT/BE1/var rpool/ROOT/BE1/opt rpool/ROOT/BE2 rpool/ROOT/BE2/usr rpool/ROOT/BE2/var rpool/ROOT/BE2/opt

rpool in this example is the name of the storage pool. The pool already exists on the system, previously set up by the initial installation or upgrade. ROOT is a special dataset that was also created previously by the initial installation or upgrade. ROOT is reserved exclusively for use by BE roots.

78

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

Example 32

Creating a Clone With Shared File Systems


The following example illustrates the dataset in a newly created BE that has shared file systems. Type the following command.
$ beadm create BE2

In this example, the shared file systems, rpool/export and rpool/export/home, are not cloned when the boot environment is cloned. The shared file systems are located outside the rpool/ROOT/<BE> datasets, and are referenced at their original locations by the cloned BE.
rpool/ROOT/BE1 rpool/ROOT/BE1/usr rpool/ROOT/BE1/var rpool/ROOT/BE1/opt rpool/export rpool/export/home rpool/ROOT/BE2 rpool/ROOT/BE2/usr rpool/ROOT/BE2/var rpool/ROOT/BE2/opt rpool/export/ rpool/export/home

How to Create a New BE, Based on an Inactive BE


By default, a new BE is created from the active BE. However, you can use the beadm create command to create a new boot environment that is based on an existing, inactive boot environment.

1 2

Become superuser or assume an equivalent role. To create a new, inactive BE from an existing, inactive BE, type the following command:
$ beadm create -e non-activeBeName beName

non-activeBeName is a variable for the existing inactive BE that is cloned by this command. beName is the variable for the new BE name. By default, the new BE is inactive.

Chapter 3 Upgrading and Managing Your Boot Environments

79

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

How to Create a Snapshot of a BE


You can manually create a snapshot of an existing BE. A snapshot is a read-only image of a file system or boot environment at a given point in time.

1 2

Become superuser or assume an equivalent role. Use the following command to create a snapshot.
$ beadm create beName@snapshot

Replace the variable, beName@snapshot, with a custom name for your snapshot. The custom name must use the format BEname@snapshotdescription, where BEname is the name of an existing boot environment that you want to make a snapshot from. Type a custom snapshotdescription to identify the date or purpose of the snapshot. Sample snapshot names include:

BE1@0312200.12:15pm BE2@backup BE1@march132008

How to Create a BE From an Existing Snapshot


A snapshot is not bootable. However, you can create a BE, which is bootable, from an existing snapshot as described in this section.

1 2

Become superuser or assume an equivalent role. Use the following command to create a new BE from a snapshot.
$ beadm create -e beName@snapshot beName

Replace the variable, beName@snapshot, with the name of an existing snapshot. As described in the previous task, snapshot names use the format BEname@snapshotdescription, where BEname is the name of an existing boot environment, and snapshotdescription is a description of a specific snapshot made from the existing BE. Replace the variable, beName, with a custom name for your new boot environment. See the following example.
$ beadm create -e BE1@now BE2

This command creates a new BE, named BE2, from the existing snapshot named BE1@now.

80

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

1 2

How to Activate an Existing BE


Become superuser or assume an equivalent role. Use the following command to activate an existing, inactive boot environment:
$ beadm activate beName

beName is a variable for the name of the BE to be activated. Note the following specifications.

beadm activate beName activates a BE by setting the bootable pool property, bootfs, to the value of the ROOT dataset of the BE that is being activated. beadm activate sets the newly activated BE as the default in the menu.lst file.
Note When a BE is created, whether it is active or inactive, an entry is created for the BE on the GRUB menu. The default BE is the last BE that was activated.

Reboot. The newly activated BE is now the default on the GRUB menu.
Note If the BE fails to boot, reboot and select the previous BE from the GRUB menu.

1 2

How to Mount a BE
Become superuser or assume an equivalent role. You can use the beadm mount command to mount a boot environment as follows:
$ beadm mount beName mountpoint

Note The mount point must be an already existing directory that is empty.

If the BE is already mounted, the beadm mount command fails and does not remount the BE at the newly specified location. The BE is mounted but remains inactive. You can upgrade a mounted, inactive BE.

How to Unmount an Existing BE


You can use the beadm command to unmount an existing boot environment.
Chapter 3 Upgrading and Managing Your Boot Environments 81

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

Note You cannot unmount the BE that is currently booted. 1 2

Become superuser or assume an equivalent role. To unmount the BE, type the following:
$ beadm unmount beName

How to Destroy an Existing BE


You can use the beadm command to destroy an existing boot environment. Note the following specifications:

You cannot destroy the BE that is currently booted. The beadm destroy command destroys only the non-shared filesystems of the BE. Shared file systems are located outside of the BE root dataset area and are not affected when a BE is destroyed. In this example, the shared file systems, rpool/export and rpool/export/home, are not destroyed when the boot environment BE2 is destroyed.
rpool/ROOT/BE1 rpool/ROOT/BE1/opt rpool/ROOT/BE2 rpool/ROOT/BE2/opt rpool/export rpool/export/home

The beadm destroy command automatically removes the destroyed BE's entry from the GRUB menu.

1 2

Become superuser or assume an equivalent role. To destroy a BE, type the following:
$ beadm destroy beName

Note The beadm destroy command asks for confirmation before destroying the BE. Add the

-f option to the beadm destroy command to destroy the BE without this confirmation request.

82

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

How to Rename a Boot Environment


The beadm rename command enables you to rename an existing BE. The BE's dataset name is also changed to conform with the new BE name. This command enables you to create a custom name for a BE, a name that is more meaningful for your particular situation.
Note An active BE cannot be renamed. Only an inactive BE can be renamed.

1 2

Become superuser or assume an equivalent role. Use the following command to rename the boot environment:
$ beadm rename beName newBeName

Note If the new name already is in use, the beadm rename fails.

How to Display Information About Your BE, Snapshots, and Datasets


All snapshots, BEs, and datasets that were created by the beadm command can be displayed with the beadm list subcommand. Snapshots and BEs can be created by the beadm command. Snapshots and BEs can also be created by other utilities. For example, the pkg image-update command automatically creates a clone of a BE and upgrades that clone. beadm list also displays BEs that are created by the pkg image-update command. Note the following definitions:

A snapshot is a read-only image of a file system or boot environment at a given point in time. A snapshot is not bootable. A BE is a bootable OpenSolaris environment, consisting of a root file system and, optionally, other file systems mounted underneath it, such as /opt or /var. The root file system and all other file systems of the BE which contain system software are required to be ZFS datasets. Exactly one boot environment can be active at a time. A clone is a BE that was created by copying another BE. A clone is a bootable BE. A dataset is a generic name for ZFS entities such as clones, file systems, or snapshots. The dataset term more specifically refers to the file system specifications for a particular BE or snapshot.

Become superuser or assume an equivalent role.


Chapter 3 Upgrading and Managing Your Boot Environments 83

Composed May 7, 2008 Managing Your Boot Environments (Tasks)

Choose the information that you want to view, as described in this step.

Choose an option for the beadm list command from the following list: -a Lists all available information about the boot environment. This option includes subordinate file systems and snapshots. -d Lists information about a BE's datasets. -s Lists information about a BE's snapshots. -H Omits the header information from the display. Choosing this option results in a display that can be more easily parsed for scripts or other programs.

You can also choose whether to specify a BE name in the beadm list command. By default, if you do not include a BE name in the command, the results include all BEs. But, if you include a BE name in the beadm list command, the results include only information about that BE.

Type the beadm list command with preferred options. For example, include the -a option and specify the BE1 environment as follows:
$ beadm list -a BE1

4 Example 33

Review the information that is displayed.

Viewing BE Specifications
This example includes the -a option and specifies the BE2 environment as follows:
$ beadm list -a BE2

Sample results are displayed.


BE Name ---BE2 Active Active on Mountpoint Space reboot Used ------ --------- ---------- ----no yes /tt 57.5K Mountpoint Space Used ---------- ---------/tt/opt 0

Datasets -------BE2/opt Example 34

Viewing Snapshot Specifications


This example includes the -s option which displays information for any snapshots that exist on the current image. The status of those snapshots is the same list that the zfs(1M) command displays.

84

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 beadm Command Reference

$ beadm list -s BE2

Sample results are displayed.


BE Name ---BE2 BE Name ---BE1 Active Active on Mountpoint Space reboot Used ------ --------- ---------- ----no yes /tt 57.5K Active Active on Mountpoint Space reboot Used ------ --------- ---------- ----no no /tt2 57.5K

BE Active Active on Mountpoint Space Name reboot Used --------- --------- ---------- ----preview2 yes no legacy 2.02G Snapshots --------preview2/opt@install preview2/opt@BE2 preview2/opt@BE1 preview2@BE1 preview2@BE2 preview2@install Policy -----static static static static static static Date created -----------2008-04-05 10:28:42 2008-04-06 20:09:27 2008-04-06 20:09:16 2008-04-06 20:09:16 2008-04-06 20:09:27 2008-04-05 10:28:42

beadm Command Reference


The beadm command, /usr/sbin/beadm, enables users to manage their boot environments. In the OpenSolaris 2008.05 release, the beadmcommand has the following subcommands and options.
TABLE 32

beadm Command
Description

Subcommands

beadm beadm activate

Displays command usage. Makes beName the active BE on next reboot. Syntax: beadm activate beName

Chapter 3 Upgrading and Managing Your Boot Environments

85

Composed May 7, 2008 beadm Command Reference

TABLE 32

beadm Command

(Continued)

Subcommands

Description

beadm create

Creates a new boot environment name, beName. Unless the -e option is provided, the new BE is created as a clone of the currently running BE. Syntax: beadm create [-a] [-e non-activeBeName | beName@snapshot] [-o property=value] ...[-p zpool] beName -a Activate the newly created BE upon creation. The default is to not activate the newly created BE. -e non-activeBeName Create a new BE from an existing, inactive BE. The default is to create the BE from the active BE. -e beName@snapshot Create a new BE from an existing snapshot of the BE named beName. -o property=value Create the datasets for new BE with specific ZFS properties. Multiple -o options can be specified. See zfs(1M) for more information on the -o option. -p zpool Create the new BE in the specified zpool. If this option is not provided, the default behavior is to create the new BE in the same pool as the original BE. beName Name of the boot environment to create. beName@snapshot Name of an existing snapshot of the BE named beName.

beadm create beName@snapshot

Creates a snapshot of the existing BE named beName. Syntax: beadm create beName@snapshot beName@snapshot The snapshot name must use the format, beName@snapshotdescription, where be is the name of an existing boot environment that you want to make a snapshot from. Enter a custom snapshotdescription to identify the date or purpose of the snapshot.

beadm destroy

Destroys the boot environment named beName or destroys an existing snapshot of the boot environment named beName. Syntax: beadm destroy [-f] beName | beName@snapshot -f Does not prompt for confirmation to destroy BE.

86

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 beadm Command Reference

TABLE 32

beadm Command

(Continued)

Subcommands

Description

beadm list

Lists information about the existing boot environment which is beName, or lists information for all boot environments if beName is not provided. Syntax: beadm list [-a | [-ds] [-H] [beName] -a Lists all available information about the boot environment. This information includes subordinate file systems and snapshots. -d Lists information about all subordinate file systems that belong to the boot environment. -s Lists information about the snapshots of the boot environment. -H Prevents listing header information. Example displays without header: BE2:no:yes:mounted:/pool1/BE/BE2:6.2G;;; Without header information, the display information is identified by the following delimiters:

; Delimits BEs, datasets, zones, and snapshots. : Delimits attributes for BEs, datasets, zones, and snapshots. , Delimits multiple datasets, zones, and snapshots. Multiple BEs are delimited with a return (blank line).

Note The -p option can be combined with the other options.

beName - If beName is not provided, the command results display information for all BEs. The default is to list BEs without any additional information. beadm mount Mounts a boot environment named beName at mount point. The mount point must be an already existing, empty directory. Syntax: beadm mount beName mountpoint beadm rename Renames the boot environment named beName to newBeName. Syntax: beadm rename beName newBeName beadm unmount Unmounts the boot environment named beName. Syntax: beadm unmount beName

Chapter 3 Upgrading and Managing Your Boot Environments

87

Composed May 7, 2008 Glossary

Glossary
TABLE 33 Term

Boot Environment Management Terms


Definition

BE utility

The BE utility is the user interface for managing boot environments and is the replacement for the Live Upgrade commands such as luupgrade(1M) and lucreate(1M). This utility uses the new beadm command. To load the system software into memory and start it. An instance of a bootable OpenSolaris environment consisting of a set of mount points, file systems, ZFS datasets, and zones. A boot environment (BE) is a collection of mandatory file systems that are critical to the operation of the Solaris OS. The active boot environment is the one that is currently booted. Exactly one active boot environment can be booted. An inactive boot environment is not currently booted, but can be in a state of waiting for activation on the next reboot. A copy of a boot environment. A clone is bootable. A generic name for the ZFS entities such as clones, file systems, or snapshots. A tree-structured network of files and directories that you can access. The OpenSolaris Developer releases use only ZFS file systems. The process of accessing a directory either from a disk that is attached to the machine that is making the mount request, or from a remote disk on a network. To mount a file system, you need a mount point on the local system. Also, you need the name of the file system to be mounted, for example, /usr file system. A workstation directory to which you mount a file system that exists on a remote machine. A logical group of devices describing the layout and physical characteristics of the available storage. Space for datasets is allocated from a pool. A reversion to the boot environment that ran prior to a specific transaction. Use rollback when you are activating an environment and the boot environment that is designated for booting fails or shows some undesirable behavior. A read-only image of a file system or boot environment at a given point in time. A snapshot is not bootable. The process of removing access to a directory on a disk that is attached to a machine or to a remote disk on a network. The OpenSolaris releases use the pkg image-update command to update all installed packages in the current image to the latest available version.

boot boot environment (BE)

clone dataset file system mount

mount point pool rollback

snapshot unmount upgrade

88

Getting Started With OpenSolaris 2008.05 May 2008

Composed May 7, 2008 Glossary

TABLE 33 Term

Boot Environment Management Terms


Definition

(Continued)

update

In the OpenSolaris releases, the pkg install command automatically checks for newer versions of specific packages or package groups, and installs or updates them if they are available. Any dependent packages are also automatically updated. A file system that uses storage pools to manage physical storage.

ZFS

Chapter 3 Upgrading and Managing Your Boot Environments

89

Composed May 7, 2008

90

Vous aimerez peut-être aussi