• Welcome to Computer Association of SIUE - Forums.
 

XVNC Terminal Server How-To

Started by Stiffler, 2003-09-04T18:03:10-05:00 (Thursday)

Previous topic - Next topic

Stiffler

I'm sure y'all know, by now, what lousey spelling and grammer I have, so feel free to correct me. I will make changes when appropriate.

This is based on other How-Tos I've read. I will post the links as soon as I find them again.

XVNC because it's a VNC Server on Linux that functions like a Windows Terminal Server!

This how-to will explain how to set up a TightVNC Server, so that a daemon with a certain resolution and bit depth given by the port number is automatically started. TightVNC is used because it is almost as thin as RDP, and it's slightly better. Once the connection is made, the user will be presented with the KDM/GDM/XDM login screen, then whatever Window manager the user wants to use can be selected. The only draw-back, if you see it as one, is that the session and daemon go away when the user closes the TightVNC viewer. I guess this is good if you are tired of users leaving a VNC Server daemon running for long periods of time. I know one Admin that took VNC Server off of a server for that reason. :-)

All these steps should be completed as root.

1) Install tightvnc.

2) Install xinetd, if not installed already. If you are using an rc system, like Gentoo, you might need to do something like:
Quoterc-update add xinetd default

3) Allow xinetd to listen to external calls:
open /etc/xinetd.conf (Might be in a different location depending on distribution, but this is the most common place.)
put a # in front of the line:
only_from = localhost

4) Change the xdm configuration so it listens to XDCMP request
open /etc/X11/xdm/xdm-config with your favorite editor.
Look at the last line : "DisplayManager.requestPort :0"
Comment it out by inserting a ! at the beginning of the line.

5) Configure kdm:
if you use kdm, edit /etc/kde/kdm/kdmrc and enable XDMCP on port 177.

6) Configure gdm:
if you use gdm, start gdmconfig and go to the tab "XDCMP"
Make sure 'Enable XDMCP' is checked.

7) Specify who can have access to:
edit /etc/X11/xdm/Xaccess and uncomment the line " '* #any host can get a login window" by removing the single quote
You could also change it to 192.168.0.* for some security.

8) Add some services to the services file. Cut & paste the following lines to your /etc/services (might be in a different location):

Quote#
# VNC Servers
#
vnc-640x480x8 5950/tcp
vnc-800x600x8 5951/tcp
vnc-1024x768x8 5952/tcp
vnc-1280x1024x8 5953/tcp
vnc-1600x1200x8 5954/tcp

vnc-640x480x16 5960/tcp
vnc-800x600x16 5961/tcp
vnc-1024x768x16 5962/tcp
vnc-1280x1024x16 5963/tcp
vnc-1600x1200x16 5964/tcp

vnc-640x480x24 5970/tcp
vnc-800x600x24 5971/tcp
vnc-1024x768x24 5972/tcp
vnc-1280x1024x24 5973/tcp
vnc-1600x1200x24 5974/tcp

vnc-640x480x32 5980/tcp
vnc-800x600x32 5981/tcp
vnc-1024x768x32 5982/tcp
vnc-1280x1024x32 5983/tcp
vnc-1600x1200x32 5984/tcp

9) create a file called /etc/xinetd.d/xvncserver (xinet.d might be in a different location depending on system) with the following contents:

service vnc-640x480x8
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 640x480 -depth 8
}

service vnc-800x600x8
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 800x600 -depth 8
}

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

service vnc-1280x1024x8
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 8
}

service vnc-1600x1200x8
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 1600x1200 -depth 8
}

service vnc-640x480x16
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 640x480 -depth 16
}

service vnc-800x600x16
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 800x600 -depth 16
}

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

service vnc-1280x1024x16
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 16
}

service vnc-1600x1200x16
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 1600x1200 -depth 16
}

service vnc-640x480x24
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 640x480 -depth 24
}

service vnc-800x600x24
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 800x600 -depth 24
}

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

service vnc-1280x1024x24
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 24  
}

service vnc-1600x1200x24
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 1600x1200 -depth 24
}

