LinuxQuestions.org
Review your favorite Linux distribution.
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 03-17-2012, 09:25 PM   #1
yaximik
Member
 
Registered: Nov 2010
Posts: 87

Rep: Reputation: 0
Multiple VNC client or servers - please help


Hi,

A RHEL55 box in my office recently began behaving strangely. I normally run VNCserver on it, so I connect from home using VNC Viewer.
I start VNCserver by issuing the following command from my account:

vncserver -geometry 1280x1024 -depth 24

Then I check that the server is running:

[yaximik@G5NNJN1 ~]$ ps -afe | grep vnc
yaximik 6130 1 0 17:44 ? 00:00:01 Xvnc :1 -desktop G5NNJN1:1 (yaximik) -httpd /usr/share/vnc/classes -auth /tmp/.gdmZIENBW -geometry 1280x1024 -depth 24 -rfbwait 30000 -rfbauth /home/yaximik/.vnc/passwd -rfbport 5901 -pn
yaximik 7403 7375 0 19:20 pts/1 00:00:00 grep vnc


At home, I launch VNC viewer and enter in the connection window:

<server address>:1

then provide password I set for this connection and I am connected.

What happens now:

Login as above opens a window entitled VNC:G5NNJN1:1 (yaximik) that shows a desktop without any menus, panels, mounted disks, trash can, only the normal background pattern. F8>Connection Info... shows

Desktop Name: G5NNJN1:1 (yaximik)
Host: <address> Port: 5901
.....
Protocol Version 3.8
Security Method: VncAuth


This window is useless since I cannot do anything.

However, login as <server address>:0 followed by required password opens a window with normal desktop, just as I set for this account (yaximik), with all menus, panels, mounted disks and trash can. However, the window is entititled VNC:LibVNCServer and F8>Connection Info... shows the following:

Desktop Name" LibVNCServer
Host:<address> Port:5900
.....
Protocol: 3.7
Security Method: VncAuth


The window has everything, so I can work with provided GUI (Gnome).

Interestingly, login with <server address>:2 opens another window entitled VNC:LibVNCServer just like with <address>:1, that has no menus, panels, mounted disks and no Trash Can. F8>Connection Info... shows the following:

Desktop Name: LibVNCServer
Host: <address> Port: 5902
.......
Protocol: 3.7
Security Method: VncAuth


This has not been observed before. That is if VNCserver is launched with terminal :1, then I need to login with <address>:1, no other windows can be opened unless additional VNC servers are launched, each with it own terminal that needs to be used. I often was launching VNCserver from the root account at terminal :1, and another from user account (yaximik) at terminal :2. Now, if I launch root at :1, the user (yaximik) comes at :3 because VNC:LibVNCServer occupies :2 and :4, even if I did not launch any additional instance of VNCserver. The output from ps -afe | grep vnc does not show any additional instances of VNC server, no LibVNCServer whatsoever, and lists only instances that have been launched with assigned terminals, for example root:0 and yaximik:1, or just yaximik:1 for the example above.

Also, even if for all three Desktop windows (at :0, :1, and :2) display exactly the same information after F8>Options, mouse cursor behaves differently. In VNC:G5NNJN1:1 (yaximik), even if desktop is useless, cursor moves exactly like on my home desktop. However, in both VNC:LibVNCServer desktops (at :0 and :2), cursor is sluggish and drags following a dot that moves faster.

Sorry for long explanation - please advise what is going on and how to fix it.
 
Old 03-19-2012, 06:21 AM   #2
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
can you post the output of

Code:
#cat /etc/sysconfig/vncservers
#cat /root/.vnc/xstartup
 
Old 03-20-2012, 06:15 PM   #3
yaximik
Member
 
Registered: Nov 2010
Posts: 87

Original Poster
Rep: Reputation: 0
Hi,

Here are the outputs:

[yaximik@G5NNJN1 ~]$ cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

# 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
# `man vncviewer' manual page.

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
[yaximik@G5NNJN1 ~]$


and

[yaximik@G5NNJN1 ~]$ cat /root/.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 &
[yaximik@G5NNJN1 ~]$


