View previous topic :: View next topic |
Author |
Message |
lines n00b
Joined: 29 Jul 2003 Posts: 20
|
Posted: Wed Aug 06, 2003 2:37 pm Post subject: How to turn your box into a Xvnc Terminal Server |
|
|
Xvnc Terminal Server
All these steps should be completed as root.
1) Install tightvnc:
2) Install xinetd
Code: | emerge xinetd
rc-update add xinetd default |
3) Allow xinetd to listen to external calls:
open /etc/xinetd.conf
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 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:
Code: | #
# 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 with the following contents:
Code: | 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
# port = 5973
}
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) (re)start the xinetd service
Code: | /etc/init.d/xinetd restart |
11) restart the gdm/kdm/xdm service ( this will end your X session)
Code: | /etc/init.d/xdm restart |
12) open a vncviewer to test it:
Code: | vncviewer 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.
Troubleshooting
I will edit this post to include some more troubleshooting tips, but i'm at my work right now.
If you feel all yummy in your tummy, please let me know.
____________________________________________________________________
EDIT: Tutorial was a few posts down... moved it to this post. Original post follows. -- pjp
____________________________________________________________________
Scroll down to see the tutorial
Anybody interested in a vncserver on linux that functions like a windows terminal server?
You can connect to it with your vnc client. Then you'll be presented with a gdm loginscreen, and you can work as normal. You don't have to start a vncserver daeomon before someone can connect to it. It will just listen for anyone to connect and then spawn a daemon. (is that the right word?)
I have a redhat guide in how to do that but i could change it to work with gentoo.
If you're interested please let me know.
Last edited by lines on Fri Aug 08, 2003 9:51 am; edited 5 times in total |
|
Back to top |
|
|
soebbi Tux's lil' helper
Joined: 30 Mar 2003 Posts: 93 Location: Stadtlohn, Germany
|
Posted: Wed Aug 06, 2003 3:08 pm Post subject: |
|
|
Sounds interesting, but what happens if i connect to the server, log in and then just kill the connection? Will i have to re-login next time i connect or will i get my session back?
I'm quite sure you can do this with X and an xdm alone as well, a local LUG member told me this a few weeks ago. If you or someone else is interested in this, i might ask him and write a short "howto" for it!?
Greets!
Soebbi _________________ "Even though Mac Users may be only 10% of market, always remember we are the top 10%"
- Douglas Adams |
|
Back to top |
|
|
darookee Apprentice
Joined: 02 Jan 2003 Posts: 162 Location: Long Beach, CA.
|
Posted: Wed Aug 06, 2003 3:44 pm Post subject: |
|
|
i would love to see that howto! :D |
|
Back to top |
|
|
vivek n00b
Joined: 19 Jul 2002 Posts: 51 Location: In Your Nightmare
|
Posted: Wed Aug 06, 2003 4:33 pm Post subject: |
|
|
Yes.
Something new to learn and experiment . |
|
Back to top |
|
|
lines n00b
Joined: 29 Jul 2003 Posts: 20
|
Posted: Thu Aug 07, 2003 7:03 am Post subject: |
|
|
Ok well that's enough for me
And soebbi, it is possible with X, but X is not a very good protocol to use over dialup. And my howto will be with tightvnc, which is almost just as thin as rdp.
Also when you kill your session you will start all over again. But maybe we can figure that out somehow. |
|
Back to top |
|
|
kitano Apprentice
Joined: 19 Dec 2002 Posts: 228 Location: Munich, Germany, Europe, Earth
|
Posted: Thu Aug 07, 2003 7:14 am Post subject: |
|
|
hi lines,
i guess that would be a good thing. I started up the vncserver whenever needed, but having a slim daemon listening, and doing the job, would be preferrable.
lets see what u have...
greetz
kitano _________________ ->searched for a gentoo penguin ->alienated it with "find edges", "saturation", "photocopy" ->encoded quicktime from still ->played with aaxine ->screenshotted ->made it my avatar
only in case you were going to ask what it is... |
|
Back to top |
|
|
lines n00b
Joined: 29 Jul 2003 Posts: 20
|
Posted: Fri Aug 08, 2003 9:38 am Post subject: |
|
|
Thank you for your patience,
here it is:
EDIT: Moved to 1st post. -- pjp
Last edited by lines on Fri Aug 15, 2003 6:50 am; edited 1 time in total |
|
Back to top |
|
|
pYrania Retired Dev
Joined: 27 Oct 2002 Posts: 650 Location: Cologne - Germany
|
Posted: Fri Aug 08, 2003 11:09 am Post subject: |
|
|
could post this to Documentation, Tips & Tricks?
it isn't a support question, though. _________________ Markus Nigbur |
|
Back to top |
|
|
Uranus Guru
Joined: 07 May 2002 Posts: 438 Location: Portugal, Braga
|
Posted: Fri Aug 08, 2003 12:02 pm Post subject: |
|
|
I fail to see the relevance of this tutorial. Tightvnc already comes with a vnc server! |
|
Back to top |
|
|
lines n00b
Joined: 29 Jul 2003 Posts: 20
|
Posted: Fri Aug 08, 2003 12:40 pm Post subject: |
|
|
Yes but with this tutorial you can make it to automatically spawn when someone wants to connect, just like a terminal server. Instead of manually starting some vncservers for some users. That would not be useful in a production environment. |
|
Back to top |
|
|
masseya Bodhisattva
Joined: 17 Apr 2002 Posts: 2602 Location: Baltimore, MD
|
Posted: Fri Aug 08, 2003 12:52 pm Post subject: |
|
|
Moving from Desktop Environments. _________________ if i never try anything, i never learn anything..
if i never take a risk, i stay where i am.. |
|
Back to top |
|
|
marshall_j Tux's lil' helper
Joined: 22 Jan 2003 Posts: 98 Location: NZ
|
Posted: Sun Aug 10, 2003 3:13 am Post subject: |
|
|
Just gave it a go and it works exactly as described.
Good work |
|
Back to top |
|
|
rojaro l33t
Joined: 06 May 2002 Posts: 732
|
Posted: Tue Aug 12, 2003 1:53 am Post subject: |
|
|
a really nice tutorial, so i could not resist to try it out - but then found out that i have a problem here ..
as i use gdm here, i tried to do the setup with it, but without success. i end up at the grey screen (the standard X11 background) and the "X" cursor when i am connected via tightvnc viewer.
so i just changed the rc.conf to run xdm instead (never ran it on the machine in question before) and made the appropriate changes to the xdm-config file. but xdm does not want to work at all. instead it drops me the following two lines into /var/log/xdm.log:
Code: | xdm error (pid 10665): chooser socket creation failed, errno 97
xdm error (pid 10665): XDMCP socket creation failed, errno 97 |
so i've double checked the xdm-confg file, but everything looks good to me (yes, "DisplayManager.requestPort: 0" is uncommented with an "!" in front) and the Xaccess file just consists of an single asterisk.
then i've switched back to gdm and checked if the XDMCP udp port is open, but it is as netstat -anv and nmap -sU localhost report. i've crawled through the logs (/var/log and /var/lib/gdm) but havent found anything useful so far. and not even google could help me so far :(
any idea what the problems root could be?
EDIT: Ok, i've found the reason for this problem: When i built the machine i've added ipv6 Support to the Kernel and also into the make.conf file. Therefore all the packages that utilize the ipv6 flag have been compiled to use IPV6 Support. As i found out now i've forgot to enable IPV6 Support when i installed a new Kernel the last time (i didnt use the .config file back then and configured the kernel by make config instead) and xdm & kdm didnt like that while gdm just did not care :) _________________ A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970)
Last edited by rojaro on Tue Aug 12, 2003 11:47 am; edited 1 time in total |
|
Back to top |
|
|
carambola5 Apprentice
Joined: 10 Jul 2002 Posts: 214
|
Posted: Tue Aug 12, 2003 5:22 am Post subject: |
|
|
so does this allow/support concurrent multi-user remote X sessions?
If so, is there any extra setup needed to implement such functionality? |
|
Back to top |
|
|
rojaro l33t
Joined: 06 May 2002 Posts: 732
|
Posted: Tue Aug 12, 2003 10:35 am Post subject: |
|
|
carambola5 wrote: | so does this allow/support concurrent multi-user remote X sessions? |
yes of course, that's the whole point of this tutorial.
carambola5 wrote: | If so, is there any extra setup needed to implement such functionality? |
not at all, only what's written in the tutorial above ... of cousre you'll have to install XFree before :) _________________ A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970) |
|
Back to top |
|
|
lines n00b
Joined: 29 Jul 2003 Posts: 20
|
Posted: Wed Aug 13, 2003 8:17 pm Post subject: |
|
|
Unlike Windows Terminal Services, games and videos also play like a charm, Office needs no extra configuring. Just wat runs locally will probably work remote. The only things I found that do not work are:
OpenGL games like Quake III, tuxracer etc.
Sound. (but that doesn't work with terminal server to)
Does anybody have an idea how to make sound working (remote)? |
|
Back to top |
|
|
sKewlBoy Guru
Joined: 03 Nov 2002 Posts: 406 Location: Portugal
|
Posted: Wed Aug 13, 2003 9:04 pm Post subject: |
|
|
you could try using some kinda audio broadcasting software...
that'd be a possible workaround, although there must be some better solutions... |
|
Back to top |
|
|
timbo Apprentice
Joined: 29 Jul 2002 Posts: 231 Location: New Zealand
|
Posted: Wed Aug 13, 2003 10:12 pm Post subject: |
|
|
Great How-To...
I set something similar up using my main gentoo box as the server and a my work winblowzXP box as the client. I use another box running IPCop and dial up.
Now I could start up a fluxbox or whatever session and then use my linux apps etc to connect to the internet (automatically via the IPCop box) problem was that after I had finished and shut down the tight vnc client the internet connection would never go down . The only way the connection would go down was to disconnect via the IPCop admin screen or shut down my gentoo box.
Has anyone had this problem, could anyone offer a suggestion.
Regards
Tim
_________________ Linux User: 303160 |
|
Back to top |
|
|
rojaro l33t
Joined: 06 May 2002 Posts: 732
|
Posted: Wed Aug 13, 2003 11:28 pm Post subject: |
|
|
sKewlBoy wrote: | you could try using some kinda audio broadcasting software... |
NAS - Network Audio System would be a possible Solution, but that would require you to run an additional NAS Client... _________________ A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970) |
|
Back to top |
|
|
sKewlBoy Guru
Joined: 03 Nov 2002 Posts: 406 Location: Portugal
|
Posted: Thu Aug 14, 2003 12:38 pm Post subject: |
|
|
Quote: |
but that would require you to run an additional NAS Client...
|
yes, but if VNC doesnt support audio, you will to run extra software anyways... |
|
Back to top |
|
|
christsong84 Veteran
Joined: 06 Apr 2003 Posts: 1003 Location: GMT-8 (Spokane)
|
Posted: Fri Aug 15, 2003 1:21 am Post subject: |
|
|
thought it worked like a charm until I tried to connect..anyone else have this issue?
Client side:
Code: |
swells@psalms swells $ vncviewer 192.168.1.1:71
VNC server supports protocol version 3.3 (viewer 3.3)
vncviewer: VNC server closed connection
swells@psalms swells $
|
server log
Code: |
XFree86 Version 4.3.0
Release Date: 27 February 2003
X Protocol Version 11, Revision 0, Release 6.6
Build Operating System: Linux 2.4.21 i686 [ELF]
Build Date: 07 August 2003
Before reporting problems, check http://www.XFree86.Org/
to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Thu Aug 14 18:20:00 2003
(==) Using config file: "/etc/X11/XF86Config"
Using vt 8
(II) [GLX]: Initializing GLX extension
sessions: SessionTypes=Xsession,enlightenment,icewm,waimea,
Changing kdmrc in /usr/kde/*
/etc/X11/xdm/Xsetup_0: line 25: cd: /usr/kde/*/share/config/kdm: No such file or directory
Changing kdmrc in /usr
/etc/X11/xdm/Xsetup_0: line 25: cd: /usr/share/config/kdm: No such file or directory
|
any thoughts? _________________ while(true) {self.input(sugar);} |
|
Back to top |
|
|
lines n00b
Joined: 29 Jul 2003 Posts: 20
|
Posted: Fri Aug 15, 2003 6:39 am Post subject: |
|
|
Does kdm work without vnc?? Maybe you should use gdm, look if that solves the problem. |
|
Back to top |
|
|
christsong84 Veteran
Joined: 06 Apr 2003 Posts: 1003 Location: GMT-8 (Spokane)
|
Posted: Fri Aug 15, 2003 1:44 pm Post subject: |
|
|
i have neither kdm nor gdm installed and don't want to use them. But it seems to think they are... _________________ while(true) {self.input(sugar);} |
|
Back to top |
|
|
rojaro l33t
Joined: 06 May 2002 Posts: 732
|
Posted: Fri Aug 15, 2003 2:41 pm Post subject: |
|
|
christsong84 wrote: | i have neither kdm nor gdm installed and don't want to use them. But it seems to think they are... |
check your /etc/rc.conf and make sure that your "DISPLAYMANAGER" is set to xdm. Code: | DISPLAYMANAGER="xdm" |
_________________ A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970) |
|
Back to top |
|
|
christsong84 Veteran
Joined: 06 Apr 2003 Posts: 1003 Location: GMT-8 (Spokane)
|
Posted: Fri Aug 15, 2003 6:16 pm Post subject: |
|
|
Code: | # /etc/rc.conf: Global startup script configuration settings
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/rc.conf,v 1.20 2003/04/27 18:39:59 azarah Exp $
# Use KEYMAP to specify the default console keymap. There is a complete tree
# of keymaps in /usr/share/keymaps to choose from. This setting is used by the
# /etc/init.d/keymaps script.
KEYMAP="us"
# The map to load for extended keyboards. Most users should leave this as is.
EXTENDED_KEYMAP="windowkeys"
# CONSOLEFONT specifies the default font that you'd like Linux to use on the
# console. You can find a good selection of fonts in /usr/share/consolefonts;
# you shouldn't specify the trailing ".psf.gz", just the font name below.
# To use the default console font, comment out the CONSOLEFONT setting below.
# This setting is used by the /etc/init.d/consolefont script (NOTE: if you do
# not want to use it, run "rc-update del consolefont" as root).
CONSOLEFONT="default8x16"
# CONSOLETRANSALTION is the charset map file to use. Leave commented to use
# the default one. Have a look in /usr/share/consoletrans for a selection of
# map files you can use.
#CONSOLETRANSLATION="8859-1_to_uni"
# Set CLOCK to "UTC" if your system clock is set to UTC (also known as
# Greenwich Mean Time). If your clock is set to the local time, then set CLOCK
# to "local". This setting is used by the /etc/init.d/clock script.
CLOCK="UTC"
# Set EDITOR to your preferred editor.
EDITOR="/bin/nano"
#EDITOR="/usr/bin/vim"
#EDITOR="/usr/bin/emacs"
# Set PROTOCOLS to the protocols that you plan to use. Gentoo Linux will only
# enable module auto-loading for these protocols, eliminating annoying module
# not found errors.
#
# NOTE: Do NOT uncomment the next lines, but add them to 'PROTOCOLS=...' line!!
#
# Num Protocol
# 1: Unix
# 2: IPv4
# 3: Amateur Radio AX.25
# 4: IPX
# 5: DDP / appletalk
# 6: Amateur Radio NET/ROM
# 9: X.25
# 10: IPv6
# 11: ROSE / Amateur Radio X.25 PLP
# 19: Acorn Econet
# Most users want this:
PROTOCOLS="1 2"
#For IPv6 support:
#PROTOCOLS="1 2 10"
# What display manager do you use ? [ xdm | gdm | kdm | elogin | entrance ]
DISPLAYMANAGER="xdm"
# XSESSION is a new variable to control what window manager to start
# default with X if run with xdm, startx or xinit. The default behavior
# is to look in /etc/X11/Sessions/ and run the script in matching the
# value that XSESSION is set to. The support scripts is smart enouth to
# look in all bin directories if it cant find a match in /etc/X11/Sessions/,
# so setting it to "enligtenment" can also work. This is basically used
# as a way for the system admin to configure a default system wide WM,
# allthough it will work if the user export XSESSION in his .bash_profile, etc.
#
# NOTE: 1) this behaviour is overridden when a ~/.xinitrc exists, and startx
# is called.
# 2) even if a ~/.xsession exist, if XSESSION can be resolved, it will
# be executed rather than ~/.xsession, else KDM breaks ...
#
# Defaults depending on what you install currently include:
#
# Gnome - will start gnome-session
# kde-<version> - will start startkde (ex: kde-3.0.2)
# Xsession - will start a terminal and a few other nice apps
XSESSION="enlightenment"
|
_________________ while(true) {self.input(sugar);} |
|
Back to top |
|
|
|