VNC black screen with a X cursor on Red Hat Enterprise Linux Server release 5.3 (Tikanga)

user2656114 picture user2656114 · Oct 28, 2013 · Viewed 96.2k times · Source

Starting VNC server using vncserver :1, client can connect to the server but it shows only a black screen with a X curser.

Contents of .vnc/xstartup is:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

Is it a problem with this?

Answer

Christian picture Christian · Jan 23, 2014

That has happened to me 2x, and I have been able to repair it 2x. It's very likely only step 2. then 3. are required, but once I've found a way that works I'm loath to change...

  1. The .vnc/xstartup file was owned by root, so I changed ownership to user:
    chown user /home/user/.vnc/xstartup
  2. The .vnc/xstartup file was 664 (-rw-rw-r--.) - I assume vnc uses the 'other' permissions to connect and allow interactions, so I changed the permissions to 755:
    chmod 755 /home/user/.vnc/xstartup
  3. Restart the vncserver daemon:
    service vncserver stop; service vncserver start