LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training 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 02-16-2008, 08:29 AM   #1
TonyOCL
LQ Newbie
 
Registered: Feb 2008
Posts: 13

Rep: Reputation: 0
VNC (remote desktop) on RedHat EL5


I installed REL5 and wanted to get VNC to work.
I followed the instructions in redhat's knowledge base to setup VNC access on EL5 but when I use my vncviewer on ...:1 it does not corect.
Here is what I did

1) As root - update the file /etc/sysconfig/vncservers to add an entry like VNCSERVERS="1:userabc" where 1 will be the port number to use and userabc is the user who can use vnc – DO NOT use port 0
2) Sign on as the users (in this case userabc) and run the command “vncpasswd” this sets the password for the user
3) Go into the users home directory (ie /home/userabc) and then “cd .vnc” and do a “chmod 755 xstartup”.
4) As root do “service vncserver start” and you should see the message “Starting VNC server: 1:userabc” or something like that
5) In order for the vncserver service to start during the boot sequence, run the following command “chkconfig vncserver on”
6) To check if everything is ok do “chkconfig --list vncserver” and you should get output like this “vncserver 0ff 1ff 2n 3n 4n 5n 6ff”


======
My vncservers file has the following entry
VNCSERVERS="1:userabc"
VNCSERVERARGS[1]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"

I can see that VNC is starting after even a reboot
==============
[root@andromeda sysconfig]# ps -eaf | grep vnc
userabc 3687 1 0 18:13 ? 00:00:00 Xvnc :1 -desktop andromeda:1 (toreilly) -auth /home/userabc/.Xauthority -geometry 800x600 -depth 16 -rfbwait 30000 -rfbauth /home/userabc/.vnc/passwd -rfbport 5901 -pn -nolisten tcp -localhost
userabc 3699 1 0 18:13 ? 00:00:00 vncconfig -iconic
root 6330 6128 0 19:54 pts/2 00:00:00 grep vnc
==============

Is there something I am missing as I still can't get VNC to work?
I understand that this is setup for user userabc, so after that works I would like to set it up for the consol :0 itself.

Any help wuld be appreciated
Thanks
 
Old 02-16-2008, 08:54 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 97
Did you check the firewall settings? TCP port 5901
needs to be allowed for the client.
 
Old 02-16-2008, 09:36 AM   #3
TonyOCL
LQ Newbie
 
Registered: Feb 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by carltm View Post
Did you check the firewall settings? TCP port 5901
needs to be allowed for the client.
On your suggestion I added the port and even tried with the firewall turned off. Also I even rebooted the OS just to make sure.
But no luck.

Any other suggestions?
TIA
 
Old 02-16-2008, 10:52 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
I am using kubuntu (KDE Desktop), and start a vnc server, on my server, for my user on :1 at boot with this line at the end of /etc/rc.local
Code:
su - tredegar -c "cd /home/tredegar/ && vncserver :1 -geometry 1024x768 -depth 24" &
exit(0)
To connect to my server's desktop from my laptop:
Code:
vncviewer IP.OF.SER.VER:1
Or, if you have /etc/hosts set up properly:
Code:
vncviewer ServerName:1
For "Sharing" my desktop, I use krfb on the computer whose :0 desktop I want to share.
krfb sets a password for the connection which you must communicate to the person you wish to invite to share your desktop.
It works beautifully (over a fast connection) and is very useful for helping linux newbies (who trust me ) from a distance.
Hope this helps.
 
Old 02-16-2008, 12:34 PM   #5
TonyOCL
LQ Newbie
 
Registered: Feb 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
I am using kubuntu (KDE Desktop), and start a vnc server, on my server, for my user on :1 at boot with this line at the end of /etc/rc.local
Code:
su - tredegar -c "cd /home/tredegar/ && vncserver :1 -geometry 1024x768 -depth 24" &
exit(0)
To connect to my server's desktop from my laptop:
Code:
vncviewer IP.OF.SER.VER:1
Or, if you have /etc/hosts set up properly:
Code:
vncviewer ServerName:1
For "Sharing" my desktop, I use krfb on the computer whose :0 desktop I want to share.
krfb sets a password for the connection which you must communicate to the person you wish to invite to share your desktop.
It works beautifully (over a fast connection) and is very useful for helping linux newbies (who trust me ) from a distance.
Hope this helps.
I think I have VNC setup corrrectly (now there is a bold statement) :-) this is based on this output from ps -eaf
============== output below ===============
root@andromeda sysconfig]# ps -eaf | grep vnc
userabc 3687 1 0 18:13 ? 00:00:00 Xvnc :1 -desktop andromeda:1 (toreilly) -auth /home/userabc/.Xauthority -geometry 800x600 -depth 16 -rfbwait 30000 -rfbauth /home/userabc/.vnc/passwd -rfbport 5901 -pn -nolisten tcp -localhost
userabc 3699 1 0 18:13 ? 00:00:00 vncconfig -iconic
=========== end of output =========
from that it looks like vnc is ready to receive calls on :1, but as you pointed out earlier - it isn't working and looks like a firewall issue.
But turning off the fire wall would, I suspect, prove that isn't the issue.

