Table of Contents

OpenIndiana

Web :: an enthusiastic austrian solaris user

OpenIndiana (OI) is a fork of OpenSolaris.
Since the acquisition of Sun by Oracle OpenSolaris has become somewhat less open.

These are notes relating to my install of OI.
Some of this is based on work by others - their work is appreciated and noted.

Some commands in Solaris are quite different from Linux; some of the following may seem a bit basic but is nonetheless relevant.

Mount CDROM

root@am-oi-01:~# mount -F hsfs -o ro /dev/dsk/c1t1d0s2 /media
root@am-oi-01:~# ls /media

Install VirtualBox guest additions

My OI runs in a VirtualBox VM, this explains how to install guest additions.

## Your cd might be different - depends on VirtualBox version
root@am-oi-01:~# cd /media/VBOXADDITIONS_4.1.0_73009
root@am-oi-01:~# pkgadd -d VBoxSolarisAdditions.pkg

Upgrade from OI_148 to OI_151

Updated 2012-05-04
OI_151a has been available for a while. I've left this here just to document the OS upgrade process.

# pfexec pkg set-publisher --non-sticky openindiana.org
# pfexec pkg set-publisher -P -O http://pkg.openindiana.org/dev-il/ openindiana.org

## May or may not need to run this.
# pfexec pkg install SUNWipkg

## Following may fail with warning that pkg is out of date
## If you see that message then update pkg
# sh-4.0# pfexec pkg install pkg:/package/pkg

# pkg image-update --be-name OI_151 --require-new-be
...
DOWNLOAD                                  PKGS       FILES    XFER (MB)
locale/mr                                0/928     0/23264    0.0/
...
Completed                              928/928 23264/23264  424.0/424.0

PHASE                                        ACTIONS
Removal Phase                            16553/16553 
Install Phase                            12574/12574 
Update Phase                             32990/32990 

PHASE                                          ITEMS
Package State Update Phase                 1704/1704 
Package Cache Update Phase                   856/856 
Image State Update Phase                         2/2 

A clone of openindiana exists and has been updated and activated.
On the next boot the Boot Environment OI_151 will be mounted on '/'.
Reboot when ready to switch to this updated BE.

---------------------------------------------------------------------------
NOTE: Please review release notes posted at:

http://docs.sun.com/doc/821-1479
---------------------------------------------------------------------------

Install NAPP-IT

For web based admin of ZFS Web

wget -O - www.napp-it.org/nappit | perl

...
############################################################################
 
        -thats it, have fun
        -connect your browser to http://serverip:81
 
your network-ip's:
	inet 127.0.0.1 netmask ff000000 
	inet 192.168.178.45 netmask ffffff00 broadcast 192.168.178.255
 
############################################################################

 -> install-log see /root/setup-napp-it.log 
 -> If you need AFP (Apple File Service): wget -O - www.napp-it.org/afp | perl 
 -> If you need AMP (Apache, mySQL, PHP): wget -O - www.napp-it.org/amp | perl 
 
 -> If you did a first-time install, now reenter root-password with passwd root
    (needed for smb-sharing) and reboot your system afterwards!!!! 

    If you like napp-it, please support us and donate at napp-it.org 

Post-Install

Mirror the install disk (root pool)

References:
Constantin Gonzalez
Troubleshooting primary mirror failure in root pool

Setup CIFS share

## http://download.oracle.com/docs/cd/E19082-01/820-2429/createstaticsmbsharezfstask/index.html

root@am-oi-01:~# zfs set sharesmb=on data/media
root@am-oi-01:~# sharemgr show -vp
default nfs=()
zfs
    zfs/data/media smb=()
	  data_media=/data/media
smb smb=()
	* /var/smb/cvol	 smb=()	""
		  c$=/var/smb/cvol	 smb=(abe="false" guestok="false")	"Default Share"

root@am-oi-01:~# zfs set sharesmb=name=media data/media

root@am-oi-01:~# sharemgr show -vp
default nfs=()
zfs
    zfs/data/media smb=()
	  media=/data/media
smb smb=()
	* /var/smb/cvol	 smb=()	""
		  c$=/var/smb/cvol	 smb=(abe="false" guestok="false")	"Default Share"

Printing

