LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 06-02-2009, 03:41 PM   #1
jnojr
Member
 
Registered: Sep 2007
Location: San Diego, CA
Posts: 202

Rep: Reputation: 18
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.
 
Old 06-03-2009, 09:31 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,596

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
You can use the following ~/.vnc/xstartup file:
Quote:
#!/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 &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startx &
exec gnome-session &
to get a gnome desktop

Regards

Last edited by bathory; 06-03-2009 at 09:47 AM.
 
Old 06-03-2009, 11:40 AM   #3
jnojr
Member
 
Registered: Sep 2007
Location: San Diego, CA
Posts: 202

Original Poster
Rep: Reputation: 18
I have:

Quote:
[joliver@ns ~]$ cat .vnc/xstartup
#!/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 &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
So... what do I need to do to get it to actually execute that???
 
Old 06-03-2009, 11:54 AM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Put that in the xstartup file in the hidden directory .vnc (~/.vnc).
 
Old 06-03-2009, 12:07 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,596

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Remove or comment out the line "twm &" and use "exec gnome-session & " to start in gnome
 
Old 06-03-2009, 12:12 PM   #6
jnojr
Member
 
Registered: Sep 2007
Location: San Diego, CA
Posts: 202

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by pwc101 View Post
Put that in the xstartup file in the hidden directory .vnc (~/.vnc).
Uhhh...

[joliver@ns ~]$ cat .vnc/xstartup
 
Old 06-03-2009, 12:13 PM   #7
jnojr
Member
 
Registered: Sep 2007
Location: San Diego, CA
Posts: 202

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by bathory View Post
Remove or comment out the line "twm &" and use "exec gnome-session & " to start in gnome
Why? I do not have GNOME installed.
 
Old 06-03-2009, 12:19 PM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,596

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
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.
 
Old 06-03-2009, 12:26 PM   #9
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by jnojr View Post
Uhhh...

[joliver@ns ~]$ cat .vnc/xstartup
Ok, so make the file.

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
#!/bin/sh

#xrdb $HOME/.Xresources
#xsetroot -solid grey
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &

#startkde &
#startxfce4 &
#startfluxbox &
#fvwm2 &
#icewm-session &
startlxde &
#xfce4-panel &
pwc101@peter:~/src/build/x86_64>
At the moment I'm using LXDE, but I can easily change it to xfce or kde or fluxbox or fvwm2 etc.

Last edited by pwc101; 06-03-2009 at 12:29 PM.
 
Old 06-03-2009, 01:12 PM   #10
jnojr
Member
 
Registered: Sep 2007
Location: San Diego, CA
Posts: 202

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by pwc101 View Post
As above, remove the twm& line and replace with startkde, startxfce or whatever floats your boat.
I do not have KDE or xfce or any other fancy desktop manager installed. I don't want the overhead, and I don't care about the eye candy. All I'm looking for is for an xterm to be started, like it used to be before I managed to close it.
 
Old 06-03-2009, 01:43 PM   #11
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by jnojr View Post
I do not have KDE or xfce or any other fancy desktop manager installed. I don't want the overhead, and I don't care about the eye candy. All I'm looking for is for an xterm to be started, like it used to be before I managed to close it.
OK, I just tested this, and it launched just a grey screen and an xterm.
Code:
pwc101@peter:~/src/build/x86_64> !cat
cat ~/.vnc/xstartup
#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
I presume from your description this is what you wanted.

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.

Last edited by pwc101; 06-03-2009 at 01:45 PM. Reason: mroe info
 
Old 06-03-2009, 02:04 PM   #12
jnojr
Member
 
Registered: Sep 2007
Location: San Diego, CA
Posts: 202

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by pwc101 View Post
OK, I just tested this, and it launched just a grey screen and an xterm.
Yup... that's what I used to get. Now, I just get the grey screen... no xterm.

Quote:
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.
Huh!

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! :-)
 
Old 06-03-2009, 02:36 PM   #13
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by jnojr View Post
Thanks for your persistence! :-)
Glad we got there in the end
 
Old 09-20-2009, 02:02 AM   #14
Augusst
LQ Newbie
 
Registered: Sep 2009
Posts: 2

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

Last edited by Augusst; 09-20-2009 at 02:05 AM.
 
Old 12-15-2009, 04:08 PM   #15
sien
LQ Newbie
 
Registered: Jun 2005
Posts: 4

Rep: Reputation: 1
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
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
VNC Grey screen lrolstad Linux - Software 8 01-14-2011 02:56 PM
Sparc - VNC, only they grey screen appears w3bd3vil Solaris / OpenSolaris 1 08-26-2008 09:08 AM
Connecting to VNC server gives me grey screen Micro420 Ubuntu 0 08-18-2006 09:56 PM
VNC - the screen is a grey checked color rwtreke Linux - Newbie 1 02-01-2005 05:16 PM
Grey screen when trying to VNC to Gnome In2Deep General 7 02-05-2004 06:01 AM


All times are GMT -5. The time now is 12:18 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration