sorry to bring up an old subject but I'm experiencing the same problem on RHEL3 and this seemed like the best thread to add to, although ive seen various similar ones all over the place, none of which have completely helped solve my problem with this blasted black screen.
After installing vnc for linux, run vncserver for the first time as the chosen user who I want allow vnc connections to the machine. This allows me to choose a password as well as create the default settings for that user. I then did the following:
chmod a+x ~/.vnc/xstartup
su - root
chmod a+rx /etc/X11/xinit/xinitrc
then edit ~/.vnc/xstartup file to look like this:
# [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
# xsetroot -solid grey
# vncconfig -iconic &
# xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# exec gnome-session &
I wasnt sure if I'm supposed to comment out the stuff below the "exec xinitrc" command, especially the "exec gnome-session &" but rest assured that I tried it both ways, and get a black screen either way. Ive also seen elsewhere documented to use "gnome-start &" for the gnome session startup command, but this command doesnt seem to exist on my system.
Somewhere else i saw advice to create a local ~/.xinitrc as something like this:
echo "/usr/X11R6/bin/startx" >> ~/.xinitrc
this didnt seem to change anything so I removed it.
I noticed that somewhere along the way it appears like my ~/.Xclients file is being called, which then tries to call a specific client file, and if not found, it will default to use the file ~/.Xclients-default which I had to generate (I dont know why it wasnt already there) so i did this:
echo "exec /usr/X11R6/bin/startx" > .Xclients-default
Looking at the log in ~/.vnc/<hostname>:1.log file I see the following errors:
error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
Fatal server error:
PAM authentication failed, cannot start X server.
Perhaps you do not have console ownership?
the path /usr/X11R6/lib/X11/xserver/SecurityPolicy does not exist on my system, I've read that it should instead be /etc/X11/xserver/SecurityPolicy, but I have no idea what process is looking for this policy file or why its looking in the wrong place. Also, does /usr/X11R6/bin/startx need some sort of permission change as well? I'm beginning to think there are other more serious problems with other X components at work here, but i have no idea what all is going on behind the scenes. Anyone have any idea whats going on here??? How do i get rid of these errors in my vnc log file?