## Ref: http://dlc.sun.com/osol/docs/content/SYSADPRTSVCS/gfnqz.html

## CUPS admin
http://localhost:631/

## Enable network printer discovery
root@am-oi-01:~# svcadm enable printers:snmp

## Verify service is running
root@am-oi-01:~# svcs device-discovery/printers
STATE          STIME    FMRI
online         13:50:16 svc:/network/device-discovery/printers:snmp

## After a short period should get a notification that printer has been discovered.
## Can then configure printer from printer manager

## Post discovery
## - change printer URI to socket://IP-address:port
## - change default paper type to A4

## Printer capabilities
root@am-oi-01:~# zsh
am-oi-01# for udi in $(hal-find-by-capability --capability printer) ; do ; lshal --show $udi --long ; done
udi = '/org/freedesktop/Hal/devices/network_attached/LLADDR_000D9D28A20D'
  printer.commandset = {'MLC', 'PCL', 'PML', 'DW-PCL', 'DESKJET', 'DYN'} (string list)
  info.product = 'Officejet 7400 series'  (string)
  org.freedesktop.Hal.Device.Printer.method_argnames = {'make model'} (string list)
  org.freedesktop.Hal.Device.Printer.method_execpaths = {'hal_lpadmin --configure'} (string list)
  org.freedesktop.Hal.Device.Printer.method_signatures = {'ss'} (string list)
  org.freedesktop.Hal.Device.Printer.method_names = {'Configure'} (string list)
  info.interfaces = {'org.freedesktop.Hal.Device.Printer'} (string list)
  info.callouts.remove = {'hal_lpadmin --remove'} (string list)
  info.addons = {'hal_lpadmin --add'} (string list)
  info.callouts.add = {'hald-probe-network-printer'} (string list)
  info.udi = '/org/freedesktop/Hal/devices/network_attached/LLADDR_000D9D28A20D'  (string)
  printer.description = '6543'  (string)
  printer.product = 'Officejet 7400 series'  (string)
  printer.vendor = 'HP'  (string)
  printer.serial = 'LLADDR-000D9D28A20D'  (string)
  printer.device = 'socket://192.168.178.100:9100'  (string)
  network_device.address = '192.168.178.100'  (string)
  info.capabilities = {'printer', 'network_device'} (string list)
  info.category = 'printer'  (string)
  info.parent = '/org/freedesktop/Hal/devices/network_attached'  (string)

Netbeans 7.0 - PHP

## Download: http://netbeans.org/downloads/index.html

alan@am-oi-01:~/Downloads$ chmod 700 netbeans-7.0-ml-php-solaris-x86.sh
alan@am-oi-01:~/Downloads$ ./netbeans-7.0-ml-php-solaris-x86.sh
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...

## graphical installer runs ...

OpenOffice

Preferred over LibreOffice as it correctly identifed Solaris as the O/S and offered an appropriate download. ## Download: http://www.openoffice.org/

## Extract files from archive to convenient location

## Setup has to be run as admin user (I used root)

alan@am-oi-01:~/Downloads$ cd OOO330_m20_native_packed-1_en-US.9567

alan@am-oi-01:~/Downloads/OOO330_m20_native_packed-1_en-US.9567$ ls -l
total 541
drwxrwxr-x  5 alan staff      5 2011-01-17 16:48 installdata
-rw-rw-r--  1 alan staff 431879 2011-01-17 16:47 JavaSetup.jar
drwxrwxr-x  2 alan staff      4 2011-01-17 16:47 licenses
drwxrwxr-x 53 alan staff     53 2011-01-17 16:48 packages
drwxrwxr-x  2 alan staff      4 2011-01-17 16:47 readmes
-rwxrwxr-x  1 alan staff  14627 2011-01-17 16:47 setup
-rwxrwxr-x  1 alan staff   3925 2011-01-17 16:47 update

alan@am-oi-01:~/Downloads/OOO330_m20_native_packed-1_en-US.9567$ sudo ./setup
Password:
Using /usr/bin/java
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode)

Running installer
/usr/bin/java -DHOME=/home/alan -jar JavaSetup.jar
System locale: en_US
Root privileges
OS: SunOS
Mode: installation
Path to packages: /home/alan/Downloads/OOO330_m20_native_packed-1_en-US.9567/packages/

