LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   VNC over xinetd doesn't starts vncserver (https://www.linuxquestions.org/questions/linux-server-73/vnc-over-xinetd-doesnt-starts-vncserver-846817/)

jstitch 11-26-2010 11:39 PM

VNC over xinetd doesn't starts vncserver
 
Hi,

in Debian Lenny, using TightVNC 1.3.9 I can setup a VNC server manually by using

Code:

vncserver -query localhost -once -geometry 1024x768 -depth 16 :1
But then, as I have read is a better option, I use xinetd with the following configuration:

Code:

service vnc-1024x768x16
 {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/vncserver
    server_args = -inetd -query localhost -once -geometry 1024x768 -depth 16
 }

I have open port 5901 to connect to the server. With first way (vncserver alone) I manage to connect to my server succesfully.

But with xinetd way I just can't connect.

Externally I can see that port 5901 is open and even that VNC service is available. Looking at VNC log generated for the :1 display I haven't found anything.

In fact, I was considering that the problem was with xinetd, but I have other services setted up with it (telnet & ftp for example) and I can use them correctly.

So now I'm lost with this, what else am I not considering with VNC service through xinetd? Where can I find logs or useful information to get a clue about this problems?

Any ideas?

Thanks for reading...

Ehtetur 11-28-2010 01:41 PM

The first thing that caught my eye was that in RHEL, the VNC config file for xinetd needs the following lines that are missing from your Debian example:
Code:

    disable = no
    port = 5901

Insert them and restart xinetd to see if it fixes your problem.

jstitch 11-29-2010 02:02 PM

well... nope, didn't work :S

the fact that I cannot find any log or something is the most frustrating thing...

bathory 11-29-2010 02:16 PM

Hi,

Replace "server = /usr/bin/vncserver" with:
Code:

server = /usr/bin/Xvnc
set "disable = no" and see if it works

Regards

jstitch 11-29-2010 03:59 PM

Quote:

Originally Posted by bathory (Post 4175045)
Hi,

Replace "server = /usr/bin/vncserver" with:
Code:

server = /usr/bin/Xvnc
set "disable = no" and see if it works

Regards

ummmm well, now I got a prompt asking me for a password!
the fact is that I write the password I normally use when I run VNC but it doesn't works here.
This password is stored in $HOME/.vnc/passwd file...

