Link to home
Start Free TrialLog in
Avatar of Mark Geerlings
Mark GeerlingsFlag for United States of America

asked on

VNC blank screen problem with RedHat ES4

I have a new install of RedHat ES4 that I cannot get VNC to cooperate in.  Actually things look OK on the Linux side, but when I try to connect to a Linux session via VNC from my WIndows desktop, I just get a blank screen with a large X, but not the KDE desktop that i'm hoping for.

I'm not a Linux expert, and don't have Unix background either.  I am an experienced Windows user and an experienced Oracle DBA.  I've gotten VNC to work before on a couple ES3 installs I did, and on ES4 once, but I had to re-install ES4 and now I cannot get past the frustrating blank screen in VNC.

Yes, I have root access to the Linux machine via a "putty" session and I am (unfortunately) the closest thing we have to a Linux sysadmin.  I have explored some of the responses to somewhat similar questions in this forum, but they are for different distros and/or older versions of RedHat, so I'm not sure how much of the info in them applies in my case.
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

ASKER

I'm puzzled and somewhat amazed, frustrated, and happy.  VNC works for me now!  Why?  I don't have a clue.  

Linux was at runlevel 3, but I've had VNC work before and bring up the KDE GUI on my Windows desktop with ES4 at runlevel 3.  A few minutes ago I decided to do a "startx" in my Putty (command-line) session on the Linux server.  Then I went to the console, and KDE was running there as expected.  I opened a terminal shell there, stoppped the VNC server session that was running, then restarted it, and went back to my Windows desktop and tried the VNC client again, not really expecting it to give me anything other than a blank screen, but it launched KDE! I went back to the console and logged out (which shut down X) then disconnected my VNC session, and reconnected - no problem: it gave me a KDE desktop again.  I went back to Putty and stopped and restarted vncserver again, then tried to connect via VNC, again no problem.

Why it co-operates now but refused to co-operate earlier is a complete mystery to me.  Does anyone have any ideas about why it it is willing to co-operate now?
Well, not quite.  I shut down and rebooted ES4, and expected VNC to co-operate, but no such luck.  It was running on the Linux side but my VNC client on Windows just gave me the blank screen.  I then did a "startx" in Linux and tried my VNC client again.  No better, still a blank screen.  I then shut down KDE on the console, then stopped and restarted vncserver, and now it co-operates again and gives me KDE on my VNC client.

What is going on here?  What combination or sequence of things does VNC need to be able to reliably give me a GUI desktop to Linux?  I need to be able to manage an Oracle database on Linux and I don't know the Linux commands well enough to do everything from the command line.  (Plus Oracle's installer and some configuration tools for Linux need to run in a GUI.)  I want to be able to have the GUI on my Windows desktop.  If VNC is not the most reliable way to make this happen, I'm willing to consider other options.
You need to "uncomment the following two lines in ~/.vnc/xstartup"
unset SESSION_MANAGER
exec  /etc/X11/xinit/xinitrc

So your ~/.vnc/xstartup looks like
-----------
#!/bin/sh

unset SESSION_MANAGER
exec  /etc/X11/xinit/xinitrc

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session  &   # <=== change from "twm &"
--------------------
Then kill the old vncserver session and restart a new vncserver session.
Those two lines in my xstartup file have been uncommented.  The remaining lines are commented out though.  Isn't there some overlap or duplication between the line:
exec  /etc/X11/xinit/xinitrc

and the last few lines in this file?  I don't claim to be a Linux expert, but it looks to me like the xinitrc script does at least some similar things as these lines.

I know that I don't want a GNOME desktop, I prefer KDE.  I have modified my /etc/sysconfig/desktop file to be:
DESKTOP="KDE"
> I prefer KDE.
Just make your xstartup looks like the following
------
#!/bin/sh

unset SESSION_MANAGER
exec  /etc/X11/xinit/xinitrc

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startkde  &   # <=== change from "twm &"
-------
No.

After a Linux reboot, that still gives me just a blank screen in my VNC client with an X-shaped mouse pointer, but it is useless.  I'm out of time for today - I'll check back in the morning.
You can check the following link. I think it already has more or less what lesly suggested, but there may be some additions...

https://www.experts-exchange.com/questions/21303449/VNC-Server-in-Fedora-FC3.html?query=vnc+kde&clearTAFilter=true
To rindi:

Been there, done that.  Yes, that link has pretty much the same things I have tried.  That user, wanted gnome, not KDE, but otherwise it looks like the same problem I have.  When I uncomment those two lines though in my xstartup file, I still get just a useless blank screen with only a large X for a mouse pointer that does nothing.
ASKER CERTIFIED SOLUTION
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
With the help of Red Hat Technical Support, we found and fixed the real problem: an error in /etc/hosts.  The host name was wrong.  I entered it during the O/S install process differently than I intended.  I corrected it in /etc/sysconfig/network, but hadn't corrected it in the /etc/hosts file.  After correcting it there, VNC responds as expected.

I'll accept wesly's last suggestion as the answer to thank him/her for trying.