Ok. This is a Jurassic Park moment, just go with it. We’re not going to ask or answer the question of whether or not we should do this, we’re just going to do it. Here’s why: I am in need of the lx zone work that Joyent has integrated into the Illumos kernel they’re using for SmartOS. I could quite easily ssh into my SmartOS server and spin up zones for testing there but I’m looking for a slightly more controlled feedback loop. I’d like to use these zones for development on my local workstation as opposed to having to have access to my servers/network connectivity.

So. I could quite easily run OmniOS without a desktop environment as a virtualbox or vmware machine but sometimes I really just prefer the trappings of a native workstation experience. Now should you do this for your daily driver? I think that depends on your needs. Also, don’t let anybody tell you what to do. If you like Solaris and want to use it as your workstation then damnit, you oughta.

So first thing’s first. We’re going to make a couple big assumptions here which are: You have an x86 OmniOS machine, said OmniOS machine has access to the Internet, your current user account has root level permissions.

The first thing is first. We’re going to bootstrap our fresh OmniOS machine with Joyent’s delightful fork of NetBSD’s pkgsrc tooling. To get started, let’s fill a script with the following content (slightly modified from the pkgsrc homepage).

fubar@grenada:~$ vi bootstrap.sh

Go ahead and add the following content. We've commented out the pgp check because it's cleaner for the sake of a quick blog post. That being said if you've got gpg installed on your Illumos box you should consider uncommenting the pgp verification.

# # Copy and paste the lines below to install the 64-bit set. # BOOTSTRAP_TAR="bootstrap-2017Q3-x86_64.tar.gz" BOOTSTRAP_SHA="10bb81b100e03791a976fb61f15f7ff95cad4930" # Download the bootstrap kit to the current directory. curl -O https://pkgsrc.joyent.com/packages/SmartOS/bootstrap/${BOOTSTRAP_TAR} # Verify the SHA1 checksum. [ "${BOOTSTRAP_SHA}" = "$(/bin/digest -a sha1 ${BOOTSTRAP_TAR})" ] || echo "ERROR: checksum failure" # Verify PGP signature. This step is optional, and requires gpg. #curl -O https://pkgsrc.joyent.com/packages/SmartOS/bootstrap/${BOOTSTRAP_TAR}.asc #curl -sS https://pkgsrc.joyent.com/pgp/DE817B8E.asc | gpg --import #gpg --verify ${BOOTSTRAP_TAR}{.asc,} # Install bootstrap kit to /opt/local tar -zxpf ${BOOTSTRAP_TAR} -C / # Add to PATH/MANPATH. PATH=/opt/local/sbin:/opt/local/bin:$PATH MANPATH=/opt/local/man:$MANPATH

Let's make this thing executable and run it.

fubar@grenada:~$ sudo chmod +x bootstrap.sh && sudo ./bootstrap.sh

Awesome now pkgsrc and it’s primary cli utility pkgin are going to live in /opt/local . A majority of the software we are going to install is going to live in and around that dir path so we’re going to want to modify our path. If you have an ~/.profile we’ll make the path modifications there. If you’ve already got a ~/.bash_profile or the like feel free to add these lines there instead.

fubar@grenada:~$ sudo vi ~/.profile

Add these lines to the bottom of this script.

PKGSRC_BIN=/opt/local/bin PKGSRC_SBIN=/opt/local/sbin PKGSRC_MAN=/opt/local/man PATH=${PKGSRC_SBIN}:${PKGSRC_BIN}:${PATH} MANPATH=${PKGSRC_MAN}:${MANPATH} export PATH export MANPATH

Lastly here, let's source this file or do whatever you prefer for reloading your path and then verify that our fresh binary is available.

fubar@grenada:~$ source /etc/profile fubar@grenada:~$ pkgin help ... TRUNCATED OUTPUT ...

Sweet! Assuming you got a bunch of output we're ready to start hacking together a workstation. To start we're going to need a package from IPS.

fubar@grenada:~$ sudo pkg install xsvc

Next let's install the necessary meta package to run X11.

fubar@grenada:~$ sudo pkgin install modular-xorg

This thing is going to install a ton of stuff. Not all of it are likely to be packages you'll need to run, but if you're coming from a Linux workstation other than Arch you're likely used to a pretty bloated OS so just go with it. If you'd prefer to pull down JUST what you need to run X11 you can instead go this alternative xorg install:

# If you ran the previous command this is of no use to you. fubar@grenada:~$ sudo pkgin install modular-xorg-server modular-xorg-apps modular-xorg-fonts xf86-input-keyboard xf86-input-mouse # And finally your GPU driver. Hopefully you know the one you need. # Most common will be nv and nouveau for nvidia, vmware, or ati fubar@grenada:~$ sudo pkgin install xf86-video-FOO

Note: If you’re attempting this in virtualbox you will use xf86-video-vesa and it will not be fun because theres currently an incompatibility between virtualbox guest additions and the version of Xorg we’ve just installed.

Sweet. Now just for shits and giggles let’s install a shell thats a little more fully featured than ksh.

fubar@grenada:~$ sudo pkgin install zsh fubar@grenada:~$ sudo usermod -s /opt/local/bin/zsh username

Just about finished now. One of the last things we'll need to do is to decide what desktop environment we want to use. For the sake of this guide we're going to go with gnome. It's easily modified, and will come with plenty of desktop tools baked in. SOME of the other pre-packaged DEs available are kde4, xfce, and mate. But, suffice to say if you want i3 or many others it should be relatively trivial to compile for Illumos. That being said consider this a warning this meta-package is going to install an ABSURD amount of junk. For the sake of this blog post its nice to have clear steps for getting from zero to having a graphical desktop environment but personally I think I would opt out of gnome and wedge in some i3 or xfce. Something a bit lighter weight.

fubar@grenada:~$ sudo pkgin install gnome

Now theres only a couple things left to do and they’re going to depend on you as a user. If you don’t care about having a desktop manager like gdm installed that launches every time you boot, you can simply modify your ~/.xinitrc to call the appropriate binary and you’ll simply call startx after logging in.

fubar@grenada:~$ touch ~/.xinitrc && echo "exec gnome-session" > ~/.xinitrc fubar@grenada:~$ startx

If you are the type of person that wants a desktop manager you have a couple more things to do. I’ll return here late to finish this up with information on adding gdm and Xorg to start with smf! For now, get to hacking!