Welcome to Machine Unix

Search Below

Installing A Locale to A Solaris Zone

Recently I had to install a locale to one of my zones in my Solaris server. To do that I’ve used localeadm command. It is certainly possible to install packages manually from a solaris 10 dvd or cd but localeadm does this for you and it is easier.

For the curious, here is the packages list.

Since I decided to use localeadm I had to make dvd available to the zone itself. There are numerous methods of doing this, such as changing the zone configuration file to allow cdrom access. But I happened to have the iso itself so I decided to mount it to a temporary location in the global zone such as /mnt and made that file system available to non-global zone.

# mount -F hsfs -o ro `lofiadm -a /root/Downloads/ISO/sol10_1008.iso` /mnt
# ls /mnt

Docs Misc Patches Product Tools rr_moved

Now, /mnt contains Solaris 10 iso, I made it available to zone’s /mnt file system:

# mount -F lofs /mnt /zones/zruby/root/mnt

Logged in to zone:

# zlogin zruby

Sun Microsystems Inc. SunOS 5.10 Generic January 2005
root@zruby# ls /mnt
Docs Misc Patches Product Tools rr_moved

Great! I have the Solaris 10 iso mounted in the zone without making changes to the configuration file. Now I can start using localeadm to install the locale I need. In this case I am installing en_US.UTF-8.

root@zruby# localeadm -a en_US.UTF-8 -d /mnt/Product/

The installer will warn you about installing bunch of locales and hit ‘yes’ to begin installing. At one point installer might finish with an error that says something about a locale could be installed only from global zone but en_US.UTF-8 should be installed.

To check if the locale is there, you can type the following command:

root@zruby# localeadm -lc

You might see bunch of outputs on the screen however at the end, you can see the locale itself:

The following regions are installed on zruby on Mon Apr 27 19:04:39 CDT 2009

POSIX (C)

North America (nam)
[ en_CA.ISO8859-1, en_CA.UTF-8, en_US.ISO8859-1, en_US.ISO8859-15, en_US.UTF-8, es_MX.ISO8859-1, es_MX.UTF-8, fr_CA.ISO8859-1, fr_CA.UTF-8 ]

Done.
A copy of this report can be found in /var/sadm/system/data/locales.list

As you can see, en_US.UTF-8 is listed above.