Monday, February 1, 2016

Solaris - Setting up GUI

Solaris was the first UNIX-like system I worked with but I hadn't touched it since Solaris 9. I had to setup Oracle Identity Manager on Solaris 11 for a project recently. To practice, I installed an x86 version on my local VirtualBox. To my surprise, I couldn't find a GUI installer for Solaris 11 (or rather I must have not looked enough). So after installing the text installer, I had to install X11 on it.

The following steps made it possible. Do note that you must have access to the internet from within your guest VM to be able to execute the below steps successfully and must be root (or equivalent).

root@sol1:~# beadm list 
BE      Flags Mountpoint Space Policy Created         
--      ----- ---------- ----- ------ -------         
solaris NR    /          3.33G static 2016-01-29 04:16

This command shows the boot environments available. What we are trying to do, is to install the GUI into a new boot environment while working on the text-based console (default boot environment). Once the GUI boot environment is setup, we'll switch to it and delete the text based one.

root@sol1:~# beadm create sol-gui
root@sol1:~# beadm mount sol-gui /gui
root@sol1:~# beadm list

BE      Flags Mountpoint Space  Policy Created         
--      ----- ---------- -----  ------ -------         
sol-gui -     /gui       187.5K static 2016-01-29 05:15
solaris NR    /          3.33G  static 2016-01-29 04:16

These commands will create a new boot environment and mount it against the file system. The "sol-gui" and "/gui" could be anything.

root@sol1:~# pkg -R /gui install group/system/solaris-desktop
Packages to install: 367
Services to change:  13

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                            367/367   48040/48040  624.7/624.7  340k/s

PHASE                                          ITEMS
Installing new actions                   80531/80531
Updating package state database                 Done
Updating package cache                           0/0
Updating image state                            Done
Creating fast lookup database                   Done
Updating package cache                           1/1

The pkg command lets you install a package (in this case, the X11 packages) in a given directory. This process will take a while depending on the speed of the internet connection you have.

root@sol1:~# bootadm update-archive -R /gui 
Use bootadm command to then update the existing boot archives, basically telling Solaris that there is another boot environment we want to register in the boot menu (updates GRUB).

root@sol1:~# beadm umount sol-gui
root@sol1:~# beadm activate sol-gui

These commands will unmount the new boot environment and activate it.
 
root@sol1:~# beadm list

BE      Flags Mountpoint Space Policy Created         
--      ----- ---------- ----- ------ -------         
sol-gui R     -          5.77G static 2016-01-29 05:15
solaris N     /          4.52M static 2016-01-29 04:16

The flags "R" means active on reboot and "N" means active now.

root@sol1:~# init 6

Reboot the system for settings to take place. After reboot, the new boot environment (sol-gui) will become the default.

root@sol1:~# beadm list

BE      Flags Mountpoint Space Policy Created         
--      ----- ---------- ----- ------ -------         
sol-gui NR    /          6.06G static 2016-01-29 05:15
solaris -     -          5.30M static 2016-01-29 04:16

root@sol1:~# beadm destroy solaris
Are you sure you want to destroy solaris?  This action cannot be undone(y/[n]): y

This command will delete the old text based boot environment leaving just the GUI based one.

root@sol1:~# beadm list

BE      Flags Mountpoint Space Policy Created         
--      ----- ---------- ----- ------ -------         
sol-gui NR    /          5.98G static 2016-01-29 05:15


No comments:

Post a Comment