Is there anything else you can suggest?
Thanks
 
Old 02-16-2008, 08:58 PM   #6
cojo
Member
 
Registered: Feb 2003
Location: St. Louis
Distribution: RedHat 8
Posts: 262

Rep: Reputation: 31
Tony,

ssh to your server then login as whoever you want VNCSERVER session as then start vnc by type vncserver. It will ask you to create a password if this is the first time starting vncserver. At this point it will tell you which port vncserver start as and it's ready for you to connect to it.
 
Old 02-17-2008, 02:55 AM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Tony,
Quote:
I think I have VNC setup corrrectly
No, I think you are starting xvnc the wrong way.
Why have you put the option -localhost ?
man xvnc :
Code:
[Snip]
-localhost
              Only allow connections from the same machine. Useful if you  use
              SSH  and  want to stop non-SSH connections from any other hosts.
              See the guide to using VNC with SSH on the web site.
[Snip]
And what about the option -nolisten ? I cannot find that in the documentation, but it doesn't sound at all helpful.
 
Old 02-17-2008, 05:12 AM   #8
TonyOCL
LQ Newbie
 
Registered: Feb 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by cojo View Post
Tony,

ssh to your server then login as whoever you want VNCSERVER session as then start vnc by type vncserver. It will ask you to create a password if this is the first time starting vncserver. At this point it will tell you which port vncserver start as and it's ready for you to connect to it.
This is what I do for AIX, but wasn't the case here as I could see that VNC was running using ps -eaf

The problem turned out to be my not reading the vncservers file comments correctly (see comment below)
Thanks
 
Old 02-17-2008, 05:26 AM   #9
TonyOCL
LQ Newbie
 
Registered: Feb 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
Tony,

No, I think you are starting xvnc the wrong way.
Why have you put the option -localhost ?
man xvnc :
Code:
[Snip]
-localhost
              Only allow connections from the same machine. Useful if you  use
              SSH  and  want to stop non-SSH connections from any other hosts.
              See the guide to using VNC with SSH on the web site.
[Snip]
And what about the option -nolisten ? I cannot find that in the documentation, but it doesn't sound at all helpful.
That was it when I removed those three options then it worked. What was totally silly of me is that it was in the file I was adding the options to. So much for reading the manual.
Thanks again for pointing me in the correct direction

=========== extract from the top of the file
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the

=========== end of extract ============
 
Old 02-06-2009, 11:29 PM   #10
ghzee
LQ Newbie
 
Registered: Sep 2008
Posts: 3

Rep: Reputation: 0
help

i want to configure vnc-server and client, can any one help me ,tell me step for configuration ,and also give rpm link
 
Old 02-07-2009, 05:16 AM   #11
TonyOCL
LQ Newbie
 
Registered: Feb 2008
Posts: 13

Original Poster
Rep: Reputation: 0
My first post on this gives step by step instructions for RedHat EL5. Which flavour of UNIX are you using?
 
Old 02-07-2009, 10:04 AM   #12
saagar
Member
 
Registered: Jul 2008
Location: Chennai, India
Distribution: RHEL5, Ubuntu
Posts: 191

Rep: Reputation: 37
TonyOCL,
I think in step 3 you also need to open the file /home/username/.vnc/xstartup and uncomment the lines:

#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc

uncomment the above 2 lines and restart the service.
hope that would work..
 
  


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
Using VNC and remote desktop connection pilotgi SUSE / openSUSE 4 11-16-2007 03:31 PM
vnc remote desktop gray packetsmacker Linux - Software 3 09-12-2007 08:29 PM
Remote Desktop or VNC benchasebrown Slackware 4 09-22-2006 06:25 PM
'Remote Desktop' with SSH and VNC kaon Slackware 11 09-21-2004 01:15 PM
Does KDE remote desktop == VNC? Brain Drop Linux - Networking 1 07-05-2004 03:45 PM

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

All times are GMT -5. The time now is 01:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration