LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-24-2004, 11:11 AM   #1
SpannerBracket
LQ Newbie
 
Registered: May 2004
Location: Cambridge, UK
Distribution: Red Hat Enterprise 3
Posts: 8

Rep: Reputation: 0
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
 
Old 05-24-2004, 12:07 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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 &
 
Old 05-25-2004, 03:33 AM   #3
SpannerBracket
LQ Newbie
 
Registered: May 2004
Location: Cambridge, UK
Distribution: Red Hat Enterprise 3
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 05-25-2004, 03:38 AM   #4
SpannerBracket
LQ Newbie
 
Registered: May 2004
Location: Cambridge, UK
Distribution: Red Hat Enterprise 3
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 05-25-2004, 12:07 PM   #5
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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.
 
Old 05-25-2004, 12:15 PM   #6
SpannerBracket
LQ Newbie
 
Registered: May 2004
Location: Cambridge, UK
Distribution: Red Hat Enterprise 3
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 05-26-2004, 11:58 AM   #7
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Any luck?
 
Old 05-28-2004, 03:27 AM   #8
SpannerBracket
LQ Newbie
 
Registered: May 2004
Location: Cambridge, UK
Distribution: Red Hat Enterprise 3
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 06-15-2004, 06:26 AM   #9
storole
LQ Newbie
 
Registered: Jun 2004
Posts: 1

Rep: Reputation: 0
Hi!

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

do:
# chmod a+x xstartup

storole
 
Old 06-15-2004, 09:16 AM   #10
SpannerBracket
LQ Newbie
 
Registered: May 2004
Location: Cambridge, UK
Distribution: Red Hat Enterprise 3
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks very much that has solved my problem!

Cheers
Ben
 
Old 06-22-2004, 09:03 AM   #11
WeBoat
LQ Newbie
 
Registered: Jun 2004
Posts: 3

Rep: Reputation: 0
Just wanted to put in my thanks. This thread fixed my problems also!!!!
 
Old 06-23-2004, 03:17 AM   #12
SpannerBracket
LQ Newbie
 
Registered: May 2004
Location: Cambridge, UK
Distribution: Red Hat Enterprise 3
Posts: 8

Original Poster
Rep: Reputation: 0
Its a great place to get some friendly advice!
 
Old 07-08-2005, 01:15 PM   #13
jrguitar21
LQ Newbie
 
Registered: Jul 2005
Location: currently? ...Ecuador
Distribution: Gentoo, Puppy2.02, Zenwalk2.8
Posts: 4

Rep: Reputation: 0
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?
 
Old 07-08-2005, 01:27 PM   #14
jrguitar21
LQ Newbie
 
Registered: Jul 2005
Location: currently? ...Ecuador
Distribution: Gentoo, Puppy2.02, Zenwalk2.8
Posts: 4

Rep: Reputation: 0
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. ;-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need VNC to allow 'logout/login' from Gnome (gnome & VNC runs fine) spudler Linux - Networking 3 11-14-2004 10:02 AM
VNC and Gnome Aurga Linux - General 24 11-12-2004 02:16 PM
Gnome and VNC laurentbon Slackware 3 10-08-2003 09:30 AM
gnome and vnc android1654 Linux - Software 2 07-03-2003 02:04 AM
GNOME in VNC? gauge73 Linux - Networking 20 06-21-2003 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration