LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   VNC with GNOME? RHEnterprise3 (https://www.linuxquestions.org/questions/linux-newbie-8/vnc-with-gnome-rhenterprise3-185249/)

SpannerBracket 05-24-2004 11:11 AM

VNC with GNOME? RHEnterprise3
 
Ive been chucked in at the deepend and Ive been given a box and an install for Red Hat Enterprise 3. I am a Windows man primarily, but need to get some hands on linux experience.

To make things easier for me, I ideally want to be able to use Linux on my Windows box, and Windows on my Linux box (I do not want to dual boot - for lots of reasons I wont go into).

The easiest way I thought would be to use VNC. I have setup a VNC server on my Windows PC - and can access it from Linux no problem.

The problem comes from trying to do the opposite. I start a VNC server on my linux box like this:

vncserver -rfbport 5900

(the two boxes are on different networks, and our firewall only passes default VNC port [not had time to investigate SSH tunnelling yet!])

On my windows box when I vnc - i get TWM not GNOME.

I have edited my $HOME/.vnc/xstartup file to the following:

#!/bin/sh

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

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-start &

Now i just get a black screen on starting a VNC session from the Windows box.

Anyone have any ideas where Im going wrong?

Cheers
Ben

Dark_Helmet 05-24-2004 12:07 PM

I had problems like this when I set up my Red Hat for VNC. The answer is staring you in the face. At least, it was the answer for me:

Quote:

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
Remove the '#' at the beginning of the "unset" and "exec" lines, and add a '#' to the beginning of every other non-blank line in your file. Like so:
Code:

#!/bin/sh

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

#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#gnome-start &


SpannerBracket 05-25-2004 03:33 AM

Thanks for replying,

I made the changes as you suggested just left the two lines uncommented - but unforunately it gets me no further. Upon restarting the vncserver, I still just get a black screen.

Cheers
Ben

SpannerBracket 05-25-2004 03:38 AM

I have tried editing the xstartup file with various combinations - just commenting out the top two lines does result in getting a VNC connection, but using TWM. As soon as the top two lines are added however, I just get a black screen.

When my box boots, it boots into Gnome as default.

Cheers
Ben

Dark_Helmet 05-25-2004 12:07 PM

Ok, what's your xinitrc like. What are the permissions for it?
Code:

$ ls -l /etc/X11/xinit/xinitrc
-rwxr-xr-x    1 root    root        2189 Sep 10  2002 /etc/X11/xinit/xinitrc

Just making sure it's not a permissions problem. I'm positive exec would need read permissions, but not so sure about execute. Anyway, like I said, just making sure the user you're trying to start vncserver with has permission to get at the file.

If that doesn't fix it, I can post the contents of mine for comparison.

SpannerBracket 05-25-2004 12:15 PM

Thanks for taking the time dark.

Im away from work now until possibly friday - and with the linux box being behind the firewall, I don't think I can ssh to it from here! Ill post the details as soon as I get them!

Cheers
Ben

Dark_Helmet 05-26-2004 11:58 AM

Any luck?

SpannerBracket 05-28-2004 03:27 AM

Sorry for late update - only just got access to my box again today - got awful windows exchange problems happening in the background too! - Quite eager to escape into Linux at the moment =)

-r--r--r-- 1 root root 2189 May 25 09:27 /etc/X11/xinit/xinitrc

I haven't really had any experience on Linux side with permissions yet - i understand, the first column is root permissions - the 2nd my account permissions? - whats the third?

Is this likely to cause problems being read only?

Anyway, heres my xinitrc file.

Code:

#!/bin/sh
# (c) 1999-2002 Red Hat, Inc.

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
userxkbmap=$HOME/.Xkbmap

sysresources=/etc/X11/Xresources
sysmodmap=/etc/X11/Xmodmap
sysxkbmap=/etc/X11/Xkbmap

# merge in defaults
if [ -f "$sysresources" ]; then
    xrdb -merge "$sysresources"
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

# merge in keymaps
if [ -f "$sysxkbmap" ]; then
    setxkbmap `cat "$sysxkbmap"`
    XKB_IN_USE=yes
fi

if [ -f "$userxkbmap" ]; then
    setxkbmap `cat "$userxkbmap"`
    XKB_IN_USE=yes
fi

if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
    if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
        xkbsymbols=`sed -n -e 's/^[        ]*XkbSymbols[        ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
        if [ -n "$xkbsymbols" ]; then
            setxkbmap -symbols "$xkbsymbols"
            XKB_IN_USE=yes
        fi
    fi
fi

# xkb and xmodmap don't play nice together
if [ -z "$XKB_IN_USE" ]; then
    if [ -f "$sysmodmap" ]; then
        xmodmap "$sysmodmap"
    fi

    if [ -f "$usermodmap" ]; then
        xmodmap "$usermodmap"
    fi
fi

unset XKB_IN_USE

# run all system xinitrc shell scripts.
for i in /etc/X11/xinit/xinitrc.d/* ; do
    if [ -x "$i" ]; then
        . "$i"
    fi
done

# The user may have their own clients they want to run.  If they don't,
# fall back to system defaults.
# set up ssh agent environment if available.

if [ -f $HOME/.Xclients ]; then
    [ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ] && \
        exec ssh-agent $HOME/.Xclients || \
        exec $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
    [ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ] && \
        exec ssh-agent /etc/X11/xinit/Xclients || \
        exec /etc/X11/xinit/Xclients
else
      # failsafe settings.  Although we should never get here
      # (we provide fallbacks in Xclients as well) it can't hurt.
      xclock -geometry 100x100-5+5 &
      xterm -geometry 80x50-50+150 &
      if [ -x /usr/bin/netscape -a -f /usr/share/doc/HTML/index.html ]; then
              netscape /usr/share/doc/HTML/index.html &
      fi
      if [ -x /usr/X11R6/bin/fvwm2 ]; then
              exec fvwm2
      else
              exec twm
      fi
fi


storole 06-15-2004 06:26 AM

Hi!

Had the same problem! You should change the mod on ../.vnc/xstartup !

do:
# chmod a+x xstartup

;) storole

SpannerBracket 06-15-2004 09:16 AM

Thanks very much that has solved my problem!

Cheers
Ben

WeBoat 06-22-2004 09:03 AM

Just wanted to put in my thanks. This thread fixed my problems also!!!!

SpannerBracket 06-23-2004 03:17 AM

Its a great place to get some friendly advice!

jrguitar21 07-08-2005 01:15 PM

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:

Code:

chmod a+x ~/.vnc/xstartup
su - root
chmod a+rx /etc/X11/xinit/xinitrc

then edit ~/.vnc/xstartup file to look like this:

Code:

#!/bin/sh

 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

# [ -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:

Code:

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:

Code:

echo "exec /usr/X11R6/bin/startx" > .Xclients-default
Looking at the log in ~/.vnc/<hostname>:1.log file I see the following errors:

Quote:

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?

jrguitar21 07-08-2005 01:27 PM

so I just stumbled upon my own solution. I changed ~/.Xclients-default file like this:

Code:

rm -f ~/.Xclients-*
echo "exec gnome-session &"  > ~/.Xclients-default

sometimes it helps just to write out everything youve already tried to see whats left to try. ;-)


All times are GMT -5. The time now is 05:23 AM.