Sunday Jul 06, 2008

Script to Configure VNC Server in Solaris 10 5/08 and Solaris Express (Nevada)

I have been using a script for a while to configure VNC server displays for Solaris Express (Nevada) and I just found out that the same script works on Solaris 10 5/08 (Solaris 10 Update 5) as it includes Xvnc also.

I always do a  full install of Solaris. If you don't, then maybe Xvnc will not be installed on your system. You can easily check:

# pkginfo | grep  xvnc
system      SUNWxvnc                         X11/VNC server

You run the below script once after OS installation is complete. It sets up two VNC displays and you connect to them with a  VNC client as <hostname>:1 and <hostname>:2 . The second display is shared.

# Run this script once after OS installation is completed.
# This has been tested with Solaris 10 5/08 and Solaris Express (Nevada) b87 onwards

#add vnc display 1
svccfg -s application/x11/x11-server add display1
svccfg -s application/x11/x11-server:display1 addpg options application
svccfg -s application/x11/x11-server:display1 addpropvalue options/server astring: "/usr/X11/bin/Xvnc"
svccfg -s application/x11/x11-server:display1 addpropvalue options/server_args astring: '"SecurityTypes=None"'

#add vnc display 2, which is shared
svccfg -s application/x11/x11-server add display2
svccfg -s application/x11/x11-server:display2 addpg options application
svccfg -s application/x11/x11-server:display2 addpropvalue options/server astring: "/usr/X11/bin/Xvnc"
svccfg -s application/x11/x11-server:display2 addpropvalue options/server_args astring: '"SecurityTypes=None"'
svccfg -s application/x11/x11-server:display2 addpropvalue options/server_args astring: '"-alwaysshared"'

# Configure dtlogin to start it
if [ ! -d /etc/dt/config ] ; then
        mkdir -p /etc/dt/config
if [ ! -f /etc/dt/config/Xservers ] ; then
        cp /usr/dt/config/Xservers /etc/dt/config/Xservers

echo "   :1   Local local_uid@none root /usr/X11/bin/Xserver :1" >> /etc/dt/config/Xservers
echo "   :2   Local local_uid@none root /usr/X11/bin/Xserver :2" >> /etc/dt/config/Xservers

pkill -HUP dtlogin


The displays persist when you disconnect the VNC client, so you can come back to a session at  later time and all the windows and applications will be as you left them. Any jobs you kicked off will have continued to run.

You can get VNC client software from There is a Free Edition and an enhanced Personal Edition for which you need a license.

If you have an older release of Solaris 10 than 5/08 then take a look at my earlier blog entry about how to configure VNC.

References: 1, 2

Friday Jul 04, 2008

A Simple VNC Server and GDM Configuration Example for OpenSolaris 2008.05

My requirement was to be able to connect my VNC client to a system running OpenSolaris 2008.05 and to be able to login as root. I have now done this successfully on a  system running the original OpenSolaris 2008.05 binary distribution and on a system running OpenSolaris 2008.05 after I ran a full image update to snv_91.

Update September 19th 2008: This procedure does not work if you have updated the image to snv_97 but does work if you update the image to snv_98. The upgrade from snv_97 to snv_98 wiped out the entries I had made in /etc/X11/gdm/custom.conf so I had to make those again. I have added an extra step at the end, based on Chris Drake's comments, to make the VNS server session persist if you exit the client.

1. Check that the VNC Server is Installed

This should be present as it is part of the 2008.05 binary distribution, but I checked anyway.

# pkg info SUNWxvnc
          Name: SUNWxvnc
       Summary: X11/VNC server
         State: Installed
     Authority: (preferred)
       Version: 4.1.2
 Build Release: 5.11
        Branch: 0.91
Packaging Date: Fri Jun 13 17:49:25 2008
          Size: 6.3 MB
          FMRI: pkg:/SUNWxvnc@4.1.2,5.11-0.91:20080613T174925Z

2. Add this line to /etc/services

vnc-server      5900/tcp                        # Xvnc

3. Edit /etc/X11/gdm/custom.conf as below


4. Enable the Services

# svcadm enable xvnc-inetd
# svcs xvnc-inetd
STATE          STIME    FMRI
online         16:22:30 svc:/application/x11/xvnc-inetd:default
# svcadm enable gdm
# svcs gdm
STATE          STIME    FMRI
online         14:43:13 svc:/application/graphical-login/gdm:default