## graphical installer runs ...

Virtualbox

## Download: http://www.virtualbox.org/wiki/Downloads ## Install instructions: http://www.virtualbox.org/manual/ch02.html#idp5660880

root@am-oi-01:~# zonename
global

root@am-oi-01:/home/alan/Downloads# gunzip -cd VirtualBox-4.0.8-71778-SunOS.tar.gz | tar xvf -
VirtualBox-4.0.8-SunOS-r71778.pkg
LICENSE
autoresponse
ReadMe.txt

root@am-oi-01:/home/alan/Downloads# pkgadd -d VirtualBox-4.0.8-SunOS-r71778.pkg

The following packages are available:
  1  SUNWvbox     Oracle VM VirtualBox
                  (i386) 4.0.8,REV=2011.05.16.19.12.71778

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:

Processing package instance <SUNWvbox> from </home/alan/Downloads/VirtualBox-4.0.8-SunOS-r71778.pkg>

Oracle VM VirtualBox(i386) 4.0.8,REV=2011.05.16.19.12.71778
Oracle Corporation
## Executing checkinstall script.
## Processing package information.
## Processing system information.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

The following files are being installed with setuid and/or setgid
permissions:
  /opt/VirtualBox/amd64/VBoxBFE <setuid root>
  /opt/VirtualBox/amd64/VBoxHeadless <setuid root>
  /opt/VirtualBox/amd64/VBoxNetAdpCtl <setuid root>
  /opt/VirtualBox/amd64/VBoxNetDHCP <setuid root>
  /opt/VirtualBox/amd64/VBoxSDL <setuid root>
  /opt/VirtualBox/amd64/VirtualBox <setuid root>
  /opt/VirtualBox/i386/VBoxBFE <setuid root>
  /opt/VirtualBox/i386/VBoxHeadless <setuid root>
  /opt/VirtualBox/i386/VBoxNetAdpCtl <setuid root>
  /opt/VirtualBox/i386/VBoxNetDHCP <setuid root>
  /opt/VirtualBox/i386/VBoxSDL <setuid root>
  /opt/VirtualBox/i386/VirtualBox <setuid root>

Do you want to install these as setuid/setgid files [y,n,?,q] ?
        The package being installed appears to contain processes which will
        have their effective user or group ids set upon execution.  History
        has shown that these types of processes can be a source of security
        problems on your system.  If you choose not to install these as setuid
        files, installation will proceed but these specific files will be
        installed as regular files with setuid and/or setgid permissions
        reset.  Note that sane operation of the software being installed may
        require that these files be installed with setuid or setgid
        permissions as delivered; thus choosing to install them as regular
        files may cause inapropriate operation.  If you wish to stop
        installation of this package, enter 'q' to quit.

Do you want to install these as setuid/setgid files [y,n,?,q] y

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWvbox> [y,n,?]

Installing Oracle VM VirtualBox as <SUNWvbox>

## Installing part 1 of 1.
/etc/hostname.vboxnet0
/opt/VirtualBox/64/VBoxPython.so
/opt/VirtualBox/64/VBoxPython2_4.so
/opt/VirtualBox/64/VBoxPython2_5.so
/opt/VirtualBox/64/VBoxPython2_6.so
/opt/VirtualBox/LICENSE
/opt/VirtualBox/UserManual.pdf
/opt/VirtualBox/VBox.sh
...
/usr/share/mime-info/virtualbox.keys
/usr/share/mime-info/virtualbox.mime
/usr/share/mime/packages/virtualbox.xml
/usr/share/pixmaps/VBox.png
[ verifying class <none> ]
/opt/VirtualBox/VBoxBalloonCtrl <linked pathname>
/opt/VirtualBox/VBoxHeadless <linked pathname>
/opt/VirtualBox/VBoxISAExec <linked pathname>
/opt/VirtualBox/VBoxManage <linked pathname>
/opt/VirtualBox/VBoxSDL <linked pathname>
/opt/VirtualBox/VBoxTestOGL <linked pathname>
/opt/VirtualBox/VBoxZoneAccess <linked pathname>
/opt/VirtualBox/VirtualBox <linked pathname>
/opt/VirtualBox/vboxwebsrv <linked pathname>
/opt/VirtualBox/webtest <linked pathname>
[ verifying class <manifest> ]
## Executing postinstall script.
Checking for older bits...
Installing new ones...
Loading VirtualBox kernel modules...
   - Loaded: Host module
   - Loaded: NetAdapter module
   - Loaded: NetFilter module
   - Loaded: USBMonitor module
   - Loaded: USB module
