VNC - blank grey screen
I have a host running CentOS 5 Final on which I installed vnc-server I connect to it with ssh (PuTTY 0.60) with port 5900 local forwarded to port 5902 on the remote CentOS host. I can connect with tightvnc 1.3.10 I used to have an xterm, and I launched Firefox and used it for a while. I managed to close Firefox and the xterm. Now, tightvnc shows me an empty grey screen with checkboxes for "Accept clipboard from viewers", "Send clipboard to viewers", and "Send primary selection to viewers".
How do I at least get an xterm back? If I run "xterm &" from the SSH session, I get "X connection to localhost:10.0 broken (explicit kill or server shutdown)." I do not recall having had to fiddle with $DISPLAY to get VNC working, and $DISPLAY certainly did not change from when I had an xterm to when I could not get another. |
You can use the following ~/.vnc/xstartup file:
Quote:
Regards |
I have:
Quote:
|
Put that in the xstartup file in the hidden directory .vnc (~/.vnc).
|
Remove or comment out the line "twm &" and use "exec gnome-session & " to start in gnome
|
Quote:
[joliver@ns ~]$ cat .vnc/xstartup |
Quote:
|
Isn't gnome the default DE for Centos?
Anyway if you don't have gnome, you can use "startkde &" or "startxfce4 &" and so on, depending of your DE. |
Quote:
edit: my bad. As above, remove the twm& line and replace with startkde, startxfce or whatever floats your boat. Here's mine for reference: Code:
pwc101@peter:~/src/build/x86_64> cat ~/.vnc/xstartup |
Quote:
|
Quote:
Code:
pwc101@peter:~/src/build/x86_64> !cat You will need to restart your vnc server for this to be applied. I don't know of any way of launching an xterm from within a simple xsetroot-type environment. |
Quote:
Quote:
I'm positive I had restarted vncserver before. I did it just now, to say that I had... and my xterm is back! Thanks for your persistence! :-) |
Quote:
|
I had the same issue with VNC running on an VPS and I fixed by simply changing the .vnc/xstartup file from (without the quotes):
"#!/bin/sh # Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & x-window-manager &" To simply: "#!/bin/sh startkde &" At first I tried leaving the initial code and adding this last one under the last line (x-window-manager &) although it was taking much longer to start and after a few restarts it would even start again. With this short code it starts fast and smooth. Hope this helps :) |
make sure xtartup has executable permissions
Blank desktop means vnc couldn't find a valid window manager.
xstartup may look ok but if it doesn't have executable permissions, vnc won't read xstartup properly. vnc log file should indicate this. Quick fix is to do chmod +x xstartup If permissions are correct, make sure paths to window manager are correct. Quick way to check is do a which window_mgr_name to see if it is found and the path is correct in xstartup. For instance: %which gnome-session returns this on my server /usr/bin/gnome-session Check that this path is correct in xstartup |
All times are GMT -5. The time now is 09:24 PM. |