It looks like a vncserver should launch at startup. but it does not, since I cannot connect via VNCviewer unless I launch it manually as I specified before. I guess I am missing something here.
 
Old 03-21-2012, 12:19 AM   #4
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
How come I don't see any configuration in vncserver config file?
Quote:
# VNCSERVERS="2:myusername"
this line in vncservers file should be uncommented and changes with username to be used for vnc

Code:
VNCSERVERS="2:root"
Code:
#vncpasswd
give the new password
Code:
#service vncserver restart
 
Old 03-22-2012, 07:59 PM   #5
yaximik
Member
 
Registered: Nov 2010
Posts: 87

Original Poster
Rep: Reputation: 0
Lack of the proper entry explains why I have to launch vncserver manually everytime I reboot. But what escapes my understanding is that vncserver nevertheless starts automatically after reboot, since I can log in as a user (yaximik) using terminal :0, using password I set for this user, but with desktop title LibVNCServer. No other terminals are available. This service, however, is very sluggish with mouse dragging after dot on the screen and gets corrupted or crashes after a while making the server inaccessible at terminal :0. When I launch vncserver manually as mentioned above either as root or as the user, the new instance of vncserver is much more responsive, mouse cursor behaves like on local desktop. The new instance takes terminal :1 with desktop title either "root" or "yaximik", depending on what account it was launched from. Another instance of the vncserver launches automatically and takes terminal :2 with title again "LibVNCServer", while service at terminal :0 may or may not remain available. Is there any other file that launches vncserver?
 
Old 04-13-2012, 02:05 PM   #6
yaximik
Member
 
Registered: Nov 2010
Posts: 87

Original Poster
Rep: Reputation: 0
VNCservers - solved/unsolved

Hi,

I added the following entries to /etc/syconfig/vncservers

VNCSERVERS="1:root"
VNCSERVERARGS[2]="-geometry 1280x1024 -depth 24 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="2:yaximik"
VNCSERVERARGS[2]="-geometry 1280x1024 -depth 24 -nolisten tcp -nohttpd -localhost"


and specified passwords from both root and the user as mentioned.
After reboot, I see the following, either from root or from user accounts:

[root@G5NNJN1 ~]# ps -afe | grep vnc
yaximik 5188 1 1 Apr12 ? 00:16:27 Xvnc :2 -desktop G5NNJN1:2 (yaximik) -auth /home/yaximik/.Xauthority -geometry 1280x1024 -depth 24 -rfbwait 30000 -rfbauth /home/yaximik/.vnc/passwd -rfbport 5902 -pn -nolisten tcp -localhost
root 9237 9219 0 12:41 pts/1 00:00:00 grep vnc
[root@G5NNJN1 ~]#


Now , when I try to log-in as remote using VNCviewer and entering address in the connection dialog field, the following happen:

If no login done locally
Remotely
address --> password --. login to the user account (yaximik)
address:1 or address:2 get Connection refused.


After user (yaximik) local login
Remotely
address --> password --> login to the user account (yaximik)
address:1 --> password --> login to the user account (yaximik)
address:2 --> Connection refused


After root local login
Remotely
address --> password --> login to the user account (yaximik)
address:1 --> login to the root account after permission to connect is granted locally, but no specified for vnc password is ever asked
address:2 --> Connection refused


That is not I wanted, since I put in vncservers root at terminal :1 and yaximik at terminal :2.

What is still wrong?
 
Old 04-14-2012, 03:04 AM   #7
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
"connection refused" error signifies wither your vncserver is not running or your server security is blocking vncserver port
Code:
#service vncserver status
also check your selinux and iptables
 
  


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
multiple X-servers, multiple graphics adapters, single-seat (kind of tutorial) bluebox Linux - Desktop 3 03-01-2011 07:30 AM
openVPN multiple servers, can access all client all of my server bulkiter0z Linux - Networking 1 02-25-2011 10:58 AM
vnc server/vnc client with sound support fire-fly Linux - Server 2 12-30-2010 05:21 PM
trying to remote to vnc server through vnc client on XP. Kilahchris Linux - Newbie 3 11-22-2006 04:50 PM
windows vnc client and linux vnc server problem tungaw2001 Linux - Software 8 06-17-2006 01:06 AM


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