This discussion is archived
11 Replies Latest reply: Oct 26, 2012 1:17 AM by BillyVerreynne RSS

Unable to start vncserver on OEL5.6

user11952526 Newbie
Currently Being Moderated
Hi,

I am unable to start vncserver on OEL5.6 (32-bit) and NO output can be viewed in monitor.
FYI...
# vncserver
Unable to start Xvnc, exiting

==========================================================================
Note :

# echo $SHELL
/bin/bash
[root@linux1][root]
# cat /etc/passwd | grep root
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
[root@linux1][root]
# /etc/init.d/vncserver status
Xvnc is stopped
[root@linux1][root]
# /etc/init.d/vncserver restart
Shutting down VNC server: 1:root 2:oraprd1 [FAILED]
Starting VNC server: 1:root
Warning: linux1.oracle.com:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server linux1.oracle.com:1
A VNC server is already running as :1
[FAILED]
[root@linux1][root]
# set -x
++ echo -ne '\033]0;root@linux1:~'

[root@linux1][root]
# source /etc/init.d/vncserver start
+ source /etc/init.d/vncserver start
++ . /etc/init.d/functions
+++ TEXTDOMAIN=initscripts
+++ umask 022
+++ PATH=/sbin:/usr/sbin:/bin:/usr/bin
+++ export PATH
+++ '[' -z 158 ']'
+++ '[' -z '' ']'
++++ /sbin/consoletype
+++ CONSOLETYPE=pty
+++ '[' -f /etc/sysconfig/i18n -a -z '' ']'
+++ . /etc/profile.d/lang.sh
++++ sourced=0
++++ for langfile in /etc/sysconfig/i18n '$HOME/.i18n'
++++ '[' -f /etc/sysconfig/i18n ']'
++++ . /etc/sysconfig/i18n
+++++ LANG=en_US.UTF-8
+++++ SYSFONT=latarcyrheb-sun16
++++ sourced=1
++++ for langfile in /etc/sysconfig/i18n '$HOME/.i18n'
++++ '[' -f /root/.i18n ']'
++++ '[' -n '' ']'
++++ '[' 1 = 1 ']'
++++ '[' -n en_US.UTF-8 ']'
++++ export LANG
++++ '[' -n '' ']'
++++ unset LC_ADDRESS
++++ '[' -n '' ']'
++++ unset LC_CTYPE
++++ '[' -n '' ']'
++++ unset LC_COLLATE
++++ '[' -n '' ']'
++++ unset LC_IDENTIFICATION
++++ '[' -n '' ']'
++++ unset LC_MEASUREMENT
++++ '[' -n '' ']'
++++ unset LC_MESSAGES
++++ '[' -n '' ']'
++++ unset LC_MONETARY
++++ '[' -n '' ']'
++++ unset LC_NAME
++++ '[' -n '' ']'
++++ unset LC_NUMERIC
++++ '[' -n '' ']'
++++ unset LC_PAPER
++++ '[' -n '' ']'
++++ unset LC_TELEPHONE
++++ '[' -n '' ']'
++++ unset LC_TIME
++++ '[' -n '' ']'
++++ unset LC_ALL
++++ '[' -n '' ']'
++++ unset LANGUAGE
++++ '[' -n '' ']'
++++ unset LINGUAS
++++ '[' -n '' ']'
++++ unset XKBCHARSET
++++ consoletype=pty
++++ '[' -z pty ']'
++++ '[' -n '' ']'
++++ '[' -n '' ']'
++++ '[' -n en_US.UTF-8 ']'
++++ case $LANG in
++++ '[' xterm = linux ']'
++++ unset SYSFONTACM SYSFONT
++++ unset sourced
++++ unset langfile
+++ '[' -z '' ']'
+++ '[' -f /etc/sysconfig/init ']'
+++ . /etc/sysconfig/init
++++ BOOTUP=color
++++ GRAPHICAL=yes
++++ RES_COL=60
++++ MOVE_TO_COL='echo -en \033[60G'
++++ SETCOLOR_SUCCESS='echo -en \033[0;32m'
++++ SETCOLOR_FAILURE='echo -en \033[0;31m'
++++ SETCOLOR_WARNING='echo -en \033[0;33m'
++++ SETCOLOR_NORMAL='echo -en \033[0;39m'
++++ LOGLEVEL=3
++++ PROMPT=yes
++++ AUTOSWAP=no
+++ '[' pty = serial ']'
+++ '[' color '!=' verbose ']'
+++ INITLOG_ARGS=-q
+++ __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
++ . /etc/sysconfig/network
+++ NETWORKING=yes
+++ NETWORKING_IPV6=yes
+++ HOSTNAME=linux1.oracle.com
+++ GATEWAY=192.168.1.1
++ '[' yes = no ']'
++ unset VNCSERVERARGS
++ VNCSERVERS=
++ '[' -f /etc/sysconfig/vncservers ']'
++ . /etc/sysconfig/vncservers
+++ VNCSERVERS='1:root 2:oraprd1'
+++ VNCSERVERARGS[1]='-geometry 800x600'
++ prog='VNC server'
++ case "$1" in
++ start
++ echo -n 'Starting VNC server: '
Starting VNC server: ++ ulimit -S -c 0
++ RETVAL=0
++ '[' '!' -d /tmp/.X11-unix ']'
++ NOSERV=1
++ for display in '${VNCSERVERS}'
++ NOSERV=
++ echo -n '1:root '
1:root ++ unset BASH_ENV ENV
++ DISP=1
++ export USER=root
++ USER=root
++ export 'VNCUSERARGS=-geometry 800x600'
++ VNCUSERARGS='-geometry 800x600'
++ runuser -l root -c 'cd ~root && [ -f .vnc/passwd ] && vncserver :1 -geometry 800x600'

