LinuxQuestions.org
Review your favorite Linux distribution.
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 09-05-2015, 11:14 AM   #1
r9aze
LQ Newbie
 
Registered: Sep 2015
Posts: 3

Rep: Reputation: Disabled
Ubuntu vnc grey screen issue


Hi everyone,

I'm trying to setup vnc to connect to an Ubuntu machine remotely but i'm not having much luck.

I've set a password and can connect to it, but once I get there I just have a black cross and a grey screen.

Would be grateful if anyone has any ideas on what's caused this or how I can resolve it. I just need to be able to access the gui of this host remotely.

Currently I only have ssh access to it. Not sure if this is any help but here is what the xstartup file looks like:

#!/bin/sh
# Uncomment the following two lines for normal desktop:

# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
#gnome-session --session=gnome-classic &
MODE="GNOME"
gnome-session --session=ubuntu-2d &

[ -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 &

Where am I going wrong here???

Thanks
 
Old 09-05-2015, 07:47 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,311
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
What vnc server program are you running on the target machine and what port is it listening on?
 
Old 09-06-2015, 07:45 AM   #3
r9aze
LQ Newbie
 
Registered: Sep 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hey,

I think it's vnc4server. I'm not sure how to check the exact version.

It's listening on port 5901.
 
Old 09-06-2015, 09:23 AM   #4
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Here is my xstartup on my Ubuntu 14.04 server with Gnome desktop installed
Code:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
gnome-session --session=gnome-classic &
[ -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 &
Try uncommenting unset SESSION_MANAGER. That and your MODE="GNOME" are the differences I see. Or, save your xstartup file and replace the contents with mine and see what happens.

I ssh to the server and start vncserver with the command
Code:
vncserver -geometry 1400x850 -depth 24
Good luck.

Ken
 
Old 09-06-2015, 04:13 PM   #5
r9aze
LQ Newbie
 
Registered: Sep 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Tried to edit my xstartup file to match the above but I still have the same issue. Going to try and uninstall vnc completely and start again I think. Very frustrating though.
 
Old 09-06-2015, 05:14 PM   #6
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
You should not need to uninstall. Try just deleting ~/.vnc/xstartup which is a shortcut to the file /home/your-usename/.vnc/xstartup

Then run vncserver (this will ask you for a password again I think)
Then run vncserver -kill :1
Then edit xstartup again
Finally start vncserver again and specify the display size and colors for example:

vncserver -geometry 1400x850 -depth 24

Connect from your client PC to servername:1 where servername is the name of the PC running vncserver.

If it still does not work please tell me what version of Ubuntu you are running. I will see if I have a similar test machine around here and will do some testing. Seems like every version is a little different.

Ken

Last edited by taylorkh; 09-06-2015 at 05:30 PM. Reason: a couple of extra .
 
Old 09-07-2015, 09:09 AM   #7
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Hello again r9aze,

You have not said what version of Ubuntu you are running on the machine. Try executing lsb_release -a in a terminal. I suspect it is 14.something or 15.something. I have been looking into this and it is looking very familiar to me when I was trying to access a 14.04 machine - the problem and lack of solutions Here is a possible plan B.

Install x11vnc
Code:
sudo apt-get update
sudo apt-get install x11vnc
There are a couple of fundamental differences between vncserver and x11vnc to my mind. With vncserver I can connect to a machine and run my graphical session independent of the session which is running on the physical console (monitor & keyboard attached to the machine). What I do does not show if someone is looking at the monitor. I think that is very cool - almost like a "real" computer (mainframe). vncserver CAN be configured to access the console session but I do not remember how and have not done so for many years due to some issues which I vaguely recall.

x11vnc will allow you to connect to the main console session when run as I will describe. It can also connect to a running vncserver session and many other things but that is beyond the scope of what you are trying to do I think.

In order to access the main console session with x11vnc on one of my machines I access the machine with ssh and in the terminal issue the command
Code:
sudo x11vnc -auth /var/run/lightdm/root/:0
It is necessary to run this with root (administrator) permissions because no one is logged into the main console to start with - or someone else may be logged in in which case a sightseer should not be able to access their session. Connect to the session as servername:0 with your viewing software.

A couple of notes/cautions:

Make sure you do not have a vncserver session running - x11vnc may try to access it - not what you want.

The ssh terminal is tied up for the entire time you are accessing the x11vnc session. This can be changed by altering the command used to start x11vnc but it has some risks. I think it is better to close x11vnc session when you are done.

Remember to logout from within the x11vnc session. If you are the only one accessing this system fine but if others could access it or there is a physical monitor/keyboard connected... it is just like walking away from your PC when logged in. You can of course lock the x11vnc screen. x11vnc is just like being there.

There is a LOT of information on the x11vnc site at http://www.karlrunge.com/x11vnc/index.html

Have a try at x11vnc and let us know how it works for you. I am running Ubuntu-Mate on most of my machines now and it works with vncserver and x11vnc. If you are interested in Mate (looks like the older gnome2 desktop) let me know. I have xstartup files which do work.

Good luck,

Ken
 
  


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
CentOS Vnc Grey screen XxXtremeN1NJAxX Linux - Server 1 03-06-2013 02:06 PM
grey screen for vnc desktop ubuntuv Linux - Software 1 09-26-2011 11:59 AM
VNC Grey screen lrolstad Linux - Software 8 01-14-2011 01:56 PM
VNC grey screen isaidimsorry Linux - Software 2 03-18-2010 08:44 PM
Grey screen when trying to VNC to Gnome In2Deep General 7 02-05-2004 05:01 AM

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

All times are GMT -5. The time now is 11:45 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