Configuring services...
   - Loaded: Zone access service
Installing MIME types and icons
Installing Python bindings...
   - Installed: Bindings for Python 2.4
   - Installed: Bindings for Python 2.6
Updating the boot archive...

Installation of <SUNWvbox> was successful.

## In file manager: double click Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack
## to install default extension pack for USB2.0, RDP, etc support

Fonts

## Download: http://www.freedesktop.org/software/fontconfig/webfonts/

Unpack webfonts.tar.gz
Go to msfonts directory
Open, e.g., verdan32.exe
Then open the TTF files in font viewer and click install.
Fonts will be installed in, e.g., /home/alan/.fonts and will be accessible by OpenOffice and other apps.

Webmin

## Download: http://www.webmin.com/solaris.html

That page also has install instructions.
Install suggests that admin user will created with current root password, that didn't work for me.
Changing the admin (root) webmin password was easy enough:

root@am-oi-01:/home/alan/Downloads# /opt/webmin/changepass.pl /etc/webmin root xxxxxx
Updated password of Webmin user root

Firefox

Download Firefox 12 from here
Unpack the dowloaded file using archive manager or bunzip2
Extract the resulting tar archive into a directory and run firefox-bin.
Works for me.

Download Adobe Flash Player from http://get.adobe.com/flashplayer/

Thanks to an enthusiastic austrian solaris user for the download links and advice.

ZFS

Sharing ZFS filesystem
ZFS best practices
Oracle Solaris 11 Express Information Library
Oracle Solaris ZFS Administration Guide

Zones

System Administration Guide: Oracle Solaris Zones
OpenIndiana Zones

Zone quick setup

Create the zone using zonecfg

root@oi0001:~# zonecfg -z vm
vm: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:vm> create
zonecfg:vm> add net
zonecfg:vm:net> set physical = e1000g0
zonecfg:vm:net> set address = 192.168.178.45
zonecfg:vm:net> end
zonecfg:vm> set zonepath = /vm
zonecfg:vm> commit
zonecfg:vm> exit 

Install the zone

## Note that mountpoint permissions must be changed before zone will install
root@oi0001:~# zoneadm -z vm install
/vm must not be group readable.
/vm must not be group executable.
/vm must not be world readable.
/vm must not be world executable.
could not verify zonepath /vm because of the above errors.
zoneadm: zone vm failed to verify

root@oi0001:~# chmod 700 /vm