Warning: linux1.oracle.com:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server linux1.oracle.com:1
A VNC server is already running as :1
++ RETVAL=29
++ '[' 29 -ne 0 ']'
++ break
++ test -n ''
++ '[' 29 -eq 0 ']'
++ failure 'vncserver start'
++ local rc=1
++ '[' color '!=' verbose -a -z '' ']'
++ echo_failure
++ '[' color = color ']'
++ echo -en '\033[60G'
++ echo -n '['
[++ '[' color = color ']'
++ echo -en '\033[0;31m'
++ echo -n FAILED
FAILED++ '[' color = color ']'
++ echo -en '\033[0;39m'
++ echo -n ']'
]++ echo -ne '\r'
++ return 1
++ '[' -x /usr/bin/rhgb-client ']'
++ /usr/bin/rhgb-client --details=yes
++ return 1
++ echo

++ '[' 29 -eq 0 ']'
++ echo -ne '\033]0;root@linux1:~'

[root@linux1][root]
# set +x
+ set +x
==========================================================================
Thanks.
Joy.

Edited by: user11952526 on Oct 24, 2012 8:10 PM
  • 1. Re: Unable to start vncserver on OEL5.6
    Dude! Guru
    Currently Being Moderated
    Stopping or restarting the vncserver service does not stop running or locked up vncserver processes.

    You can type the following to see which users and processes are providing VNC access:

    <pre>
    ps -ef | grep vnc
    </pre>

    To stop or kill a vncserver process, use the following, for example:

    <pre>
    # vncserver -kill :1
    Killing Xvnc process ID 2693

    # su - dude
    $ vncserver -kill :2
    Killing Xvnc process ID 2759
    </pre>

    To fix you problem, try:

    <pre>
    # rm -rf /tmp/.X1-lock
    # vncserver
    </pre>
  • 2. Re: Unable to start vncserver on OEL5.6
    user11952526 Newbie
    Currently Being Moderated
    Hi,

    I do NOT see any process running...

    # ps -ef | grep vnc
    root 4293 4206 0 01:13 pts/1 00:00:00 grep vnc
    [root@linux1][root]
    # vncserver -kill :1

    Can't find file /root/.vnc/linux1.oracle.com:1.pid
    You'll have to kill the Xvnc process manually

    Thanks.
    Joy.
  • 3. Re: Unable to start vncserver on OEL5.6
    Dude! Guru
    Currently Being Moderated
    If you currently do not have any vncserver running than there is nothing to kill. You can try to cleanup by removing the /tmp/.X1-lock file, restart the vncerver service and type "vncserver" to start a process in your account
  • 4. Re: Unable to start vncserver on OEL5.6
    user11952526 Newbie
    Currently Being Moderated
    Hi,

    Same issue...

    [root@linux1][tmp]
    # ls -l /tmp/.X1-lock*
    ls: /tmp/.X1-lock*: No such file or directory

    [root@linux1][tmp]
    # vncserver
    Unable to start Xvnc, exiting

    Thanks.
    Joy.
  • 5. Re: Unable to start vncserver on OEL5.6
    Dude! Guru
    Currently Being Moderated
    What is your output of:

    ls -l /tmp/.*lock

    cat /etc/sysconfig/vncservers
  • 6. Re: Unable to start vncserver on OEL5.6
    BillyVerreynne Oracle ACE
    Currently Being Moderated
    user11952526 wrote:

    Same issue...

    [root@linux1][tmp]
    # vncserver
    Unable to start Xvnc, exiting
    The error is generated by the following code block in the vncserver Perl script:
    if (!(-e "$pidFile")) {
        warn "Unable to start Xvnc, exiting\n";
        exit 2;
    }
    So it would seem that the script is unable to create +$pidFile+ (temp file containing the process id of the Xvnc process).

    It could be caused by an environment problem - review files like +.bash_profile+ and ensure that the environment is sane.

    To debug the problem, add the following line before the above if condition in the Perl script:
    warn "pidFile is $pidFile\n";
    This will display the file name and location. The default seems to be:
    $HOME/.vnc/<hostname>:<display>.pid
    
    E.g.
    /home/oracle/.vnc/dev1.my-domain.com:1.pid
    This will enable you to confirm the pid file's location and allow you to confirm that this exists and is accessible by the o/s user trying to create the pid file.

    If this is not the case (pid filename and location valid), then it would seem that the Xvnc process itself has failed. Use man pages to review this command and test it manually (the Perl script is simply a wrapper for executing Xvnc with the relevant parameters).
  • 7. Re: Unable to start vncserver on OEL5.6
    user11952526 Newbie
    Currently Being Moderated
    Hi,

    The output...
    ===========================================================================
    [root@linux1][tmp]
    # ls -l /tmp/.*lock
    ls: /tmp/.*lock: No such file or directory

    # cat /etc/sysconfig/vncservers
    # The VNCSERVERS variable is a list of display:user pairs.
    #
    # Uncomment the lines below to start a VNC server on display :2
    # as my 'myusername' (adjust this to your own). You will also
    # need to set a VNC password; run 'man vncpasswd' to see how
    # to do that.
    #
    # DO NOT RUN THIS SERVICE if your local area network is
    # untrusted! For a secure way of using VNC, see
    # <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

    # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

    # Use "-nohttpd" to prevent web-based VNC clients connecting.

    # Use "-localhost" to prevent remote VNC clients connecting except when
    # doing so through a secure tunnel. See the "-via" option in the
    # `man vncviewer' manual page.

    # VNCSERVERS="2:myusername"
    # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"

    #VNCSERVERS="1:root"
    #VNCSERVERARGS[1]="-geometry 1024Ã68 -depth 16"

    VNCSERVERS="1:root 2:oraprd1"
    VNCSERVERARGS[1]="-geometry 800x600"
    ===========================================================================

    Thanks.
    -Joy.
  • 8. Re: Unable to start vncserver on OEL5.6
    user11952526 Newbie
    Currently Being Moderated
    Hi,

    I have added in vncserver...

    warn "pidFile is $pidFile\n";
    if (!(-e "$pidFile")) {
    warn "Unable to start Xvnc, exiting\n";
    exit 2;

    Getting the below error...

    [root@linux1][usr/bin]
    # vncserver

    Warning: linux1.oracle.com:1 is taken because of /tmp/.X11-unix/X1
    Remove this file if there is no X server linux1.oracle.com:1

    Warning: linux1.oracle.com:2 is taken because of /tmp/.X11-unix/X2
    Remove this file if there is no X server linux1.oracle.com:2

    Warning: linux1.oracle.com:3 is taken because of /tmp/.X11-unix/X3
    Remove this file if there is no X server linux1.oracle.com:3

    Warning: linux1.oracle.com:4 is taken because of /tmp/.X11-unix/X4
    Remove this file if there is no X server linux1.oracle.com:4

    Warning: linux1.oracle.com:5 is taken because of /tmp/.X11-unix/X5
    Remove this file if there is no X server linux1.oracle.com:5
    pidFile is /root/.vnc/linux1.oracle.com:6.pid
    Unable to start Xvnc, exiting

    # ls -l /tmp/.*lock*
    -r--r--r-- 1 root root 11 Jan 1 00:40 /tmp/.X6-lock

    Thanks.
    -Joy.
  • 9. Re: Unable to start vncserver on OEL5.6
    BillyVerreynne Oracle ACE
    Currently Being Moderated
    According to your posting, the vncserver pid file is +/root/.vnc/linux1.oracle.com:6.pid+.

    Have you verified that this directory exist? That the pid file cam be created?

    This directory should also have a xstartup file - this is executed by Xvnc to start a X-server session for the virtual display. This will run a specific window manager (e.g. <i>twm</i>). Post the contents of this file.

    The X-11 file lock error is generated by the X-server s/w - not by Xvnc.

    Also, why display 6? Do you really need 6 different displays?

    Do a sanity check first. Make sure that all Xvnc servers are terminated, e.g.
    ps -ef | grep -i vnc | grep -v grep

    Is the kernel running init level 5(X-Windows)? if so, any specific reason why you need a X display on the console when vnc is also used? Rather change the default init level to 3 (multiuser + networking + no X-windows).
  • 10. Re: Unable to start vncserver on OEL5.6
    Dude! Guru
    Currently Being Moderated
    You may need to remove the /tmp/.Xn-lock files and also remove the sockets in /tmp/.X11-unix/ directory. I wonder though why you have run into such problem though.
  • 11. Re: Unable to start vncserver on OEL5.6
    BillyVerreynne Oracle ACE
    Currently Being Moderated
    2 guesses. Either those X-Server are still running (one X-server cannot simply replace another one already handling a display), or X-Servers are starting and failing (and not cleaning up when failing).

    The +$HOME/.vnc/xstartup+ should detail what X-server and window manager are started/attempting to start.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points