LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Multiple VNC client or servers - please help (https://www.linuxquestions.org/questions/linux-newbie-8/multiple-vnc-client-or-servers-please-help-935023/)

yaximik 03-17-2012 08:25 PM

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.

deep27ak 03-19-2012 05:21 AM

can you post the output of

Code:

#cat /etc/sysconfig/vncservers
#cat /root/.vnc/xstartup


yaximik 03-20-2012 05:15 PM

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.

deep27ak 03-20-2012 11:19 PM

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

yaximik 03-22-2012 06:59 PM

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?

yaximik 04-13-2012 01:05 PM

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?

deep27ak 04-14-2012 02:04 AM

"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


All times are GMT -5. The time now is 07:50 AM.