Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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!
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
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
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:
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.