5. Connect to the Display with a VNC Client

You should now be able to connect to <hostname>:5900 and you should see the gdm login screen.

If you cannot connect, try stopping & starting the services:

# svcadm disable xvnc-inetd gdm
# svcadm enable xvnc-inetd gdm

6. Making the Session Persist

This may or may not be desirable for you, but if you want the VNC session to persist if you exit the VNC client then do the following:

# svccfg -s xvnc-inetd

svc:/application/x11/xvnc-inetd> editprop

This take you into a vi session. Look for the line...

#setprop inetd/wait = boolean: false

Copy the line, uncomment it and set it to true. Save the file, exit svccfg and run the command...

# svcadm refresh xvnc-inetd

Connect again with you VNC client. Now, when you exit/kill the VNC client, the session on the server will persist and you will be able to connect to it again.

You may now want to add an extra level of security to enable password protection on your VNC server. That is something that I have been unable to make work...and from searching around, it seems that others have a similar problem.

References: 1, 2

Monday Jul 09, 2007

Update on VNC and Solaris 10

[Update July 6 2008: If you are running Solaris 10 5/08 (Solaris 10 Update 5) or later then go here.]

In an old blog entry I went through the process of how to set up VNC on Solaris 10, or rather, I referenced some work others have done.

I have recently been building a system with Solaris 10 11/06 (aka Solaris 10 Update 3) on a server and I decided to see if newer versions of the VNC packages I had previously used are available now. It turns out that they are, and that only two of the three previously required packages are now needed.

Here is what I did to ensure that I had the most up to date VNC packages:

  1. Downloaded the "old" packages and scripts via BigAdmin as previously described, and unpacked them.

  2. Downloaded the new SFWgcmn & SFWvnc packages from the Solaris 10 11/06 OS Companion Software DVD. You can go here and download the individual packages you need.

  3. Had a look at the unpacked software and replaced the instances of the old downloaded packages with the new ones.

  4. Modified the script configsol10vnc.ksh so that it only looked for SFWgcmn.pkg & SFWvnc.pkg..that is just a one line change...

    packages="SFWgcmn.pkg SFWgcc34l.pkg SFWvnc.pkg"


    packages="SFWgcmn.pkg SFWvnc.pkg"

  5. I also hashed out this line in configsol10vnc.ksh with no ill effects:

    # fix_gnome_bug

You can now use the configsol10vnc.ksh script to install and configure VNC as before.

It is not vital that you do this, the old packages work fine, but it is always nice to have the latest stuff running..isn't it!

Saturday May 26, 2007

How To Quickly Install and Configure VNC On Solaris 10

[Update July 6 2008: If you are running Solaris 10 5/08 (Solaris 10 Update 5) or later then go here.]

I am based in the UK and the computers I use are all in Colorado or California, so remote desktops are vital to me. For Windows I used the Windows Remote Desktop software and for Solaris I use VNC.

I just found a great resource posted by Salix Training on BigAdmin. They have bundled up all the packages from the Solaris companion CD that you need for VNC to work on Solaris 10 SPARC & x86 and have provided an installation script which installs the packages and does all the configuration required...this is great, I have been doing this manually for ages and it is very fiddly.

Go here to read more. You can download the packages you need from the links at the bottom of this web page.

My personal experience was this:

I downloaded the Solaris 10 x86 zip file from their website, unzipped it, and ran the script installsol10vnc.ksh. It did the whole installation and configuration for me at one go, you don't actually need to follow the step-by-step instructions on the web page. They also provide a script vncmod.ksh to modify/manage your virtual displays!

One thing I noticed that was different from when I have installed and used VNC in the past was that there are no entries added to /etc/services or /etc/inetd.conf as the integration is now done at the Xserver level. The details of the displays are in the file /etc/dt/config/Xservers. I am used to looking in /etc/services or /etc/inetd.conf to find the addresses for the various VNC displays. Using these new packages, the VNC display addresses are hostname:1 through hostname:9 and you use vncmod.ksh to modify/manage the resolutions the displays run at. All the displays are shared.

You can get VNC viewers for most operating systems from

There is an update on this topic in this blog entry.


Tim Thomas


« July 2016