vnc server will not start automatically xauth not in the path error

Posted on 2008-11-11
Last Modified: 2013-12-27
I get an error on my console when booting my Solaris 8 sparc system (it shows briefly) XAUTH path error.
vncserver will not start automatically.

However vncserver will run no problem
#/etc/rc2.d/S99vncserver start

S99vncserver contains a line:
perl /usr/local/bin/vncserver :1 -name root

#which xauth

#echo $PATH

So it looks like at boot time Solaris does not have the correct PATH prior to executing rc2.d/S99vncserver.

Question by:FKoutchouk
    LVL 22

    Expert Comment

    In Solaris 8, the directory /usr/openwin/bin is added to your path by xsession when you log into the X server. It is not on the default path. So, when your vncserver startup script runs at system boot time, /usr/openwin/bin is not on root's path, so vncserver cannot find the xauth executable. When you log in and run it manually, the path is inherited from your session, so it works then.

    Just change the startup script to add /usr/openwin/bin to the path before starting the vncserver.
    LVL 1

    Author Comment

    Thanks.  Where do I make that change?
    LVL 22

    Expert Comment


    That assumes that /etc/rc2.d/S99vncserver is correctly set as a hard link to the above file.
    LVL 1

    Author Comment

    there is no /etc/init.d/vncserver  
    The file is in /usr/local/bin/
    S99vncserver has the line:
    /usr/bin/perl /usr/local/bin/vncserver :1 -name root

    I modified the lines system to include the path as follows:
    system("/usr/openwin/bin/xauth -f $xauthorityFile add $host:$displayNumber . $cookie");
    system("/usr/openwin/bin/xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie");

    but I still get the same error.
    Any other thoughts?
    LVL 22

    Accepted Solution

    If you have a file /etc/rc2.d/S99vncserver, you should also have a file /etc/init.d/vncserver and they should be hard links to one another. But actually it shouldn't hurt if you do not.

    In any case, in the file /etc/rc2.d/S99vncserver, near the beginning, you need to add /usr/openwin/bin to the PATH environment variable and then export the variable. The S99vncserver file should be a bourne shell script, so you should be able to just add these lines to the script:

    export PATH
    LVL 1

    Author Comment

    Thanks, based on your information I also added the path for Xvnc and the HOME
    export PATH
    export HOME

    vncserver does come up automatically, and I can connect to it.  But there is no CDE UI -- just a grey screen and the Solaris mouse pointer.
    Almost there... any thoughts?
    LVL 22

    Expert Comment

    You need to also start up the CDE window manager.  It is dtwm.

    Look in /.vnc for a file called xstartup. You need to add a line to it that starts dtwm and puts it in the background:

    dtwm &
    LVL 1

    Author Comment

    Thank you.
    already contains
    /usr/dt/bin/dtwm &

    In the blade150:1.log I see the following:
    Got connection from client
    Protocol version 3.3
    Pixel format for client
    8 bpp, depth 6
    true colour: max r 3 g 3 b 3, shift r 4 g 2 b 0
    rfbProcessClientNormalMessage: ignoring unknown encoding type -239
    <same as above> -223
    <same as above> 16
    <same as above> 15
    Using hextile encoding for client
    ... and some more stuff

    It may not be relevant, of course.
    LVL 22

    Expert Comment

    When you are connected to the vncserver, in another session run the ptree command and find the vncserver and the subtree with its children. Post that section of the ptree output.
    LVL 1

    Author Comment

    I launched the vnc client for user sol1a (grey screen, just a terminal session)
    Then I started another vnc client and connected as user root (that works fine). In a terminal session I then issued the ptree command.
    The output is listed in the code below
    49    /usr/lib/sysevent/syseventd
    57    devfsadmd
    62    /usr/lib/picl/picld
    142   /usr/sbin/rpcbind
    166   /usr/sbin/inetd -s
      382   rpc.ttdbserverd
      476   rpc.rstatd
    179   /usr/lib/nfs/statd
    177   /usr/lib/nfs/lockd
    194   /usr/sbin/syslogd
    185   /usr/lib/autofs/automountd
      186   /usr/lib/autofs/automountd
    202   /usr/sbin/cron
    231   /usr/lib/power/powerd
    218   /usr/lib/lpsched
    212   /usr/sbin/nscd
    236   /usr/lib/utmpd
    246   /usr/sbin/vold
    243   /usr/sadm/lib/smc/bin/smcboot
      244   /usr/sadm/lib/smc/bin/smcboot
    264   /usr/lib/ab2/dweb/sunos5/bin/dwhttpd /usr/lib/ab2/dweb/data
      265   /usr/lib/ab2/dweb/sunos5/bin/dwhttpd /usr/lib/ab2/dweb/data
    306   /usr/dt/bin/dtlogin -daemon
      316   /usr/openwin/bin/Xsun :0 -nobanner -auth /var/dt/A:0-TGaqMa
      317   /usr/dt/bin/dtlogin -daemon
        397   /bin/ksh /usr/dt/bin/Xsession
          407   /usr/openwin/bin/fbconsole
          446   /usr/dt/bin/sdt_shell -c       unset DT;      DISPLAY=:0;        /u
            449   -bash -c       unset DT;      DISPLAY=:0;        /usr/dt/bin/dtse
              459   /usr/dt/bin/dtsession
                461   dtwm
                  581   /usr/dt/bin/dtexec -open 0 -ttprocid 2.196tZa 01 458 128963
                    582   /usr/bin/admintool
                462   /usr/dt/bin/dtfile -geometry +700+0
                  489   /usr/dt/bin/dtfile -geometry +700+0
                463   /usr/dt/bin/dthelpview -helpVolume Intromgr
                465   /usr/dt/bin/sdtperfmeter -f -H -t cpu -t disk -s 1 -name fppe
                771   /usr/dt/bin/dtexec -open 0 -ttprocid 1.196tZa 01 458 12896370
                  772   /usr/dt/bin/dtscreen -mode blank
    309   /usr/local/sbin/sshd
    322   /usr/openwin/bin/fbconsole -d :0
    376   /usr/lib/saf/sac -t 300
      379   /usr/lib/saf/ttymon
    361   /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
      383   mibiisa -r -p 32792
    377   /usr/lib/saf/ttymon -g -h -p blade150 console login:  -T sun -d /dev/cons
    370   /usr/lib/dmi/snmpXdmid -s blade150
    369   /usr/lib/dmi/dmispd
    411   /usr/openwin/bin/speckeysd
    447   /usr/dt/bin/dsdm
    458   /usr/dt/bin/ttsession
    467   /bin/ksh /usr/dt/bin/sdtvolcheck -d -z 5 cdrom,zip,jaz,dvdrom,rmdisk
      488   /bin/cat /tmp/.removable/notify467
    1037  Xvnc :1 -desktop X -httpd /usr/local/vnc/classes -auth /home/sol1a/.Xauth
    1045  xterm -geometry 80x24+10+10 -ls -title X Desktop
      1046  -sh
        1104  twm
    1069  Xvnc :2 -desktop root -httpd /usr/local/vnc/classes -auth //.Xauthority -
    1074  xterm -geometry 80x24+10+10 -ls -title root Desktop
      1075  -bash
        4301  -bash
          4537  -bash
            4876  ptree
    1077  /usr/dt/bin/dtwm
    1079  ttsession -s -d unix:2.0
      1377  /bin/sh -c dtfile -noview
        1378  dtfile -noview
          1381  dtfile -noview

    Open in new window

    LVL 22

    Expert Comment

    Okay, it looks to me like the vncserver did not start up any child processes or run anything to get the session going.

    Where did you get the vncserver package you are using?
    LVL 1

    Author Comment

    I downloaded it from  The package is vnc-3.3.3r2-sol8-sparc-local.gz
    vncserver runs just fine, ie. with CDE UI under the following conditions when launched at startup or manually and vnc client logs in as root
    (I launch two a :1 for sol1a and :2 for root in S99vncserver)
    In other words, :2 works fine.

    Looking further into the problem, I am wondering if it isn't related to something else.  When I get to the console (not often), upon login as sol1a, the screen turns weird: mouse but dark screen, with the CPU meter occasionally popping in the upper left corner.  Login as root works fine, with CDE UI.

    In other words, maybe the fact I do not see the UI is caused by a UI problem with the useraccount itself.
    Is there an easy way to "reset" the user UI to "default" so that I can see if it also solves the vncserver problem?
    LVL 22

    Expert Comment

    You could delete the .dt directory in the home directory.

    In general, it is a bad idea to have a gui session running as root. It is better to have another user and then su to root in the xterm sessions as necessary.
    LVL 1

    Author Closing Comment

    I never solved my problem fully.  But with the information provided by BLU in his/her multiple answers, I believe others will have more luck.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
    Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. Please see for the updated article. It is avail…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now