root@oi0001:~# zoneadm -z vm install
   Publisher: Using openindiana.org (http://pkg.openindiana.org/dev-il/ ).
   Publisher: Using opensolaris.org (http://pkg.openindiana.org/legacy/).
       Image: Preparing at /vm/root.
       Cache: Using /var/pkg/download. 
Sanity Check: Looking for 'entire' incorporation.
  Installing: Core System (output follows)
               Packages to install:     1
           Create boot environment:    No
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  1/1         3/3      0.0/0.0

PHASE                                        ACTIONS
Install Phase                                  15/15 

PHASE                                          ITEMS
Package State Update Phase                       1/1 
Image State Update Phase                         2/2 
               Packages to install:    49
           Create boot environment:    No
               Services to restart:     3
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                49/49 21406/21406  116.1/116.1

PHASE                                        ACTIONS
Install Phase                            27096/27096 

PHASE                                          ITEMS
Package State Update Phase                     49/49 
Image State Update Phase                         2/2 
  Installing: Additional Packages (output follows)
               Packages to install:    48
           Create boot environment:    No
               Services to restart:     2
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                48/48   4890/4890    28.4/28.4

PHASE                                        ACTIONS
Install Phase                              6669/6669 

PHASE                                          ITEMS
Package State Update Phase                     48/48 
Image State Update Phase                         2/2 

        Note: Man pages can be obtained by installing SUNWman
 Postinstall: Copying SMF seed repository ... done.
 Postinstall: Applying workarounds.
        Done: Installation completed in 1660.809 seconds.

  Next Steps: Boot the zone, then log into the zone console (zlogin -C)
              to complete the configuration process.

Boot the zone

root@oi0001:~# zoneadm -z vm boot
zone 'vm': WARNING: e1000g0:1: no matching subnet found in netmasks(4): 192.168.178.45; using default of 255.255.255.0.

Login to zone

First login to zone will run setup and configuration.

root@oi0001:~# zlogin -C vm
[Connected to zone 'vm' console]
Hostname: vm
Loading smf(5) service descriptions: 3/3
...
[Connected to zone 'vm' console]
Hostname: vm
Loading smf(5) service descriptions: 3/3
Creating new rsa public/private host key pair
Creating new dsa public/private host key pair
Configuring network interface addresses: e1000g0.
System identification is completed.

## Enters text mode installer here
## Setting terminal type (the first question) to vt100 worked best for me

rebooting system due to change(s) in /etc/default/init
[NOTICE: Zone rebooting]


SunOS Release 5.11 Version oi_151 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
Hostname: oi002

[NOTICE: Zone rebooting]


SunOS Release 5.11 Version oi_151 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
Hostname: oi002

oi002 console login: root
Password: 
Aug 19 14:37:40 oi002 login: ROOT LOGIN /dev/console
OpenIndiana (powered by illumos)    SunOS 5.11    oi_151a    August 2011

Subsequent login to zone are more simple.

root@oi0001:~# zlogin -C dmz
[Connected to zone 'dmz' console]
Hostname: oi000

oi000 console login: root
Password: 
Aug 23 11:22:08 oi000 login: ROOT LOGIN /dev/console
Last login: Tue Aug 23 09:24:57 on console
OpenIndiana (powered by illumos)    SunOS 5.11    oi_151a    August 2011
root@oi000:~# 

Install package in zone

Following zone creation you will certainly need to install some packages.

Attempts to install non-existent package will fail with error -

root@oi000:/etc# pkgadd SUNWbind
pkgadd: ERROR: no packages were found in </var/spool/pkg>

Successful package installation -

root@oi000:~# pkg install nano
               Packages to install:     1
           Create boot environment:    No
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  1/1       51/51      0.4/0.4

PHASE                                        ACTIONS
Install Phase                                132/132 

PHASE                                          ITEMS
Package State Update Phase                       1/1 
Image State Update Phase                         2/2 

Get zone stat's

root@oi0001:~# zonestat 5 1
Collecting data for first interval...
Interval: 1, Duration: 0:00:05
SUMMARY                    Cpus/Online: 1/1   Physical: 1023M    Virtual: 1535M
                    ----------CPU---------- ----PHYSICAL----- -----VIRTUAL-----
               ZONE  USED %PART  %CAP %SHRU  USED   PCT  %CAP  USED   PCT  %CAP
            [total]  0.04 4.81%     -     -  741M 72.4%     -  962M 62.6%     -
           [system]  0.01 1.95%     -     -  299M 29.2%     -  507M 33.0%     -
             global  0.02 2.81%     -     -  404M 39.5%     -  424M 27.6%     -
                 vm  0.00 0.04%     -     - 37.6M 3.67%     - 30.7M 2.00%     -

Halt a zone

root@oi0001:~# zoneadm -z vm halt
zone 'vm': zone is already halted

Update zone image

Zone must be attached but halted.

root@oi0001:~# pkg -R /dmz/root image-update -v

Uninstall zone

root@oi0001:~# zoneadm -z vm uninstall
Are you sure you want to uninstall zone vm (y/[n])? y
root@oi0001:~# 

DNS

bind

Put named configuration files on a separate ZFS filesystem so that they survive upgrades, etc.

root@oi0001:~# zfs create -o mountpoint=/var/named rpool/named
root@oi0001:~# 

Assuming we are using and logged in to a separate zone then install bind.

root@oi000:~# pkg install SUNWbind
               Packages to install:     2
           Create boot environment:    No
               Services to restart:     1
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  2/2       25/25      2.5/2.5

PHASE                                        ACTIONS
Install Phase                                  88/88 

PHASE                                          ITEMS
Package State Update Phase                       2/2 
Image State Update Phase                         2/2