Solaris installation

Contents

Introduction

We use Solaris in VMware ESXi. It also works in other VMware products, e.g. VMware Fusion, and it also seems to work in VirtualBox.

This is an installation walkthrough in VMware Fusion.

We use Solaris 10, because that’s what CRAN uses. Solaris 11 is probably similar.

Base OS

  1. Download the Solaris 10 ISO from https://www.oracle.com/solaris/solaris10/downloads/solaris10-get-jsp-downloads.html

  2. Then add a new virtual machine.

  3. Select “image” and use the downloaded image.

  1. You probably want to customize the defaults, and have a bigger disk.
  1. For that you need to save the VM first.
  1. Choose “Hard Disk”
  1. Choose the size tha suits you
  1. You might want to change the memory size and number of processors.
  1. We are ready to go
  1. The default is fine
  1. Here we use the interacive GUI installer (1).
  1. Keyboard
  1. Ready to start the GUI
  1. GUI starting up
  1. Select installer language
  1. Welcome to the GUI installer
  1. Network we need, yes
  1. We want DHCP, the host will provide it.
  1. We might as well allow IPv6.
  1. We don’t need Kerberos.
  1. We don’ need DNS or other name service, either.
  1. We don’t need NFSv4, so the default is fine for this.
  1. Select the time zone as you wish.
  1. Make sure the time is correct.
  1. Set the root password.
  1. You don’t actually need to enable remote services to have ssh.
  1. You can register to Oracle if you want.
  1. No need for any proxies
  1. Network setup summary
  1. Yet another welcome screen
  1. Installer options
  1. Eject the DVD via VMware if the reboot does not start the installed system.
  1. Install media is the DVD.
  1. Accept the license
  1. We’ll do a custom install.
  1. Select installed locales.
  1. Select default locale.
  1. No additional products.
  1. We can install the entire product.
  1. Select disk to install on.
  1. Customize disk partitions
  1. Instead of the default partitions on the first picture we are better off with the ones on the second, because it is simpler to manage a single partition, instead of the old-school server setup.
  1. Ready to install
  1. Rebooting after install
  1. Console login. Do not log in here, wait for the graphical login screen.
  1. GUI login. Log in as the root user. Select the Java Desktop GUI after login. Or select it in the Options menu before logging in.
  1. TADA!
  1. Open a terminal
  1. Test the network connection
  1. Install OpenCSW

Setup ssh

  1. Add a regular user
  1. Check our IP address

You can use this IP address (192.168.49.128 on the picture) to ssh into the Solaris box, using the newly created user. (The default ssh server configuration does not allow ssh logins for the root user.)

In VMware Fusion ssh works automatically. In VirtualBox you might need to use port forwarding. On ESXi you need to set up a port forward in the firewall.

Set up sudo

This lets you log in as a regular user and still run configuration tasks. OpenCSW has sudo:

pkgutil -y -i sudo
echo 'rhub ALL=(ALL) NOPASSWD: ALL' >/etc/opt/csw/sudoers.d/rhub

Install Oracle Developer Studio

  1. You need to download Oracle Developer Studio (ODS), even if you only want to use GCC from OpenCSW. The reason for this is that ODS comes with a number of patches, and without these patches GCC does not work properly. Namely, g++ is not a proper C++11 compiler if they are not installed. If you are sure that you don’t need ODS, then just install the patches, either by calling the install_patches.sh shell script directly, or from the graphical installer and then cancel the installation.

Once ssh works, you can copy a downloaded tarball of Oracle Developer Studio to the machine. First download it on the host machine. I.e. not inside the installed Solaris box, because default Solaris installation does not have any browser with a strong enough encryption for the HTTPS download from Oracle.

You can download it at https://www.oracle.com/tools/developerstudio/downloads/developer-studio-jsp.html You need the SVR4 installer on x86.

Then copy this to the machine.

  1. Then install ODS on the guest
  1. You’ll need to install some patches first, but the installer can do that for you. Choose “More Info” and then “Execute install_patxches.sh now”. Do not worry about the incompatible Java version, that is about the GUI developer tools, which we won’t use. (Or you can update Java later.)