BTW, Xvnc is not Xtightvnc as far as I recon, vncserver is the wrapper for Xtightvnc to run, but Xvnc in fact points to a program called Xvnc4 (can't remember installed this one) - In the above line I changed Xvnc for Xtightvnc but with no results...

eSelix 11-29-2010 04:18 PM

You need option "-rfbauth /home/username/.vnc/passwd".
This config works for me:
Code:

service VNC_0
    {
    disable        = no
    type            = UNLISTED
    socket_type    = stream
    protocol        = tcp
    port            = 5900
    user            = root
    server          = /usr/bin/x11vnc
    server_args    = -inetd -o /var/log/x11vnc.log -display -shared -norc -cursor arrow -pointer_mode 4 -rfbauth /root/.vnc/passwd -alwaysshared -xdamage
    wait            = no
    }


bathory 11-29-2010 04:25 PM

Hi,

You can:
Add "-SecurityTypes None" in the server_args, so it doesn't prompt for a password.

Or change the user, from nobody to the user that has a ~/.vnc/passwd file and use the -rfbauth option to specify the password file if necessary

Regards

jstitch 11-29-2010 04:55 PM

wow, I've used both the option of 'SecurityTypes', and also changing the user for the rfbauth option.
It now half works...

I can enter the password file as I've been using it, and now I get a sort of X window, but with no login screen, nor even a terminal or something...

Mmmm as far as I'm understanding this, when I use the 'not xinetd' way, with vncserver, I manage to start with something called XDMCP, and so as I've configured it I get even a login screen, as if sitting at my computer just about to login...

This vncserver program accepts another parameter:

Code:

-query localhost
(as I've wrote it at the beginning of this thread)

Anyway, I've noticed that
Code:

vncserver -query localhost
gives me XDMCP and so the login screen...
I try to use
Code:

Xvnc -query localhost
too. Doing it manually (not xinetd), I manage to get a login screen! but anyway is a little bit laggy (I really prefer Xtightvnc, it's working fine for me...)
Using
Code:

Xvnc -query localhost
from xinetd doesn't works for me now... this is pretty strange...


AND! now I've got a new problem! while testing, using a command line for Xvnc, I've got the following error message:

XDMCP fatal error: Session declined Maximum number of open sessions from your host reached

and can't start a VNC server any more :/
I know this is a collateral problem, but what should I do about it now? Googling a little I've found it's related to the number of XDMCP sessions allowed, but only found how to make this maximum greater, and perhaps what I need is to kill the current ones? I'm lost now...

BTW, eSelix, your configuration is for x11vnc, which isn't quite what I need right now: x11vnc allows me to control the current X display, usually named :0 , but I need a virtual one, not to control the current one.

eSelix 11-29-2010 05:25 PM

Oh yes, sorry, I forgot that I am using it for current display. As for not working "Xvnc -query localhost" - did you killed all Xvnc processes and restarted xinetd?

bathory 11-29-2010 06:14 PM

Take a look at this howto that is written for tightvnc

Regards

jstitch 11-29-2010 10:52 PM

ok, thanks!

look, I restarted my computer, to clean that XDMCP problem basically, but using the following configuration:

Code:

service vnc-1024x768x16
{
  protocol = tcp
  socket_type = stream
  wait = no
  user = user_name
  server = /usr/bin/Xvnc
  server_args = -inetd -query localhost -once -geometry 1024x768 -depth 16 -rfbport=5901 -rfbauth=/home/user_name/.vnc/passwd
  disable = no
}

I managed to connect remotely using VNC and with a login screen and all... don't know what changed, perhaps just the reboot process.
I just can connect once to it, I mean I can't start more than one session at a time.

Now I'll take a look at your tightvnc howto to see what else can I achieve :)

Thanks to all of you!



PS further questions I'll post them here tomorrow, that's why I'll wait till then to mark this as solved, ok?

jstitch 11-30-2010 11:08 AM

Ok...

following the TightVNC tutorial, I noticed the following:

-the tutorial uses Xvnc so as I've been using it in the last posts.
-man page for vncserver in fact says that it is a wrapper for Xvnc program
-but when I run vncserver alone, no xinetd, with a ps aux | grep vnc , I notice that the program that is called is Xtightvnc, not Xvnc
-but when I use Xtightvnc in xinetd.conf, I can't get any connections...
-using Xvnc I get a connection, but it is rather a little bit slow, maybe I'll have to live with it (unless I can get Xtightvnc to be run instead of Xvnc)

I'll keep experimenting with this a little... At least I think now I can handle it a lot better...

BTW, I discovered that Xvnc is in fact RealVNC for my machine, not TightVNC as I desired, guess I'll have to look more on how to redirect things well, also on how to use Xtightvnc as I desire...

thanks again

I'll mark this one as solved, but any further ideas are welcomed :)



-- UPDATE --
just as a colophon...
I finally got to get Xtightvnc to work.
The problem?
In the xinetd server_args configuration line doesn't accepts the '=' character for assigning value to parameters! :D
so the final result is:

Code:

service vnc-1024x768x16
{
  protocol = tcp
  socket_type = stream
  wait = no
  user = user_name
  server = /usr/bin/Xvnc
  server_args = -inetd -query localhost -once -geometry 1024x768 -depth 16 -rfbport 5901 -rfbauth /home/user_name/.vnc/passwd
  disable = no
}

I also had to change the Xvnc soft link, which was pointing to Xvnc4 (realvnc) so it finally pointed to Xtightvnc...


All times are GMT -5. The time now is 02:04 AM.