17 Nov 2005
root@dougal # mkdir -p /zones/dbzone root@dougal # zonecfg -z dbzone dbzone: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:dbzone> create zonecfg:dbzone> set zonepath=/zones/dbzone zonecfg:dbzone> set autoboot=true zonecfg:dbzone> add fs zonecfg:dbzone:fs> set dir=/usr/local zonecfg:dbzone:fs> set special=/zones/dbzone/usrlocal zonecfg:dbzone:fs> set type=lofs zonecfg:dbzone:fs> end zonecfg:dbzone> add fs zonecfg:dbzone:fs> set dir=/var zonecfg:dbzone:fs> set special=/zones/dbzone/var zonecfg:dbzone:fs> set type=lofs zonecfg:dbzone:fs> end zonecfg:dbzone> add net zonecfg:dbzone:net> set address=192.168.1.22 zonecfg:dbzone:net> set physical=hme0 zonecfg:dbzone:net> end zonecfg:dbzone> add device zonecfg:dbzone:device> set match=/dev/sound/* zonecfg:dbzone:device> end zonecfg:dbzone> add attr zonecfg:dbzone:attr> set name=comment zonecfg:dbzone:attr> set type=string zonecfg:dbzone:attr> set value="This is the database zone" zonecfg:dbzone:attr> end zonecfg:dbzone> verify zonecfg:dbzone> commit zonecfg:dbzone> exit root@dougal #... now install the zone ...
root@dougal # zoneadm -z dbzone install
Preparing to install zone <dbzone>.
Creating list of files to copy from the global zone.
Copying <16546> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <765> packages on the zone.
Initializing package <9> of <765>: percent complete: 1%
.... takes a while ....
Initializing package <9> of <765>: percent complete: 99%
Initialized <765> packages on zone.
Zone <dbzone> is initialized.
Installation of these packages generated warnings: <SUNWpmowu>
The file <zones/dbzone/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
root@dougal #
Now we can boot and login to the new zone.
Note that we need to this at pretty much the same time (or from different terminals) as the console will boot into something very similar to the normal text-based Solaris install screen.
In practice, the zone will take quite a while to boot initially, going through (on my system) 89 SMF scripts before starting into the actual install (sysidcfg) process.
root@dougal # zoneadm -z dbzone boot ; zlogin -C dbzone
[Connected to zone 'dbzone' console]
Hostname: dbzone
Loading smf(5) service descriptions: 24/89
The install process involves the following questions (in the normal F2 format):
- Language
- Locale
- Terminal
- creates ssh keys (rsa/dsa)
- hostname
- kerberos
- name servers
- timezone
- root password
- override default NFS4 domain name?
rebooting system due to change(s) in /etc/default/init
[NOTICE: Zone rebooting]
SunOS Release 5.10 Version Generic_118822-18 64-bit
Copyright 1983-2005 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: dbzone
dbzone console login: root
Password:
Last login: Wed Nov 16 23:28:00 on console
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
dbzone console #
And install mysql:
dbzone console # pkgadd -d mysql-4.0.21-sol10-sparc-local
... etc ...
Then configure mysql in the usual way.
Articles - Solaris Zones