service vnc-640x480x32
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 640x480 -depth 32
}

service vnc-800x600x32
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 800x600 -depth 32
}

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

service vnc-1280x1024x32
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 32
}

service vnc-1600x1200x32
{
          protocol = tcp
          socket_type = stream
          wait = no
          user = nobody
          server = /usr/bin/Xvnc
          server_args = -inetd -query localhost -once -geometry 1600x1200 -depth 32
}


10) restart the xinetd service:
Quote/etc/init.d/xinetd restart

11) restart the gdm/kdm/xdm service (this will end your X session). Select the one you use:
Quote/etc/init.d/(gdm/kdm/xdm) restart

12) open a vncviewer to test it:
Quotevncviewer localhost:71

This will open up a 800x600x24bit client. If you want another resolution or color depth, just use the two last number shown in the services file. Multiple users can use the same command, ie: vncviewer solar.cs.siue.edu:72 (1024x768x24), but each will get their own desktop. Cool!

The quote boxes looked better than the code boxes, so it is not an error that I used those.

Any comments (this is cool, it's a piece of junk, etc), questions, or corrections?

Jon
Retired webmaster of CAOS.

Stiffler

Well, after 15 views, no bodyd spotted any errors. Either that, or nobody wanted to read this rather long post. I was hoping to post something that not to many people knew about.

Has anybody tried this yet, or going to try it? I know what I mean when I read this How-To, but I need to know if y'all can follow it.

Jon
Retired webmaster of CAOS.

Guest

Hi jon,


I made step by step all what you indicate in that presentation.

But when I tied
  vncviewer localhost:51

vncviewer responds
  vncviewer: VNC server closed connection

If I look in system log, vnc was well launched by xinetd
[xinetd]START: vnc-800x600x16 pid=1310 from 127.0.0.1

Maybe something is missing in one conf file (vnc conf file ?)

Must I have several displays :1, :2,...
in my /etc/X11/xdm/Xservers ?


My environment
  Linux Gentoo 1.4
  KDE 3.1.3


Help would be appreciated

Jacques

Stiffler

I use Gentoo as well. I change the quote bax to a code box for what should be in a file called: /etc/xinetd.d/xvncserver (Step 9) On my screen resolution, the line beginning with "server_args" was on two lines instead of one, so take a look at step 9 to see if everything is correct. The code block did make the text look uglier, but it is correct now. Also, on step 11, did you restart the manager that you use. I retyped that step, so hopefully it is less confusing now. This guide assumes that you already have X set up with a login manager that starts up when your computer starts.

I can't think of anything else that could be wrong. I hope this helps. Let me know if it doesn't. I might have another typo somewhere.

Jon
Retired webmaster of CAOS.

Guest

Hi Jon,

Thank you for your help.

I verified all step and (server_args) in /etc/xinet.d/vncserver file is well written on a single line. I have always no succes with the same vncviewer message
vncviewer : VNC server closed connection.

The problem seems to be the rights of the user "nobody"
If I change the user parm to "root" in the vncserver file
All is OK.

But, for security reason it 's clear that I prefer not to set the user parm to root.

What must I change to user nobody to permit it to launch Xvnc ?

Jacques Landru


William Grim

I removed your second post of the same thing, but in the future if you would mind not posting the exact same thing more than once, it would be appreciated.  We all understand you need help with your VNC server, but repeating the same thing again won't help anyone out.

Thanks.
William Grim
IT Associate, Morgan Stanley

Guest

Hi,

I have solved the "VNC server closed connection" problem for no root user.

The user used to launch Xvnc in xinetd (nobody in my case) must have full access to /tmp and /tmp/.X11-unix.
So setting directory rights to 777 on these directories solves the problem.

A summary of all steps can be found there
http://www.enic.fr/people/landru/vnc-how-to/xvnc-with-xinetd-and-kdm.txt

Jacques

Stiffler

Jacques,

Thanks for finding that. I could not find the solution to your error. I will edit the post when I have time. I've been busy here lately.

Jon
Retired webmaster of CAOS.