Friday, February 27, 2009

Adding packages to zones

In Opensolaris 2008.11 you can create zones. But in contrast to zones in Solaris these Opensolaris zones do not contain packages from the global zone but a small set of dedicated packages, that are installed directly in the zone.
So there are no more sparse zones, that inherit the packages from the global zone and you have to install additional packages via pkg command. (No more pkgadd!)
If your local zone has no internet access you can install packages from the global zone as well. Although this is not documented. But the zoneadm -install does exactly this. Look at /usr/lib/brand/ipkg/pkgcreatezone
  1. Make sure the local zone is halted.
  2. From the global zone mount the local zone's root file system.
  3. Set the envrironment variable PKG_IMAGE=/wherever/the/rootfs/is/mounted
  4. Set the environment variable PKG_CACHE=/var/pkg/download
  5. Use the regular pkg command. It will install in the zoneroot: pkg install SUNWmypackage
  6. Unset at least PKG_IMAGE. Otherwise subsequent pkg install in the global zone will fail.
  7. Boot the local zone.

No comments:

Post a Comment