To check that the patches are properly installed, call this from a terminal: showrev -p | less. My version of ODS came with six patches, and these five were installed: 119967-02, 120754-17, 119964-35, 152227-01, 152229-01. Check that they are installed.

  1. Once the patches have been applied, the installer is ready to go.
  1. First you need to select the installation location. /opt is as good as any. Do not create symlinks in /usr/bin, as we try to avoid mixing the GNU compilers from OpenCSW and the ODS compilers
  1. One last summary.
  1. Installing happily.
  1. Quick test once the installation is done.

Various other configuration tasks

Set up environment for users

We need to set some environment variables for all users:

You can add this to the end of the /etc/profile file:

TZ=Europe/London
PATH=/opt/csw/sbin:/opt/csw/bin:/bin:/sbin:/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/sfw/sbin:/usr/ccs/bin
MANPATH=/opt/csw/share/man:/usr/sfw/share/man:/usr/share/man
PKG_CONFIG_PATH=/opt/csw/lib/pkgconfig
export TZ PATH MANPATH PKG_CONFIG_PATH

Make sure that Xvfb works

Xvfb simulates a GUI session, so e.g. plotting works in our non-GUI R CMD check sessions. The setup is different for Solaris 10 and 11 and also for Sparc and i386. Some ship two windowing systems, both the old Xsun and the new Xorg, so these have two Xvfb programs, and they works slightly differently.

We use the Xorg one, that is in /usr/X11R6/bin, with a random display number, in the script that runs our check. See setup_xcvfb() here: https://github.com/r-hub/solarischeck/blob/master/slave.sh

For this to work, we need to set the mode of the /tmp/.X11-pipe directory properly. The only setup that seems to work for all users (with a warning) is this:

sudo chmod 1777 /tmp/.X11-pipe/
ls -ld /tmp/.X11-pipe/
#> drwxrwxrwt   2 root     root        1194 Apr 29 08:55 /tmp/.X11-pipe/

Add more software

TeX

See install_tex() in https://github.com/r-hub/solarischeck/blob/master/install.sh

Quite a lot of TeX packages are needed. Currently:

function install_tex() {
    sudo pkgutil -y -i \
	 texlive_base \
	 texlive_binaries \
	 texlive_common \
	 texlive_fonts_extra \
	 texlive_fonts_recommended \
	 texlive_latex_base \
	 texlive_latex_base_binaries \
	 texlive_latex_extra \
	 texlive_latex_extra_binaries
}

Some TeX packages are huge and take a long time to download. You can download them manually with wget, from the repo at https://mirror.opencsw.org/opencsw/testing/i386/5.10/ and then uncompress them with gunzip and install them with pkgadd -d. The wget download at least shows a progress bar, and you can also continue downloading a partial file.

If an .sty or other TeX file is missing, search at https://www.opencsw.org/search/ to see which package has it.

Other system requirements

We have a list of system requirements, for various CRAN packages here: https://github.com/r-hub/solarischeck/blob/master/sysreqs.txt and install.sh installs them like this currently:

function install_sysreqs() {
    (
	    set -e
	    tools=$(cat sysreqs.txt)
	    sudo pkgutil -y -i $tools
    )
}

Installing R

We have updated R in OpenCSW, but it has not been published yet, so pkgutil will install an old version currently. You can install a newer version from R-hub like this:

function install_r_opencsw() {
    sudo pkgutil -y -i libreadline7
    sudo pkgutil -y -i curl
    sudo pkgutil -t https://files.r-hub.io/opencsw -y -i r_base
}

(The libreadline7 and curl packages are a temporary workaround.)

Building the OpenCSW version of R

See the packaging tutorial here: https://www.opencsw.org/2012/12/gar-setup-and-packaging-tutorial/

Building R with OSD

The setup that actually works well for us is at https://github.com/r-hub/solarischeck/blob/master/config.site.cc This worked for R 4.0.0