# How to turn your box into a Xvnc Terminal Server

## lines

Xvnc Terminal Server

All these steps should be completed as root.

1) Install tightvnc:

```
emerge tightvnc
```

2) Install xinetd

```
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:

```
#

# 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:

```
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

```
/etc/init.d/xinetd restart
```

11) restart the gdm/kdm/xdm service ( :Exclamation:  this will end your X session)

```
/etc/init.d/xdm restart
```

12) open a vncviewer to test it:

```
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.

----------

## soebbi

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

----------

## darookee

i would love to see that howto! :D

----------

## vivek

Yes.

Something new to learn and experiment  :Smile: .

----------

## lines

Ok well that's enough for me   :Very Happy: 

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.

----------

## kitano

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

----------

## lines

Thank you for your patience,

here it is:

EDIT:  Moved to 1st post.  -- pjpLast edited by lines on Fri Aug 15, 2003 6:50 am; edited 1 time in total

----------

## pYrania

could post this to Documentation, Tips & Tricks?

it isn't a support question, though.

----------

## Uranus

I fail to see the relevance of this tutorial. Tightvnc already comes with a vnc server!

----------

## lines

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.

----------

## masseya

Moving from Desktop Environments.

----------

## marshall_j

Just gave it a go and it works exactly as described.

Good work  :Smile: 

----------

## rojaro

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:

```
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 :)

----------

## carambola5

so does this allow/support concurrent multi-user remote X sessions?

If so, is there any extra setup needed to implement such functionality?

----------

## rojaro

 *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 :)

----------

## lines

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)?

----------

## sKewlBoy

you could try using some kinda audio broadcasting software...

that'd be a possible workaround, although there must be some better solutions...

----------

## timbo

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   :Sad:  .  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

 :Cool: 

----------

## rojaro

 *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...

----------

## sKewlBoy

 *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...

----------

## christsong84

thought it worked like a charm until I tried to connect..anyone else have this issue?

Client side:

```

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

```

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?

----------

## lines

Does kdm work without vnc?? Maybe you should use gdm, look if that solves the problem.

----------

## christsong84

i have neither kdm nor gdm installed and don't want to use them.  But it seems to think they are...

----------

## rojaro

 *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.

```
DISPLAYMANAGER="xdm"
```

----------

## christsong84

```
# /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"

```

----------

## Jesse

And of course for those who don't know already. New KDE has this built in so there really is no setup and no need for tightvnc.  Just connect with a vnc client.  Use this especially if you don't need/want the gdm/kdm/xdm login screen.  (maybe you can even have it set up that way although I've never tried)

Also, there is an initiative on tightvnc's website to support sound through the protocol as well I believe.

And yes, Windows Terminal services does support sound.  It also supports mapping your remote drives as local automatically too.  A few other things as well.

All in all though the tutorial should be quite useful though  :Smile: 

----------

## wizy

worked like a charm..   great tutorial, thanks.

----------

## cyfred

When I try this I get the same errors as christsong84

```
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
```

Similarly I do not have anything kde related installed. So why on earth would it want to find kdmrc? 

Because of this I am also unable to get past the X black and white hash screen with a X cursor. If I invoke the vncserver command manually I can connect and use VNC fine though. I tried changing the options past to Xvnc, and also just getting something else to happen and have found that xinetd is working properly, so its definately something to do with xdm.

I wouldve just emerged kdm and used it, but I cant seem to get arts to compile, so no kdelibs, which means no kdebase or kdm. Im currently emerging gdm to test with that... gdm is probably more preferable for my needs anyway.

----------

## cyfred

Futhermore I have just set this up using GDM and it does NOT work still.

All I get is a blank checked screen, yes gdm is running, and so is xinetd with the right settings in /etc/xinetd.d/xvncserver -- im pulling my hair out over this and am currently pushing kde to compile so i can try with kdm.

Does anyone have any ideas.

----------

## rojaro

as i wrote earlier in this thread already, i had the same problem. i had the ipv6 use flag set - therefore also gdm got compiled with ipv6 support, but didnt compile the kernel with ipv6 support. maybe you've got the same problem :)

----------

## christsong84

no ipv6 support in any of my use flags...use flags are as folows:

```
USE="apache2 acpi dnd flash gd imap pcmcia pds php pnp samba usb -gnome -kde aalib direct fb fbcon svga"
```

----------

## rojaro

check the output of "emerge config"

----------

## christsong84

um...

```
psalms swells # emerge config

Currently, 'config' is a help option only.

psalms swells # 
```

----------

## rojaro

sorry, my fault, it's emerge info

----------

## christsong84

ok...here's the output (a bit more meaningful than the last one...no worries tho...we all make mistakes)  :Wink:   :Very Happy: 

```
psalms swells # emerge info

Portage 2.0.48-r5 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)

=================================================================

System uname: 2.4.21 i686 Intel(R) Pentium(R) III Mobile CPU      1000MHz

GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"

CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config"

CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"

PORTDIR="/usr/portage"

DISTDIR="/usr/portage/distfiles"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR_OVERLAY=""

USE="x86 oss 3dnow apm avi crypt cups encode foomaticdb gif jpeg libg++ mad mikmod mmx mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib directfb gtkhtml alsa gdbm berkdb slang readline arts bonobo tcltk java guile mysql X sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis gtk qt motif opengl mozilla gphoto2 cdr apache2 acpi dvd flash gd imap pcmcia pds php pnp samba usb -gnome -kde aalib direct fb fbcon svga"

COMPILER="gcc3"

CHOST="i686-pc-linux-gnu"

CFLAGS="-march=pentium3 -O3 -pipe"

CXXFLAGS="-march=pentium3 -O3 -pipe"

ACCEPT_KEYWORDS="x86"

MAKEOPTS="-j2"

AUTOCLEAN="yes"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

FEATURES="sandbox buildpkg ccache distcc"

psalms swells # 

```

----------

## cyfred

```

Portage 2.0.49_pre17 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r3)

=================================================================

System uname: 2.6.0-test3-mm1 i686 Pentium II (Deschutes)

GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"

CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/config"

CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"

PORTDIR="/usr/portage"

DISTDIR="/mnt/server/portage/distfiles"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR_OVERLAY="/usr/local/portage"

USE="zlib java -3dfx -3dnow aalib -acpi -afs -alsa apache2 apm -arts -atlas avi -berkdb -bonobo -canna -cdr -cjk crypt -cscope cups -curl -debig -dedicated dga directfb -doc -dvb -dvd -emacs -encode -esd ethereal -ev6 -evo fbcon -firebird flash foomaticdb -freetds gb gd -gdbm -ggi gif gnome gphoto2 -gpm gps gtk gtk2 -gtkhtml -guile -icc -icc-pgo -imap imlib -innodb -informix -ipv6 -jack jikes -joystick jpeg junit kde -kerberos -krb4 -ladcca lcms -ldap -leim -libg++ -libgda libwww -lirc -mad -maildir -matrox -mbox -mcal -mikmod memlimit mmx motif mozilla mpeg mpi -mule -mysql -nas ncurses -nhc98 -nls nocardbus nocd -oci8 -odbc -oggvorbis -opengl -oss pam -pcmcia -pda ppds pdflib perl -plotutils png -pnp -postgres -bindist -prelude python qt quicktime -readline -ruby samba -sasl -scanner sdl slang -slp -snmp -socks5 -spell sse ssl svga tcltk tcpd tetex tiff truetype -trusted usb -videos -voodoo3 -wavelan -wmf wxwindows -X Xaw3d -xface -xinerama xml xml2 -xmms xv -zeo x86"

COMPILER="gcc3"

CHOST="i686-pc-linux-gnu"

CFLAGS="-march=pentium2 -O2 -funroll-loops -pipe -fomit-frame-pointer"

CXXFLAGS="-march=pentium2 -O2 -funroll-loops -pipe -fomit-frame-pointer"

ACCEPT_KEYWORDS="x86 ~x86"

MAKEOPTS="-j2"

AUTOCLEAN="yes"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

FEATURES="ccache sandbox fixpackages"

```

Unless my eyes mistake me I have -ipv6 explicitly stated so that this would not happen. Good guess but no bannana this time... Any more ideas?

Yes I know for those of you that read all of that above, that im running extremely unstable, but I dont think that should effect the operation of simple services...

----------

## rojaro

christsong84, cyfred ... well, i am quite out of ideas here ... i think i need to see the configuration files (/etc/X11/gdm/gdm.conf, /etx/X11/xdm/Xaccess, etc.) ... if you post them please remove all the comments from them :)

----------

## christsong84

since I have no gdm installed...I have no gdm.conf...

here's the Xaccess with comments removes as requested

```
192.168.1.*     

```

yep...that's really all that's in there...the computer I connect frmo usually connects from 192.168.1.203 and the server is 192.168.1.1...

----------

## rojaro

what about the /etc/X11/xdm/xdm-config?

----------

## christsong84

as requested...

```

DisplayManager.errorLogFile:    /var/log/xdm.log

DisplayManager.pidFile:         /var/run/xdm.pid

DisplayManager.keyFile:         /etc/X11/xdm/xdm-keys

DisplayManager.servers:         /etc/X11/xdm/Xservers

DisplayManager.accessFile:      /etc/X11/xdm/Xaccess

DisplayManager.willing:         su nobody -c /etc/X11/xdm/Xwilling

DisplayManager*authorize:       true

DisplayManager._0.setup:        /etc/X11/xdm/Xsetup_0

DisplayManager._0.startup:      /etc/X11/xdm/GiveConsole

DisplayManager._0.reset:        /etc/X11/xdm/TakeConsole

DisplayManager*resources:       /etc/X11/xdm/Xresources

DisplayManager*session:         /etc/X11/xdm/Xsession

DisplayManager*authComplain:    true

```

btw: thank for helping me on this!

----------

## cyfred

/etc/X11/xdm/xdm-config

```
DisplayManager.errorLogFile:    /var/log/xdm.log

DisplayManager.pidFile:         /var/run/xdm.pid

DisplayManager.keyFile:         /etc/X11/xdm/xdm-keys

DisplayManager.servers:         /etc/X11/xdm/Xservers

DisplayManager.accessFile:      /etc/X11/xdm/Xaccess

DisplayManager.willing:         su nobody -c /etc/X11/xdm/Xwilling

DisplayManager*authorize:       true

DisplayManager._0.setup:        /etc/X11/xdm/Xsetup_0

DisplayManager._0.startup:      /etc/X11/xdm/GiveConsole

DisplayManager._0.reset:        /etc/X11/xdm/TakeConsole

DisplayManager*resources:       /etc/X11/xdm/Xresources

DisplayManager*session:         /etc/X11/xdm/Xsession

DisplayManager*authComplain:    true

!DisplayManager.requestPort:    0

```

/etc/X11/gdm/gdm.conf

```
[daemon]

AutomaticLoginEnable=false

AutomaticLogin=

TimedLoginEnable=false

TimedLogin=

TimedLoginDelay=30

LocalNoPasswordUsers=

AlwaysRestartServer=true

Configurator=/usr/bin/gdmsetup --disable-sound --disable-crash-dialog

GnomeDefaultSession=/usr/share/gnome/default.session

Chooser=/usr/bin/gdmchooser

DefaultPath=/bin:/usr/bin:/usr/X11R6/bin:/usr/X11R6/bin:/usr/local/bin:/usr/bin

RootPath=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/X11R6/bin:/usr/local/bin:/usr/bin

DisplayInitDir=/etc/X11/gdm/Init

Greeter=/usr/bin/gdmgreeter

RemoteGreeter=/usr/bin/gdmgreeter

User=gdm

Group=gdm

KillInitClients=true

LogDir=/var/lib/gdm

PidFile=/var/run/gdm.pid

PostSessionScriptDir=/etc/X11/gdm/PostSession/

PreSessionScriptDir=/etc/X11/gdm/PreSession/

FailsafeXServer=

XKeepsCrashing=/etc/X11/gdm/XKeepsCrashing

RebootCommand=/sbin/shutdown -r now;/usr/sbin/shutdown -r now

HaltCommand=/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now

SuspendCommand=

ServAuthDir=/var/lib/gdm

SessionDir=/etc/X11/gdm/Sessions/

UserAuthDir=

UserAuthFBDir=/tmp

UserAuthFile=.Xauthority

StandardXServer=/usr/X11R6/bin/X

FlexibleXServers=5

Xnest=/usr/X11R6/bin/Xnest -name Xnest

FirstVT=7

VTAllocation=true

[security]

AllowRoot=true

AllowRemoteRoot=true

AllowRemoteAutoLogin=false

permissions

RelaxPermissions=0

RetryDelay=3

DoS us

UserMaxFile=65536

SessionMaxFile=524388

[xdmcp]

Enable=true

HonorIndirect=true

MaxPending=4

MaxPendingIndirect=4

MaxSessions=16

MaxWait=15

MaxWaitIndirect=15

DisplaysPerHost=2

PingIntervalSeconds

PingInterval=1

Port=177

Willing=/etc/X11/gdm/Xwilling

[gui]

GtkRC=/usr/share/themes/Default/gtk/gtkrc

MaxIconWidth=128

MaxIconHeight=128

[greeter]

TitleBar=false

ConfigAvailable=true

Browser=false

DefaultFace=/usr/share/pixmaps/nobody.png

Exclude=bin,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,nobody,gdm,postgres,pvm,rpm

MinimalUID=100

GlobalFaceDir=/usr/share/faces/

Icon=/usr/share/pixmaps/gdm.png

LocaleFile=/etc/X11/gdm/locale.alias

Logo=/usr/share/pixmaps/gdm-foot-logo.png

Quiver=true

SystemMenu=true

Welcome=Welcome to %n

LockPosition=false

SetPosition=false

PositionX=0

PositionY=0

XineramaScreen=0

BackgroundType=2

BackgroundImage=

BackgroundScaleToFit=true

BackgroundColor=#363047

BackgroundRemoteOnlyColor=true

Perhaps

BackgroundProgram=

RunBackgroundProgramAlways=false

session

ShowGnomeChooserSession=true

ShowGnomeFailsafeSession=true

ShowXtermFailsafeSession=true

Use24Clock=true

UseCirclesInEntry=false

GraphicalTheme=gentoo-emergence

GraphicalThemeDir=/usr/share/gdm/themes/

[chooser]

DefaultHostImg=/usr/share/pixmaps/nohost.png

HostImageDir=/usr/share/hosts/

ScanTime=3

Hosts=

Broadcast=true

[debug]

Enable=false

[servers]

0=Standard

[server-Standard]

name=Standard server

command=/usr/X11R6/bin/X -nolisten tcp

flexible=true

[server-Terminal]

name=Terminal server

command=/usr/X11R6/bin/X -nolisten tcp -terminate

flexible=false

handled=false

```

Im going to try compiling kdm and see if it works

----------

## cyfred

Well to throw a spanner in the works

KDM works   :Very Happy: 

Ill have to admit its not as preety as gdm, which is what I was kinda hoping for so im gonna have to go do some theming ... oh well...

Perhaps its my X version which is 4.3.99.10? Has a bad XDMCP implementation and KDM uses the krfb features that kde has included now a days...

----------

## FishB8

Does this work when the connecting client is connecting via a SSH tunnel?

----------

## cyfred

Yep works perfectly for me with kdm through ssh. It also works perfectly for me (through ssh that is) if i spawn the server session manually and then create the tunnel.

----------

## OrT

Ok i practicly know this tutorial by heart but still

I'm having problems.

Note: just started out with Linux so don't flame me when I

ask stupid questions or if the answer is allready here and I didn't

see it cuz it's all to technical for me at this stage of learning.

My vnc works, I can connect with it on a windoze client,

but I get this nice grey window with a evenly nice X-cursor.. and

that's it !

And I want to see kde :p

Anyone up for helping yet another noobie ?

----------

## vivek

A potentially dumb question..

If two clients connect, will vnc server launch two instances of X ?

Thanks

Regards

----------

## cyfred

 *OrT wrote:*   

> My vnc works, I can connect with it on a windoze client,
> 
> but I get this nice grey window with a evenly nice X-cursor.. and
> 
> that's it ! 

 

That means that xdm/kdm/gdm isnt spawning for you. 

Go back and make sure that you have setup the config files correctly in the tutorial. I never personally got gdm or xdm to work, but kdm does quite nicely -- therefore try all three at least once perhaps they are fickle.

 *vivek wrote:*   

> If two clients connect, will vnc server launch two instances of X ? 

 

Thats technically the idea, albeit its more two instances of Xvnc that are lauched. Which in turn cause a X session to be initialised aswell. Only one actual xdm/gdm/kdm session is needed though, as they handle the XDMCP requests vitually as such. Well thats as far as my ps aux testing shows anyway.

----------

## vivek

cyfred wrote *Quote:*   

> Thats technically the idea, albeit its more two instances of Xvnc that are lauched. Which in turn cause a X session to be initialised aswell. Only one actual xdm/gdm/kdm session is needed though, as they handle the XDMCP requests vitually as such. Well thats as far as my ps aux testing shows anyway.

 

Hmm...and I guess the Linux shared memory handler would also end up in reusing the code of X across multiple clients.

----------

## christsong84

I guess for now I'm stuck with kdm...*goes off to start his compile for kdebase on a PII*

----------

## metalac

I got this thing working on my local network and it works on both Linux and that one dreaded  :Smile:  Win machine.  But the question I have is which ports should I open up on my firewall (it's the firewall running on a seperate linux box acting as a router and firewall for the whole network) so I can access it from outside of my LAN.  I already opened up port 71, but what other ports should I open up.  Will I need to go in and add every single of those 59** ports? or what?

Thnx.

----------

## FishB8

Ok, two questions:

First, I thought connecting vnc viewer through shh would be a breeze but I'm getting a little confused. cyfred: how did you get vnc to connecto using an ssh tunnel. Is it simply a matter of setting up port forwarding or is it more complex than that? Do you have to use the -via option on vncviewer? When you connect, how do you specify BOTH a port and a display number?

Second, what settings must I change so that kdm will allow remote root to login. (I know it's supposedly a security risk, but I'm not too worried about it since any connections through my firewall will have to be routed through an ssh tunnel.)

Thanks!

----------

## foober

Hi All,

I've got the same problem as an earlier poster: The port responds to a VNC request, and loads the standard X Server  grey desktop, but no window manager is invoked.

I don't know the sequence of scripts that are invoked here,  and none of my log files are showing any errors, so I'm at a bit of a loss.

Could someone explain the script chain that's invoked when wanting to start kdm from an xinetd port like this?

-foober

----------

## RioFL

Lines:

A huge thank you is too little!  This has just simplified my life more than you know. I previously had as many as 6 different configurations on one machine and i use remote on 3 machines! I could trash all that and use one simple gdm login now. It worked first time with absolutely no issues at all!

In fact it has given me a few ideas to simplify my network. :Smile: 

This should have a document position all its own where people can easily find it in the main documentation page.

Chuck

----------

## FishB8

Ok, I figured out the answers to my own questions:

First: stupid mistake, I was forwarding to the wrong port.   :Rolling Eyes:   Forward to the correct port and everything works fine.

Second: allowing remote root access through KDM is by setting a variable in KDM's config file. easy.

===**  Those of you who are getting grey screens! **===

This is normal. (Or at least is has been for me) You are probably just closing the window before the display fully loads. I'm using KDM and I get a grey screen with the standard X cursor too, but if I just wait for about 5 seconds the KDM login screen finally comes up. It is an obnoxiously long wait, but it works. See if not waiting long enough is the problem, it may be that nothing is wrong after all.   :Very Happy: 

----------

## nuTTeLLo

Regarding this Xvnc. I would say the service works like a charm on the local network. But I have a question, I intend to use this method through a firewall to access my box other then from my LAN, how does one do this.

And also there doesn't seem to be any prompting for passwords when I use a local vnc viewer to connect. Is this only bacuse I'm connecting it through a LAN? If I were to connect from an outside network, how would I enable passwords for the service?

----------

## FishB8

To access vnc from outstide the network you need to open up the port on the firewall that you intend to connect through. Secondly, you need to have your router set up so that it directs incomming connections on that port to your computer OR direct the incomming port to a server set up with VNC Reflector (It's sort of like a VNC proxy server) which allows you to connect to ANY computer on the LAN with VNC.

You shouldn't need any prompting for passwords, there's no need for it. The display manager does that for you.

You might also want to consider using a VPN tunnel of some sort to connect VNC through when connecting from outside the network. Personally I use an SSH tunnel.

----------

## lines

You should always use a SSH tunnel to connect to your vnc box, because vnc sends your keystrokes in plain text!!! That way everything you type, including passwords could possibly be read by other users.

Been on vacation for a while and saw this many posts  :Very Happy: 

----------

## Athrawn17

how does one start a gdm server?

----------

## lines

probably just install gdm

----------

## vish

All the people who get a grey screen

edit

~/.vnc/xstartup

and on the last line if u have twm put startkde

and it will work!!

----------

## foober

My xstartup file looks like this:

#!/bin/sh

xrdb $HOME/.Xresources

xsetroot -solid grey

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

startkde &

So clearly it's a different problem.  There's nothing in any of the logs indicating any kind of error that I can see...I just have a blank grey screen.

Bummer.

----------

## Mickys21

Problem I have, is ive followed all instructions on how to setup tightvnc etc,

on gentoo terminal if I type

vncserver

i get this up

vncserver

xauth: (argv):1:  bad display name "bt888613:1" in "add" command

New 'X' desktop is bt888613:1

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/bt888613:1.log

on my windows2k machine on tightvnc i type my gentoo ip address:

x.x.x.x:5901 and it connect and works fine.

however if I want to connect to another tightvnc window i try x.x.x.x:5902

it says "failed to connect to server".

So i type vncserver again from my gentoo machine and recieved this:

vncserver

xauth: (argv):1:  bad display name "bt888613:2" in "add" command

New 'X' desktop is bt888613:2

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/bt888613:2.log

so i tried to connect x.x.x.x:5902 and it worked,

What id like to do is to run from the same port (if possible) and not to type in vncserver everytime I want to run vncserver from w2k machines.

any ideas, all my config files are identical to the ones in the howto.

----------

## lines

If you followed all directions, there should be several ports waiting for you to connect. Just try connecting from your w2k box to display number :71

vncviewer yourhost:71

Another resolution could be by taking the last 2 numbers from your config file and use that number as display number (the number 71 in the example above)

With my guide there is no need for a vncserver to be started manually. (that's the whole point actually)

----------

## christsong84

new problem...it now says in the title "nobody's desktop"...so how do I get a normal user's desktop?

----------

## lines

nobody  :Very Happy:  that's because the service gets started as user nobody.

If you want to fix you probably have to take a peek into the source code

----------

## Mickys21

Using display manager xdm

and 'enlightenment'

all set in the relevant config files

set every config file to the documentation

connect using windows tightvnc and recieve grey screen and cursor

is there anything I have missed out on?

=================================================

btw. fixed my above problem, Xaccess file was incorrect.

----------

## Mickys21

 *Mickys21 wrote:*   

> Using display manager xdm
> 
> and 'enlightenment'
> 
> all set in the relevant config files
> ...

 

The above problem being 3 or so posts up not this one.

Micky.

----------

## lines

I see a lot of people with that grey problem. Has anybody fixed it yet? As i can't reproduce the problem.

Don't forget that gdm/xdm or whatever must be running!!!!

----------

## s1lver

I've never delt with vnc before, and I think I'm not doing this in a secure maner. I log in to the console and use startx to get kde up and running, this is the way I want it to be and the only way I can get vnc to work is if I first log in as root and start kdm. 

Any ideas of what I should do to not have to su to root first?

----------

## lines

you'll probably have to :

rc-update add xdm default

----------

## FishB8

Would anybody know why the Desktop fonts are not the same when connecting with VNC? I'm using KDE and for some reason different (ugly) fonts are substituted for the fonts I selected in the settings. Could it be that that the rendering of certain font types has not been turned on for the XVNC sessions?

BTW: My XF86Config is configured to pull all fonts from the font server.

----------

## magrathea

woo, interesting interesting...

Ill try this sometime, but since my laptop had a meeting with the floor today, im doubtful it will be soon.

Well, hopefully everything but the screen works ok, in that case i got a new server to configure.. mp3 server perhaps.. Or is it possible to get good divx/dvd playback on my 333mhz with 256mb ram and ati rage lt pro 4mb gfx ??

Ops.. didnt mean to steal the show.. If you have any interesting tips, send them to me or post, thx.

----------

## snorkel

 *lines wrote:*   

>  Scroll down to see the tutorial  
> 
> Anybody interested in a vncserver on linux that functions like a windows terminal server?
> 
> 

 

Hey thanks, it works sweet.  I can access my desktop from any windows box with vnc.

Snorkel

----------

## lines

 *FishB8 wrote:*   

> Would anybody know why the Desktop fonts are not the same when connecting with VNC? 

 

I'm not sure yet. But i think it has nothing to do with my tutorial but more with vnc. My metacity theme doesn't match too.

----------

## ThE_TemPLaR

The grey screen problem seems to be hard to solve.

gdm is well configured.

man Xvnc doesn't give any information on how work Xvnc so I can't know why it doesn't invoke gdm properly.

All I have is :

gdm is launched in root

Metalog gets that :

```
Oct  2 18:54:19 [xinetd] START: vnc-1024x768x24 pid=6867 from=127.0.0.1

Oct  2 18:56:00 [gdm] gdm_child_action: Aborting display localhost:1

Oct  2 18:56:56 [gconfd (root-6886)] starting (version 2.4.0.1), pid 6886 user 'root'

Oct  2 18:56:56 [gconfd (root-6886)] Resolved address "xml:readonly:/etc/gconf/gconf.xml.mandatory" to a read-only config source at position 0

Oct  2 18:56:56 [gconfd (root-6886)] Resolved address "xml:readwrite:/root/.gconf" to a writable config source at position 1

Oct  2 18:56:56 [gconfd (root-6886)] Resolved address "xml:readonly:/etc/gconf/gconf.xml.defaults" to a read-only config source at position 2

oct  2 18:57:09 [su(pam_unix)] session closed for user root

Oct  2 18:57:17 [gdm(pam_unix)] session closed for user gamer

```

Any idea ?

----------

## borchi

Hi!

firstly, this is a great thread!

i'm now able to get to my home desktop from anywhere  :Smile: 

i know that i really should run vnc through ssh and even manage to make it work. from my work computer i do:

```
ssh -C -L 4961:localhost:5961 my.dyndns-name.com
```

then i enter my home user password

and then again from my work comuter:

```
vncviewer -encodings "tight copyrect" -quality 3 localhost:4961
```

to get my gdm on my home computer.

now, my question:

is there a way to combine those two lines into a singe line?

thanks!

----------

## evers310

I cannot get XDMCP to Listen on port 177, I have tried everything in your tutorial as well as the one on tldp.org. Here is my output from nmap:

```
Gentoo / # nmap localhost

Starting nmap 3.45 ( http://www.insecure.org/nmap/ ) at 2003-10-08 09:02 EDT

Interesting ports on localhost (127.0.0.1):

(The 1656 ports scanned but not shown below are in state: closed)

PORT   STATE SERVICE

22/tcp open  ssh

Nmap run completed -- 1 IP address (1 host up) scanned in 1.892 seconds

Gentoo / #

```

----------

## evers310

I forgot to mention that I do not have any firewalls running or installed. Anyone know what I am doing wrong?

----------

## evers310

Ok, I've got it partly figured out. I had to start the vncserver, now I get the vnc ports open but I'm not able to connect from my Win2K box with tightvnc,  the error I get is failed to connect to server. Here are my open ports.

Gentoo etc # nmap localhost

Starting nmap 3.45 ( http://www.insecure.org/nmap/ ) at 2003-10-08 09:54 EDT

Interesting ports on localhost (127.0.0.1):

(The 1653 ports scanned but not shown below are in state: closed)

PORT     STATE SERVICE

22/tcp   open  ssh

5801/tcp open  vnc-http-1

5901/tcp open  vnc-1

6001/tcp open  X11:1

Nmap run completed -- 1 IP address (1 host up) scanned in 1.886 seconds

G

----------

## evers310

Ok, I switched from tightvnc to real vnc and I can connect now but I was getting twm as my WM. I changed the last line in ~/.vnc/xstartup to gdm & but I'm only getting the dreaded grey screen...  :Sad: 

----------

## evers310

Ok, I finally got it!! For some reason ~/.vnc/xstartup does not like gdm so I just made it /etc/X11/gdm/Sessions/Gnome and i goes directly to Gnome now. Dont know why just putting gdm doesnt work though...

Thanks for all the help!!

----------

## evers310

Your welcome  :Smile: 

----------

## Eowyn

whos ~/.vnc directory is it looking in? after all ~/ meens the users home directory and xinetd starts vnc as nobody

does it alway look it roots?

----------

## Nylle

This is great stuff. I just set up one of my unused machines as a gentoo Xvnc server, now some of my friends who are curious about linux can access it from the comfort of their windows machines and see what linux is about.

Btw, for me it works flawlessly with gdm.

----------

## JonnieDago

Great walkthrough...

Got it up and running with the walkthrough. At first I was affected by the Grey Screen and X and couldnt figure out what was happening. Checked everything and restarted everything I could think of.

Finally started working after a reboot. Just a thought for others not getting past the grey screen.

Question : Does anyone know how to remove the identifying information from the kdm logon screen. Basically I dont want it to display the usernames in that left side pane. I would also prefer that it didnt tell you the system name at the prompt.

----------

## Athrawn17

Check out the kdm manual

http://docs.kde.org/en/3.1/kdebase/kdm/

There is a section that shows how to configure a the list of users that it will display.  Just remove those users from the config file and it won't display them.

I'm not at my gentoo box atm, but I think that if you look at the GreetString, you should see why it is displaying the hostname.  Change that string and you should be all set.

----------

## LowFuel

 *Quote:*   

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

 

Quick question, I do not have this file (or even a /etc/kde), but I do have kde installed and working.

When I do a "locate kdmrc" I get this:

/usr/kde/3.1/share/config/kdm/kdmrc

Should I just edit this one for step 5? I guess I will try it, but any input is welcome.  :Smile: 

----------

## LowFuel

In regards to my last post, it does indeed work.  :Smile: 

So, now for my dumb question - I'd like to be able to connect through VNC to a persistent desktop.  With this setup, everytime I connect I get a login prompt. Is there a way to disconnect, and then reconnect and have things be right where I left them? Maybe I mis-understood the jist of this tutorial.  :Wink: 

----------

## ferris5

maybe a stupid question but here it is:

what should i put in the windowsxp tightvnc viewer to get connected to the linux vnc server?

----------

## EagleClaw

Guys;

I am new to Linux, so some things that are easy, for me it's not. 

I tried to follow the steps on this tutorial, but I didn't get anything. Even when I tried using vncviewer, terminal gave me an library error. Could not locate some libraries. I tried to connect usind a Mac OS, but it didn't find the server. Can PLEASE, somebody help me????

I am using a fresh Red Hat 9.0 install, installed with the server options.

Thanks.

----------

## digitalamish

 *rojaro wrote:*   

>  ... of cousre you'll have to install XFree before 

 

I am interested in setting up a truly headless machine.  How much of the XFree install do I need to do?  I don't want to go through the trouble of setting up X with the old SVGA card I scrounged up (never had much luck).  Generally I just use the tv-out display if I need to sit at the console.

So, if I install XFree, what more config do I need to do?  It would be great if I could just get the binaries in, and then run ONLY a remote desktop on that machine.

BTW: great work on this...

----------

## HomerSimpson

lines Thanks for the instructions. They worked great!

rojaro Thanks for the ipv6 comment. That was my problem too and I would have never figured it out on my own. Thanks!

----------

## lines

This thread is still active  :Very Happy: 

EagleClaw:

This tutorial is for gentoo. I'm sorry.

You should get the needed rpm packages and use redhat tools like service. But I don't think this is the place for RedHat questions.

You can pm me if you like.Last edited by lines on Thu Oct 30, 2003 12:14 pm; edited 1 time in total

----------

## cmay4

I also get the gray screen (using XDM and fluxbox).  I may be able to look into kdm or gdm, but I'd like to keep it light.  Did anyone get straight XDM to work?  Any idea how I can track down the problem?

Chuck

----------

## cmay4

Looked into this furthur and still can't get xdm to work.  I'm really trying not to install kdm.  xdm is running, but I don't see port 177 in use.  Any have any ideas?

Chuck

```
/etc/X11/xdm # nmap localhost

Starting nmap 3.45 ( http://www.insecure.org/nmap/ ) at 2003-10-30 16:52 EST

Interesting ports on localhost.localdomain (127.0.0.1):

(The 1644 ports scanned but not shown below are in state: closed)

PORT     STATE SERVICE

22/tcp   open  ssh

25/tcp   open  smtp

111/tcp  open  rpcbind

139/tcp  open  netbios-ssn

143/tcp  open  imap

443/tcp  open  https

774/tcp  open  rpasswd

777/tcp  open  unknown

792/tcp  open  unknown

993/tcp  open  imaps

1400/tcp open  cadkey-tablet

5432/tcp open  postgres

6000/tcp open  X11

Nmap run completed -- 1 IP address (1 host up) scanned in 1.694 seconds

/etc/X11/xdm # psg xdm

4 S root      7101     1  0  77   0 -  4417 schedu Oct29 ?        00:00:01 /etc/X11/X -auth /etc/X11/xdm/authdir/authfiles/A:0-YxB0wY

```

Update - I installed KDE and it works.  I forgot how much I don't like KDE, so gnome is emerging now and I will try GDM.

----------

## revoohc

Ok, let start by saying thanks for this  tutorial.

However, I am having a problem.  When I  connect to my server via vnc, I get my kdm login screen.  When I put my userid and password into kdm and click login, the vnc session terminates.  Any idea what is going on?  I have looked for some logs, but have not found anything yet.

Any help would be appreciated.

Thanks,

Chris

----------

## revoohc

Ok, I got it to work.  I was trying to have it log me in via my xsession file.  Apperently, this was causing the problem since choosing kde-3.1.4 worked.

Here is my .xsession file on the server:

/usr/bin/xscreensaver &

#/usr/kde/3.1/bin/startkde

/usr/bin/gkrellm2 -s localhost &

/usr/bin/gnome-session

Any reason why this should cause the abend?

Thanks

----------

## geoffwa

@people with the KDE problem

Just append :1 to the front of the Xvnc args line to get Xvnc to start from display 1 rather than display 0.

This happens when Xvnc tries to open display 0 which is 'supposed' to the be the console display and a whole heap of crap in Xsetup_0 gets executed which seems to be dependent on KDE being installed (aiee)

[edit]

Appending :1 just mangled the IP address for some weird reason, instead I just deleted console = display 0 line in Xservers to allow Xvnc to use all the available consoles.

----------

## volrathxp

Just wanted to say thanks, this is a killer article.  I've been passing this info around to some of my buddies and they really enjoy it.

Worked like a charm, very little problems at all and I now have the same remote access from home to my gentoo machine here at work as I did with my windows machine.  :Smile: 

Great job!!!    :Very Happy:   :Very Happy: 

----------

## -Anders

I can't believ how simple this was  :Smile: 

I have been using gentoo for less than a week, and this was so straight forward for me, i got it working without any problems at all.

Thanks for a killer guide

----------

## gen2newB

hey, i just want to say great work on the tutorial. I use my server at home from work now and it works like a charm, except for one thing. I have been having trouble getting games to work. FOr some reason it is telling me the remote machine does not have permission to have it forwarded from the local machine, that is not verbatim, but is a close description of the problem. Anyone have any idea's? I really wanna play dope wars from work ;].

----------

## Boris27

Great tutorial! Had to do some searching for my kdmrc file, but locate quickly found it  :Smile: 

SSH's encryption really helping keeping the bandwith down  :Smile: 

----------

## Mickys21

I have 3 NIC's in my machine.

If I do a nmap -sU (UDP Scan) on all my IP addresses it shows port 177 (XDMCP) open on all 3 IP addresses. 

What I'd like to do is for port 177 to be open on just one of my ip addresses and it closed on the other 2 ip addresses is this possible and how is this acheived?

thanks in advance

----------

## karwoski

OK.  I've read through this thread and it sounds like several people are having (including me) or have had the grey screen problem.  I've seen a few things mentioned in passing but didn't feel like there were solid answers for some of it so if someone could recap, I'd really appreciate it.

1) Should port 177 be open and listening?  Mine's not although I've double checked the config file settings mentioned in the tutorial.  Is this the cause of the grey screen on connect?

2)  When I connect and get the grey X screen my vncviwer window says nobody's desktop.   I've seen tips on creating a ~/.vnc/xstartup file.  Which users's '~' does this need to be in?

Thanks for the help!

----------

## karan

How would I achieve this w/ ssh tunneling?

----------

## tomc4t

*** gray screen ***

I've the same problem as described before: i can connect with a vncviewer but i only see the gray X-theme with the cross pointer.

I was using XDM as Display Manager. I noticed that after a vncview connect the xdm process explode, using 100& CPU time. I solved using KDM instead of XDM and now it is working. After enlightenment is loaded without any problem.

But i don't wont to install Gnome just for KDM next time so i will try with another login manager (waiting for entrance).

----------

## karan

Don't worry about it, I figured it out. Also, I was getting those grey screens when I was using GDM, but all I did was restart GDM and it worked like a charm.

----------

## karwoski

Got mine working too.  XDM wasn't working but I launched kdm (which there wasn't an init script for and I thought there would be) and all seems to be well.

----------

## malloc

Ok i have this working real good and through an ssh tunnel, my problem is this, i know that VNC is a stateless server so i should be able to close the vnc window and still have any X apps i launched from it running in the server, much like using nohup when launching a CLI app. My problem is that even if i just close the window and don't do a logout when e re-connect to the session it will simply give me a new session and my old one whent bye bye. 

I was thinking about using VNC to launch mainly some p2p progs (dc4linux, xmule) and let them download away while i'm at my university. Because of this problem i can't do that  :Sad: 

So can anyone shed a few lights on this so i know what i can do about it?

Thaks in advance

----------

## lines

malloc, 

the way my tutorial works is not like a regular vncserver. It closes the door behind your back.

I think i maybe can fix this with vncreflector, but I don't know that yet.

Stay tuned...

----------

## Mickys21

Got this working a charm!, in gdm & gnome and xdm & enlightenment... but problems in kdm & kde, I get the login screen no probs but as soon as I enter a username and password and click the button to proceed the vnc client just closes down automatically, its the same for both root and other users, (i have done the necessary with port 177) Also I have done 2 builds and exactly the same happens on both. Happily using Gnome but just wondering if anybody had come across this and if so how did they solve it.

Many thanks.

===============================================

Also I had the grey screens for ages wondering what was wrong if you have the USE flag ipv6, be sure to include support for ipv6 in the kernel

----------

## Stumbles

What is the syntax to add the port in this file? Here is what's in there for Xdmcp;

[Xdmcp]

Enable=true

Willing=/usr/share/config/kdm/Xwilling

Xaccess=/usr/share/config/kdm/Xaccess

----------

## Stumbles

 *Stumbles wrote:*   

> What is the syntax to add the port in this file? Here is what's in there for Xdmcp;
> 
> [Xdmcp]
> 
> Enable=true
> ...

 

Never mind, figured that out. Still can't get 177 to open.

----------

## Random Task

Hey everyone

I would like to say that this howto is very easy to follow!

However I have a problem, I am unable to connect to my computer remotely or locally

I downloaded the windoze vncviewer so I could use it at work and every time I get 'Failed to connect to server'

In a telnet session I get unable to open display (that's probably because its telnet)

But this tells me that things should be set up properly

Can anyone help me with this problem?

I have forwarded the required ports on my router 

I have started (and tried) both xdm and kdm

I edited the files as per the instructions

and yet no luck!

Do I have to start the vnc server or something?  I do not see that in the instructions anywhere!?!

UPDATE:

When I try to issue the command

```
vncviewer localhost:71
```

in a terminal locally I receive the following error:

vncviewer: VNC server closed connection

Thanks

----------

## djs

and you just want to connect to your remote Xsession, rather than spawn a new desktop. Don't you like to leave your evo and other apps running so when you sit down locally again, everything's as you left it? I do. 

(Of course this only works in you're already logged in on an X display at the remote machine.)

Here's what I do to get to my linux machines at work or home (over ssh!):

1. emerge libvncserver; emerge tightvnc

2. create this shell script:

#!/bin/bash

# usage: x11vnc_ssh <user>@<host>:<xdisplay>

host=`echo $1 | awk -F: '{print $1}'`

disp=`echo $1 | awk -F: '{print $2}'`

ruser=`echo $1 | awk -F@ '{print $1}'`

case "$ruser" in "") u="$USER" ;; *) u="$ruser" ;; esac

cmd="x11vnc -display :$disp -q -nevershared -dontdisconnect -rfbauth .vnc/passwd rbwait 5000"

enc="copyrect tight hextile zlib corre rre raw"

ssh -l $u -f -L 5900:localhost:5900 $host "$cmd"

sleep 2

vncviewer -encodings "$enc" :0; then break; fi

ssh -l $u $host "pkill x11vnc"

#end of script

The second ssh command kills the x11vnc server. According to the man page, the server is by default supposed to die when you disconnect. whatever...

3. add an alias to your .bashrc like:

alias rfb='~/x11vnc_ssh.sh'

then you can do:

rfb user@host:0

/djsLast edited by djs on Fri Dec 12, 2003 6:16 pm; edited 1 time in total

----------

## dose

nice tutorial but I can't seem to be getting it to work...

I did everything as was said...

BUT...

when I tried to connect from my windoze box I don't get anything...then after a few tries I get "could not connect to server"...

now, when I try this in tightvnc-viewer -> "server: yuna::71" it seems my gentoo box is starting a new instance of xdm

```
 2093 ?        00:00:11 xdm

 2095 ?        00:00:03 X

 2096 ?        00:00:00 xdm
```

and in nmap I get ->

```
yuna root # nmap localhost

Starting nmap 3.48 ( http://www.insecure.org/nmap/ ) at 2003-12-12 20:10 CET

Interesting ports on localhost (127.0.0.1):

(The 1651 ports scanned but not shown below are in state: closed)

PORT     STATE SERVICE

22/tcp   open  ssh

139/tcp  open  netbios-ssn

445/tcp  open  microsoft-ds

901/tcp  open  samba-swat

1024/tcp open  kdm

6000/tcp open  X11

Nmap run completed -- 1 IP address (1 host up) scanned in 2.171 seconds
```

ironicaly, I'm not running kdm but xdm...

don't know if I make any sense but I would appreciate some hints  :Smile: 

thx in advance  :Smile: 

----------

## kobejones68

*****Grey Issue Connect******

With me to fix it was just to start "gdm" and make sure its using it.

 *Quote:*   

> Ok i have this working real good and through an ssh tunnel, my problem is this, i know that VNC is a stateless server so i should be able to close the vnc window and still have any X apps i launched from it running in the server, much like using nohup when launching a CLI app. My problem is that even if i just close the window and don't do a logout when e re-connect to the session it will simply give me a new session and my old one whent bye bye. 
> 
> I was thinking about using VNC to launch mainly some p2p progs (dc4linux, xmule) and let them download away while i'm at my university. Because of this problem i can't do that  
> 
> So can anyone shed a few lights on this so i know what i can do about it?

 

Got a excellent solution!

Works like a dream!

Netop Remote Control 7.5! Supports linux.

Easy install connects perfect!

Hope this helps everybody!  :Very Happy: 

----------

## schmoli

thanks for the howto, will try this when I get home.

----------

## tecknojunky

Any hints on enabling the java viewer in this fashion?

So far, I've added "vnc-http 5800/tcp" in /etc/services and  ...

 *Quote:*   

> 
> 
> service vnc-http                                                                
> 
> {                                                                               
> ...

 

... in /etc/xinetd.d/vncserver

When I connect with Moz, all I get is "RFB 003.003" in the page and nothing else happens.

I don't know if it's a vnc issue or a Moz issue.

----------

## tecknojunky

A couple of good article about vnc on *nix: http://faq.gotomyvnc.com/fom-serve/cache/65.html

----------

## Rosjahh

Another good article on connecting to you vncserver (even when it's behind a router) from windows with ssh tunneling:

[url]http:[/url]

EDIT:  Removed URL, since its a link to porn ads.  Not sure if it always has been.  --pjp.

----------

## fedekapo

How can I change the port..? I want to use port 80 instead of 71 because I want to avoid the firewalls...

Sorry for my english..

Bye

----------

## fedekapo

Another question...

I'm using a firewall in my vnc server. I'm using iptables with some help of kmyfirewall... Does anyone know what port should I open and how to use vnc?.. For example port 5980...

Bye

----------

## Rosjahh

 *fedekapo wrote:*   

> Another question...
> 
> I'm using a firewall in my vnc server. I'm using iptables with some help of kmyfirewall... Does anyone know what port should I open and how to use vnc?.. For example port 5980...
> 
> Bye

 

Well if you just open port 5980 for incoming (protocol tcp) traffic you should be fine. Then you shouldn't have to do anything else than to follow the howto AFAIK. If you want to use port 80 instead, you could confifure your firewall to forward that one with DNAT, or you could change the port of your prefered entry in /etc/services to 80.

It's another case if your vnc server is behind a router and if you want to tunnel through ssh. But as you pose you question, that is not the case.

For tunneling in ssh from windows and through a router, the link I just gave earlier is really useful.

----------

## vdboor

Great totorial!

It worked out-of-the-box.  :Smile:  I have gdm running, and tightvnc picks up the xdmcp server.

But I want to add a password to my vnc session. Seriously. I don't want people to open my gdm login if they connect.  :Sad:   ..is this possible?

edit, there is one other thing that worries me (from the Xvnc manual):

 *Quote:*   

> 
> 
> BUGS
> 
>        There are many security problems in current Xvnc implementation.  It's  recommended
> ...

 

----------

## tecknojunky

 *vdboor wrote:*   

> But I want to add a password to my vnc session. Seriously. I don't want people to open my gdm login if they connect.   ..is this possible?
> 
>  *Quote:*   
> 
> BUGS
> ...

 You could do just that, limit access from the localhost.  In this fashion, only users who can login from the outside with ssh could forward the port to localhost:59xx to use vnc.

I've been using vnc for years to access both Windows and X desktops from the outside and I always done it thrue a ssh tunnel.  Works like a charm.

----------

## ElectricHead1

OK .... I've got the following problem. I can run a vncserver without any problems from my Gentoo box and open it with both tightvncviewer and realvnc.

Now the following happens:

I have disabled XDM at startup. 

What happens that as soon as I start XDM, and try to connect to 192.168.1.4:71, I get the following error message from the viewer "ReadExact: Socket error while reading error."   :Question: 

When I first tried it, I got that nice and familiar Grey screen with the X mouse cursor that more of you guys have experienced. And now it changed to this state .... All settings are the same as in the tutorial that was presented here.

Anybody have any ideas??? Thanks in advance

----------

## ElectricHead1

 *geoffwa wrote:*   

> @people with the KDE problem
> 
> Just append :1 to the front of the Xvnc args line to get Xvnc to start from display 1 rather than display 0.
> 
> This happens when Xvnc tries to open display 0 which is 'supposed' to the be the console display and a whole heap of crap in Xsetup_0 gets executed which seems to be dependent on KDE being installed (aiee)
> ...

 

And where can I find thos Xvnc args??

----------

## vdboor

update: this was fixed, when I enabled 'AllowTcpForwarding' in sshd_config..  :Smile: 

 *tecknojunky wrote:*   

> You could do just that, limit access from the localhost.  In this fashion, only users who can login from the outside with ssh could forward the port to localhost:59xx to use vnc.
> 
> I've been using vnc for years to access both Windows and X desktops from the outside and I always done it thrue a ssh tunnel.  Works like a charm.

 

I've very curious how this works..  :Confused: 

I'm currently at a Windows 2000 machine, and I'm using PuTTY for ssh access. I've added the tunnel, and the Windows 2000 machine is indeed listening at 127.0.0.1:59xx. The vncviewer application doesn't work however. With tcpdump I noticed that my Linux machine doesn't receive any packets at the vnc port.

...but the strangest thing of this story: If I run telnet at the Windows 2000 machine, the connection closes immediately, and enters the WAIT_CLOSE state.   :Shocked: 

please help  :Sad: 

----------

## =sasha=

I found another, much simplier and faster way to use vnc protocol.

Solution is based on latest realvnc (still beta, but it works).

After you compile realvnc 4.x source, you should:

0. stop xdm, kdm, gdm, whatever

1. Place vnc.so to /usr/X11R6/lib/modules/extensions/

2. Edit XF86Config and add 

    Load "vnc"

    to module section

3. start x again

After that you should be able to connect with any vnc viewer. I use it on LAN and its blazing fast (because vncserver is working by not grabbings screens).

I think betavnc is not in portage yet. Go to www.realvnc.com for source.

----------

## tecknojunky

 *vdboor wrote:*   

>  *tecknojunky wrote:*   You could do just that, limit access from the localhost.  In this fashion, only users who can login from the outside with ssh could forward the port to localhost:59xx to use vnc.
> 
> I've been using vnc for years to access both Windows and X desktops from the outside and I always done it thrue a ssh tunnel.  Works like a charm. 
> 
> I've very curious how this works.. 
> ...

 http://freesco.no-ip.org/VNC/, with screenshots and all.

----------

## tecknojunky

 *=sasha= wrote:*   

> I found another, much simplier and faster way to use vnc protocol.
> 
> Solution is based on latest realvnc (still beta, but it works).
> 
> After you compile realvnc 4.x source, you should:
> ...

 Interresting in deed.  Can you still control access (from localhost or locallan) and does the java viewer also works in this fashion?

----------

## ttw22

I had the grey screen problem too, the solution for me was to just run "gdm" again, even though I thought it was running.

----------

## vdboor

 *tecknojunky wrote:*   

>  *vdboor wrote:*   
> 
> I've very curious how this works.. 
> 
> I'm currently at a Windows 2000 machine, and I'm using PuTTY for ssh access. I've added the tunnel, and the Windows 2000 machine is indeed listening at 127.0.0.1:59xx. The vncviewer application doesn't work however. With tcpdump I noticed that my Linux machine doesn't receive any packets at the vnc port.
> ...

 

I've found a way to fix it. I had to enable AllowTCPForwarding in my sshd_config file.   :Mad:   :Exclamation: 

----------

## Braindead_One

To those with the infamous grey screen problem: try checking your firewall settings. I my case kdm didn't work because the ip of eth0 was not allowed to connect to the xdmcp-port (the ip i was connecting to (eth0:1) was).

Also check if localhost is allowed to connect.

Hope this helps

Braindead_One

----------

## clocKwize

this howto is great  :Smile:  worked like a charm, i was just wondering, for added security, can i put a password on vnc some how as well?

----------

## rrrkkkttt

I followed all of the steps and I get the grey screen... I replaced the last line in xstartup with /etc/X11/Sessions/Gnome... I still get the grey screen when I start vncviewer... I can ssh into my comp remotely but for some reason cannot forward X11 connection... However, locally when i type http://localhost:5801/      I get an applet and when I enter my password tightvnc works and I see my gnome session...  I've forwarded ports 177 UDP for gdm and 5980 to 5984 tcp for tightvnc appropriately...  yeah i rebooted lots of times to see if it'd work... but no go.... i'd appreciate it if someone can please help me get tightvnc to work...

----------

## rrrkkkttt

nm i got it working now... gdm doesn't work at all... i put /etc/X11/Sessions/fluxbox and I get a fluxbox session... the prob was that when i ran vncserver the output told me that the Xdisplay was running on myhost:1... so instead of vncviewer localhost:71, I did vncviewer myhost:1 and it works! ...

----------

## vdboor

 *clocKwize wrote:*   

> this howto is great  worked like a charm, i was just wondering, for added security, can i put a password on vnc some how as well?

 

I found an rfbauth option in the Xvnc server parameters. It's a bit hidden, and not very well explaind in the manuals, but I think this is what you're looking for  :Smile: 

the parameter-value should point to your .vnc/passwd file. Just don't use your system password in that file. The passwords seam to be hashed with a very simple algorithm. (the file contains jus a few bytes..  :Confused: )

----------

## clocKwize

ah, thanks very much  :Very Happy: 

----------

## rrrkkkttt

i just noticed another problem...  whenever i get a gnome or fluxbox session all of the apps are all gtk... i tried running gnome-settings-daemon in the tightvnc session but it says its already running... how do I get my apps to use gtk2 and also use the fonts?

----------

## vdboor

 *rrrkkkttt wrote:*   

> i just noticed another problem...  whenever i get a gnome or fluxbox session all of the apps are all gtk... i tried running gnome-settings-daemon in the tightvnc session but it says its already running... how do I get my apps to use gtk2 and also use the fonts?

 

well, off course all your gtk applications are gtk, but I think I understand what you're trying to say; the theme isn't the one you'd expected.

You can copy the .gtk-... files to the home directory of the vnc user. the gtkrc files are read by everty gtk-based application before it starts.

----------

## rrrkkkttt

I never tried to log in as a different user in vnc... I typed vncviewer logged in as a user... i tried vncserver as  root but it gives me an error saying it couldn't find xauth on my PATH... how do I log in as a different user in vnc?

if i'm already logged on as a user in gentoo and i start vncviewer as that user... then i already have all the gtk files in my home directory... so then shouldn't the gtk2 apps read those .gtkrc files?

----------

## vdboor

 *rrrkkkttt wrote:*   

> I tried vncserver as  root but it gives me an error saying it couldn't find xauth on my PATH... how do I log in as a different user in vnc?

 

You should run the Xvnc through inetd/xinetd, like this toturial suggests.

If you run the vncserver, it will run as your current user. Type "ps auxf" to see all processes running.. and you'll see that vnc is running as the user logged in.

If you "su" to another user, you might want to run "source /etc/profile" first. This also upgrades your $PATH. An alternative, is using "su -" to start a login process.

----------

## rrrkkkttt

oh i get it... the xvncserver file in /etc/xinetd.d .... when i do /etc/init.d/xinetd start   the vnc server also starts up then i just restart gdm by logging out and logging back in... then i do localhost:71...

ok i tried that... but its not working... now I don't even get the grey screen... i get a connection refused error and unable to connect to server... i think that xinetd is not starting up all the vncservers... unless i start up the vncserver as the user that i'm logged on as... i cannot use vncviewer...

----------

## vdboor

 *rrrkkkttt wrote:*   

> oh i get it... the xvncserver file in /etc/xinetd.d .... when i do /etc/init.d/xinetd start   the vnc server also starts up then i just restart gdm by logging out and logging back in... then i do localhost:71...
> 
> ok i tried that... but its not working... now I don't even get the grey screen... i get a connection refused error and unable to connect to server... i think that xinetd is not starting up all the vncservers... unless i start up the vncserver as the user that i'm logged on as... i cannot use vncviewer...

 

I never thought I would say something like RTFM, because I don't like this word., but... please... read the tutorial again!   :Shocked: 

Basically you're asking how to run Xvnc through xinetd, and this is exactly what the topic starter just explained...   :Rolling Eyes:  lol

----------

## clocKwize

even if you dont understand it properly, just run the commands it says to and it *should* work

----------

## rrrkkkttt

yeah i did read the tutorial... and I did follow all the steps he posted but its still not working... it only works if I start vncserver as a user...

here's /etc/xinetd.conf:

 *Quote:*   

> 
> 
> # Sample configuration file for xinetd
> 
> defaults
> ...

 

here's  /etc/X11/xdm/xdm-config:

 *Quote:*   

> 
> 
> ! $Xorg: xdm-conf.cpp,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
> 
> !
> ...

 

here's gdm config:

 *Quote:*   

> 
> 
> # GDM Configuration file.  You can use gdmsetup program to graphically
> 
> # edit this, or you can optionally just edit this file by hand.  Note that
> ...

 

here's my Xaccess:

 *Quote:*   

> 
> 
> # $Xorg: Xaccess,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
> 
> # Updated for IPv6
> ...

 

heres my /etc/services:

 *Quote:*   

> 
> 
> # /etc/services:
> 
> # $Id: services,v 1.5 2003/08/04 19:13:15 azarah Exp $
> ...

 

and here's my /etc/xinetd.d/xvncserver:

 *Quote:*   

> 
> 
> service vnc-640x480x8
> 
> {
> ...

 

here's my .vnc/xstartup:

 *Quote:*   

> 
> 
> #!/bin/sh
> 
> xrdb $HOME/.Xresources
> ...

 

i do have xinetd startup at bootup and i dont get any error mesgs....  I just don't know wut else to do...

----------

## rrrkkkttt

i decided to start from scratch so I unmerged tightvnc and xinetd and followed the tutorial again...   the server starts up now... vncviewer is connecting to the server but i still get the gray screen... and my .vnc folder is deleted now... when i start vncviewer it doesn't create the .vnc folder automatically...  the tutorial doesn't say anything about that... so do I have to run any program to create it or do I create it myself and also create the xstartup file ?

----------

## vdboor

 *rrrkkkttt wrote:*   

> vncviewer is connecting to the server but i still get the gray screen... and my .vnc folder is deleted now...

 

The .vnc folder isn't used in the xinetd setup. you run "Xvnc -inetd", and this changes the rules  :Wink: 

Do you have XDMCP running? If the Xvnc server can't find a xdmcp server, your X server stays empty, that's why you have the gray green. Enable xdmcp in the display-manager you use (xdm/gdm/kdm), and make sure the server is running. Type "netstat -anpA inet", or "netstat -lnpA inet" to see all network connections. (or listening in the second example)

----------

## rrrkkkttt

i'm using gdm... I enabled xdmcp in gdmconfig... here's the listing of netstat -anpA inet:

 *Quote:*   

> 
> 
> netstat -anpA inet
> 
> Active Internet connections (servers and established)
> ...

 

gdm is listening on port 177...  thats supposed to be the xdmcp port...  since there is no separate xdmcp program name... i guess maybe it isn't running for some reason?

----------

## rrrkkkttt

so how do I start the xdmcp server?

----------

## vdboor

 *rrrkkkttt wrote:*   

> so how do I start the xdmcp server?

 

It is running: 

```
udp 0 0 0.0.0.0:177 0.0.0.0:* 5364/gdm
```

----------

## WhimpyPeon

The instructions for this were great!  The only problem I had was that the kdmrc file was located at /usr/kde/3.2/share/config/kdm/kdmrc instead of the location listed. However locate still works on my box and this was no big issue.  :Wink: 

I already use kdm as my default so that made things easy.  Works on the local network, just have to go to work and make sure I can ssh through my firewall.

----------

## rrrkkkttt

ppl who're using gdm... how did you make it work?   no matter what I do i still get the grey screen....

----------

## jUmB0

I am getting the most bizarro error 

vnc works when I start a vncserver at :1 or :2 to a degree (more on this later)  but a connection to displays other than the one specified by the server (ie: 72) hits a brick wall at a grey screen, as far as I can tell this is because the desktop is for the user nobody who has no .vnc dir or xstartup file because the user doesn't exist. 

I can start a vnc server as a user and by replacing the twm & line with /etc/X11/gdm/Sessions/Gnome & I can see my desktop. 

So far this is pretty normal, The crazy part starts when I replace "/etc/X11/gdm/Sessions/Gnome &" with "gdm &" or "xdm &"

I don't just end up with a grey screen, I get the grey twm background with a very ugly colored terminal in the upper left corner and thats it, I can logout from the terminal and im stuck at the twm desktop

This is NOT a good situation, I need to be able to see a login manager so users on the network can access their desktop, not mine. also I can't expect my users to ssh into the box, start a vncserver on their own and connect a vncviewer to it, these are dreadcore windows users with no hope. 

if anyone knows a way to resolve any or all of my issues please respond

for the sake of completeness here is the vnc server log

13/02/04 04:19:55 Xvnc version 3.3.tight1.2.8

13/02/04 04:19:55 Copyright (C) 1999 AT&T Laboratories Cambridge.

13/02/04 04:19:55 Copyright (C) 2000-2002 Constantin Kaplinsky.

13/02/04 04:19:55 All Rights Reserved.

13/02/04 04:19:55 See http://www.uk.research.att.com/vnc for information on VNC

13/02/04 04:19:55 See http://www.tightvnc.com for TightVNC-specific information

13/02/04 04:19:55 Desktop name 'X' (sloppy-seconds:2)

13/02/04 04:19:55 Protocol version supported 3.3

13/02/04 04:19:55 Listening for VNC connections on TCP port 5902

13/02/04 04:19:55 Listening for HTTP connections on TCP port 5802

13/02/04 04:19:55   URL http://sloppy-seconds:5802

xrdb: No such file or directory

xrdb: can't open file '/home/jumb0/.Xresources'

Only root wants to run gdm

a vncserver from root does the exact same thing except it tells me gdm is already running

btw before I resolved https://forums.gentoo.org/viewtopic.php?t=136081&highlight= gdm was working beautifully but only when logging in root, now its totally borked

----------

## Donovan

Just set this up yesterday, this is the coolest thing!!   :Very Happy: 

Thanks!

----------

## rrrkkkttt

I'm also having similar problems as jUmB0.... if someone would please show us how they got gdm up and running i'd really appreciate it... thx.....

----------

## Jamiro

@rrrkkkttt: you should be okay. try to connect using " vncviewer localhost::5962". Let me know if it works

----------

## Jamiro

now I've the grey screen problem  :Sad: 

----------

## rrrkkkttt

I get a grey screen...

here's the output:

```

vncviewer localhost::5962

VNC server supports protocol version 3.3 (viewer 3.3)

No authentication needed

Desktop name "nobody's x11 desktop (gentoobox:1)"

Connected to VNC server, using protocol version 3.3

VNC server default format:

  16 bits per pixel.

  Least significant byte first in each pixel.

  True colour: max red 31 green 63 blue 31, shift red 11 green 5 blue 0

Using default colormap which is TrueColor.  Pixel format:

  32 bits per pixel.

  Least significant byte first in each pixel.

  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0

Using shared memory PutImage

Same machine: preferring raw encoding

CleanupXIOErrorHandler called

ShmCleanup called

X connection to :0.0 broken (explicit kill or server shutdown).

```

here's my xstartup:

```
#!/bin/sh

 

xrdb $HOME/.Xresources

xsetroot -solid grey

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

fluxbox &

```

here's the log:

```

13/02/04 23:47:44 Xvnc version 3.3.tight1.2.8

13/02/04 23:47:44 Copyright (C) 1999 AT&T Laboratories Cambridge.

13/02/04 23:47:44 Copyright (C) 2000-2002 Constantin Kaplinsky.

13/02/04 23:47:44 All Rights Reserved.

13/02/04 23:47:44 See http://www.uk.research.att.com/vnc for information on VNC

13/02/04 23:47:44 See http://www.tightvnc.com for TightVNC-specific information

13/02/04 23:47:44 Desktop name 'X' (gentoobox:1)

13/02/04 23:47:44 Protocol version supported 3.3

13/02/04 23:47:44 Listening for VNC connections on TCP port 5901

13/02/04 23:47:44 Listening for HTTP connections on TCP port 5801

13/02/04 23:47:44   URL http://gentoobox:5801

xrdb: No such file or directory

xrdb: can't open file '/home/rakesh/.Xresources'

Failed to load groupfile:

apps file failure

BScreen::BScreen: managing screen 0 using visual 0x22, depth 24

Xlib:  extension "RENDER" missing on display ":1.0".

Xlib:  extension "RANDR" missing on display ":1.0".

xterm:  fatal IO error 32 (Broken pipe) or KillClient on X server ":1.0"

```

----------

## jUmB0

after trolling thru my logs for the culprit i noticed some version mismatch messages in gdm's log

I emergered gdm and an emerge -u world 

after compiling xfree I vncviewer'ed :70 and lo and behold gdm was greeting me

im not sure if this will help anyone, but it might

----------

## asilva

lines, 

can you please just post the contents of your /etc/X11/xdm/Xsetup_0 file.

here is mine: 

```

#!/bin/sh

# $Xorg: Xsetup_0,v 1.3 2000/08/17 19:54:17 cpqbld Exp $

#xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail

# get KDEDIR value (only) and run kdmdesktop from there

eval "`grep KDEDIR /etc/profile.env`"

[ -x $KDEDIR/bin/kdmdesktop  ]  && ${KDEDIR}/bin/kdmdesktop

# --- Gentoo ---

# create list of sessions for kdm

sessions="SessionTypes="

for x in `ls /etc/X11/Sessions`

do

    sessions="${sessions}${x},"

done

echo sessions: $sessions

# update all kdmrcs located; tries some pretty much impossible locations

# to make sure we get 'em all

source /etc/make.conf

for dir in /usr/kde/* /usr $KDEDIR $KDE2DIR $KDE3DIR $KDE2LIBSDIR $KDE3LIBSDIR

do

    echo "Changing kdmrc in $dir"

    cd ${dir}/share/config/kdm || continue

    cp kdmrc kdmrc.orig

    sed -e "/SessionTypes=/c\

${sessions}" kdmrc.orig > kdmrc

    rm kdmrc.orig

done

```

it's just because my /var/log/xdm.log throws up with this:

```

XFree86 Version 4.3.0.1

Release Date: 15 August 2003

X Protocol Version 11, Revision 0, Release 6.6

Build Operating System: Linux 2.4.22-gentoo-r4 i686 [ELF]

Build Date: 11 February 2004

        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: Tue Feb 17 17:34:53 2004

(==) Using config file: "/etc/X11/XF86Config"

Using vt 7

sessions: SessionTypes=Xsession,afterstep,enlightenment,wmaker,

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

```

thanks man! great tutorial.   :Very Happy: 

----------

## bigcat99

Where and which config file do i change to allow remote root login?  i know someone did it, but did'nt say how.

----------

## rrrkkkttt

I think i kinda figured out why im still getting the grey screen... 

/var/log/xdm.log shows that:

```

xdm error (pid 5375): Trouble getting network interface configurationxdm error (pid 5375): Trouble getting network interface configurationxdm info (pid 5356): Rereading access file /etc/X11/xdm/Xaccess

xdm error (pid 5356): XDMCP socket creation failed, errno 97

sessions: SessionTypes=Gnome,Xsession,fluxbox,

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

```

why can't xdm access my network?

----------

## jUmB0

do you have ipv6 in your use variables ?

----------

## jUmB0

bigcat99 if you follow the tutorial and enable xdm gdm or kdm you just login as root, no files need to be changed.

it might be wiser to ssh into the box for root tasks tho

not to take away anyones thunder but how does one change the gdm theme for the nobody user ?

----------

## Rebelscum

Once I'd realised tightvnc didn't emerge properly its all fine and i see my kde desktop as clear as a bell from my w2k lappy. The clue was that I couldn't find Xvnc  :Razz: 

----------

## tecknojunky

 *tecknojunky wrote:*   

> Any hints on enabling the java viewer in this fashion?
> 
> So far, I've added "vnc-http 5800/tcp" in /etc/services and  ...
> 
>  *Quote:*   
> ...

 Bump!  :Sad: 

----------

## Quietus

I was getting the grey screen problem and I eventually cracked mine - it was a problem in 

```
/etc/xinetd.d/xvncserver
```

 I had copied & pasted it from this forum, and reading through it, it hadn't pasted correctly.  I urge anyone experiencing the grey screen problem to try removing 

```
/etc/xinetd.d/xvncserver
```

 and rewriting it manually (just write out one to test) also check your 

```
/etc/services
```

 to make sure that is correct (if you copied and pasted that too)

----------

## marqs

In the file /usr/kde/3.2/share/config/kdm/kdmrc where you where suposed to enable port 177 I fond out that the line above it

# Whether KDM should listen to XDMCP requests. Default is true.

Enable=false 

shoud be set to "true"...this is what mine loocked like no matter what the text say about true as default.

after that change and a reboot it works for me

----------

## marqs

I can start all X-aplication on KDE:s menu but if I try to start any x-apps from xterm i get:

```

bash-2.05b# opera &

[1] 1833

bash-2.05b# Xlib: connection to "hd5e25269.gavlegardarna.gavle.to:2.0" refused by server

Xlib: Client is not authorized to connect to Server

opera: cannot connect to X server hd5e25269.gavlegardarna.gavle.to:2.0

[1]+  Exit 1                  opera

bash-2.05b#
```

any one got any tips...not much use if you can't run anything

----------

## Martz

I have made progress after fixing the problem where xdm had errors stopping (ran /etc/init.d/xdm zap | /etc/init.d/xdm start and it worked ok)

Now I get these messages in /var/log/xdm.log

xdm error (pid 2360): server unexpectedly died

xdm error (pid 2360): Server for display :0 can't be started, session disabled

xdm info (pid 2360): Couldn't connect to PRNGD socket "/tmp/entropy": No such file or directory

xdm info (pid 2360): Couldn't connect to PRNGD socket "/tmp/entropy": No such file or directory

xdm info (pid 2360): Couldn't connect to PRNGD socket "/tmp/entropy": No such file or directory

I remember seeing something about this somewhere else, a search on these forums only reveals 1 thread about PRNGD. 

I did not have the above file or directory, tried touching it but that didn't help. 

Does anyone have any ideas please?  :Smile:  Thanks.

----------

## silentbob

I followed this excellent guide step by step and it all worked perfectly... I can now ssh to my home pc from the local LAN and at work  (even across a 56k modem connection it is almost usable!) using putty and tunnel X through it to run vncviewer on a Windows machine and connect. Fantastic!

I found the following guide for putty ssh / vnc on the 'net for connecting on the windows machine... HOW-TO: VNC secure tunneling using Windows PuttY ssh client - http://freesco.no-ip.org/VNC/

I would like to know whether it is possible to connect to an existing X session (is that the right term?), for example I am logged in at home and then go off to work, I would like to connect from work as the same user and connect to the already running session (and leave this running when I terminate the remote connection). But, if I wanted to log on as another user, if they didn't already have an X session running it would create a new one following the existing functionality. Is this at all possible, and how...?

Thanks!

----------

## grudge

I solved my own grey screen by doing the following. I two files in my 

```
/etc/X11/Sessions/
```

They were 

```
Xsession
```

 and 

```
fluxbox
```

I removed the Xsession one (after backing it up first), and now it works perfectly. I get a login screen and when I logged in, it has started fluxbox. Hope this helps someone else !

----------

## elec999

Im having trouble with these two, can someone help me plz

5) Configure kdm

if you use kdm, edit /etc/kde/kdm/kdmrc and enable XDMCP on port 177

Theres no /etc/kde/...

6) Configure gdm

if you use gdm, start gdmconfig and go the tab "XDCMP"

Make sure 'Enable XDMCP' is checked 

The command start gdmconfig doesnt work

I am using xdm. Is there any other changes to make in it except the ! infront of the display.

----------

## elec999

for me the vnc works, but only the backround and X sign is there, nothing else, what can be wrong. I have tried doing what was said, remove the Xsession, but still nothing. Heres a pic

[url]members.rogers.com/alex1002/terminals/vncts.JPG[/url]

----------

## buckoven

one of best howtos ever! working straight out of the box, took me 15 minutes to apply the xvnc-terminalserver.

thx!

----------

## martincab

Thank you guys!, you save me a lot of time. I'll use this to  replace our current w2k ts server. It seems it will be a very good choice (and cheaper )  :Very Happy:   )

----------

## silentbob

 *silentbob wrote:*   

> I would like to know whether it is possible to connect to an existing X session

 

To answer my own question, after some further investigation, to connect to the X session shown on the monitor us gemsvnc:

```
emerge gemsvnc
```

Then run it...

```
gemsvnc -display :0
```

..and connect to this using a vncviewer (port 5900 default)

----------

## tnkrtrn

Great tutorial guys.  I got this working with no problem.  Heck I did a google and looked for an alternative for windows terminal server and it brought me here.  I didn't even know that gentoo existed before this.  Two quick questions.  First one is probably simple.  I've noticed you guys talk about sshing into your gentoo box.  I saw the tutorial to putty's ssh and read up on it.  Sounds pretty straight forward except for one part.  How do I setup ssh (and configure) on gentoo.  Second question if I log in as Bob and then terminate my vnc session (by choice or accident) I see all the programs that were running are not.  Anyway around that.

----------

## passenger 57

i tried it and it work fine    :Very Happy:   :Very Happy:   :Very Happy: 

a german user

----------

## nuance9

I was able to set this up fine.  I did get the blank screen and X cursor until I rebooted.  That solved it.

Just one question, how do I enable GLX for the remote X sessions?

Thanks!

----------

## linbox

in number 5) Configure kdm

if you use kdm, edit /etc/kde/kdm/kdmrc and enable XDMCP on port 177

I use KDE 3.2 and after several trials to logon and always getting the gray screen I finally found my problem when I went to the tutorial I could not find the file kdmrc in /etc/kde/kdm so I created it, which did NOT solve the issue. After looking around some more I found the file in

/usr/kde/3.2/share/config/kdm

So maybe I can help somebody else being successful here. Now it works great I get the login screen just perfect!

Guenter

----------

## haruki_zaemon

I'm running openbox and tightvnc but some keystrokes (like alt+tab) aren't working inside the session, instead being captured by the host session instead. Any way to get around this? Or is it really a problem for the window manager?

----------

## andyjeffries

Hey lines!

Just wanted to drop a quick not to say thanks for doing this howto.

Works a charm!!!

Andy

----------

## zioponics

**** Grey Screen News ***************

Hello guys, 

I was another victim of those "grey screen and nothing more".

To solve it I had to give a normal shell to the user nobody.

/bin/false ---> /bin/bash. 

The first time it worked, I was also reading the XDMCP-HOWTO  , and since they talk about strange problems between XDMCP and PPPoE, I had shutted down the rp-pppoe service. 

Now it's working with or without PPPoE. 

But the shell MUST be set to /bin/bash. (mind the LDAP thing)

If you have a defunct "su" owned by nobody (ps -aux), you have to reboot in order for shell change to work. (try to kill it, if you can!!  :Wink:   )

I hope this will help some **Grey Screen** victims...

Bye

----------

## c4

first of all, honors to lines for an excellent guide. I really enjoy my two new terminal boxes  :Wink:   thanks for the efforts!

I encountered some problems while getting them both up and running.  The first box had a new fresh stage1 build just two days ago, and it worked out smoothly.. however the second box, with a couple months old install wouldn't work. No matter what I did, i kept on getting that dreadful grey screen.

I am using x11-base/xfree-4.3.0-r5 on both boxes, as the box from which I am connecting to the servers. Furthermore, all of my computers use xdm & openbox 3.

Now after checking all settings on the failing box, I dicided to just reinstall xfree, and now they all work great. Interesting enough there were a few minor patches added initially with the emerge of the x-server. It obviously did the trick, as I now can log in to both servers, and all configs are the same as before I re-emerged. So if all seems to fail, it might be worth the waiting and reinstall xfree.

----------

## bc999

Hello

Got some troubles to connect through a firewall. Opened port 71 and forwarded to the XVNCServer. Can't Connect. If i connect from the LAN it works.

How exactly can i connect with ssh ? 

I tried this,it works but is awesome slow:

ssh -X Hostname 

vncviewer localhost

Any Ideas ?

----------

## outspoken

ok, ive had this running for a little bit now and its great. especially the bit that lets you select screen resolution simply by chaning what port you login to, thats brilliant.

my question is, can i resume a session like in ssh when i use screen? i'm wondering if there is either a way to make a session based on the pid, or possibly a program that acts like screen for xorg/xfree/xdm/etc?

thanks!

----------

## luser2

This tip was great..  to get gnome to work I had to put this in ~/.vnc/xstartup

#!/bin/sh                                                                               

xrdb $HOME/.Xresources

xsetroot -solid grey

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

unset SESSION_MANAGER

gnome-session &

I found those last 2 lines posted in another thread.

Now I have my gnome desktop!  The only problem is that this also turns my gnome desktop icons (computer, home, trash) and the icons in nautilus into the generic sheet icon.  If I kill the vncserver the icons pop back.

Anyone know how to fix this?

----------

## Jeremy_Z

Great tip !   :Very Happy: 

And those who are using .vnc/xstartup have done something wrong, xstartup is the srcipt that is read when you are launching vncserver.

Here we want to use gdm/kdm/xdm with XDMCP, are you sure you configured xdm correctly ?

And you must have it running on the "server".

----------

## tactless

VNC is a really beautiful solution... I use it in two ways:

1. Connect to my WinXP box (in the other room, to go to my IE-only school website)

2. Connect home from girlfriend's. I do it this by first connecting with putty to openssh, tunelling a VNC port through it, and running vncserver via ssh. Then I open a VNC viewer and connect through the tunnel. Only port 22 is open outbound  :Smile: 

----------

## tecknojunky

I've setup a new machine, but it's headless.

I did everything in this howto, but I end up with only the X grey screen.

Obviously, the problem is because gdm is not started.  So I was searching where I could start gdm in the web of scripts that get called.

I was wondering if this chain would work:

- Replace Xvnc with gdm in the call made by xinetd;

- Replace X with Xvnc in the gdm.conf.

Somehow, I think it would not work... I did not try.  I wish to have your input first before doing stupid things.

----------

## Jeremy_Z

Gdm is started by typing "gdm" as root on command line.

Then by configuring xdm and adding xdm with rc-update.

Also are you sure you edited correctly every conf file ?

----------

## tecknojunky

 *Jeremy_Z wrote:*   

> Gdm is started by typing "gdm" as root on command line.
> 
> Then by configuring xdm and adding xdm with rc-update.
> 
> Also are you sure you edited correctly every conf file ?

 If I start gdm manually, it works, but it also start gdm on terminal and a X instance that will never be used.  I'm trying to avoid loosing these ressources since they'll never be used.

So, how to make this work without starting gdm for nothing?  Or, in other words, how to make gdm be started only when a connection is made remotely?

----------

## Jeremy_Z

Well the whole point of this topic was to have gdm accepting remote connection via vnc. So you need to have gdm runing, that is for sure.

Now there might be a way to have gdm (or xdm) running without a X server, but this is a different issue and i cannot help you with that (if it is what you whant).

But a X instance is needed anyway on the server, even if you use vncserver it starts X.

----------

## tecknojunky

It is my understanding that inetd act as some sort of intermediary for all deamons.  I don't know on which port gdm listen on, but whetever that is, conceptualy, I tought that inetd could get gdm started if a connection request on that port occurs.

So, if inted start gdm, then the next step would be insuring that gdm uses Xvnc instead of X.  Am I making sense?  Because I'm not sure I am  :Sad: 

----------

## Jeremy_Z

Well, from /etc/services i got xdmcp working with port 177.

Currently xinetd is configured to start Xvnc but i dont know how it connects to gdm (xdmcp) then.

You might want to try to add gdm in xinetd with port 177 ...

----------

## tecknojunky

... which brings us to my initial post  :Laughing: 

 *tecknojunky wrote:*   

> I've setup a new machine, but it's headless.
> 
> I did everything in this howto, but I end up with only the X grey screen.
> 
> Obviously, the problem is because gdm is not started.  So I was searching where I could start gdm in the web of scripts that get called.
> ...

 

----------

## Jeremy_Z

Yes but I thought you had a problem with the howto. As i son't know how it works with xdmcp i can't help much.

But i doubt replacing Xvnc with gdm in the call made by xinetd would work. I would probably "add" gdm.

"Replace X with Xvnc in the gdm.conf. ", well maybe   :Very Happy: 

Try, any of these changes are reversible, so you don't risk much.

----------

## tecknojunky

No, no problems with the howto.  I could just add gdm to a runlevel, but this box is rather slim and so it start X+gdm on a physical terminal for nothing (no monitor).

I f gdm is not started, i get only a grey X background in the remote screen.  So I guess  it's only a metter of knowing the mechanics that links xinetd, Xvnc, X and gdm.

On the basics, we know that gdm start X and Xvnc also start X.  So, in the normal ways this howto, if xinetd start Xvnc and Xvnc start X (supposedly), I'm wondering howcome, it's gdm that appears on the remote console?

Like you said, you'd be tempted to add gdm instead of Xvnc into the xinetd config, then configure gdm.conf to start Xvnc instead of X.  What I think will happen is that gdm will start on the physical screen.

I guess I'll have to try  :Sad: 

----------

## Jeremy_Z

Is this possible to have gdm starting no X server at all ?

----------

## tecknojunky

 *Jeremy_Z wrote:*   

> Is this possible to have gdm starting no X server at all ?

 What good would that serve?

----------

## Jeremy_Z

Don't know, is the X server started by gdm of any use since Xvnc is started when you connect with vncviewer ? Again i am not sure about how it worls so ..

----------

## tecknojunky

Xvnc is an intermediary between the remote viewer and the real X.  If you look at ~/.vnc/xstartup, you will see that eventualy, the real X is started.  So Xvnc is not a replacement of X, it's more like a redirector of keyboard/mouse inputs and screen outputs over the network.

How gdm fits into this, that what's elude me for now.

----------

## Jeremy_Z

Yes but for each connection you make it starts X via Xvnc, so the X via gdm is useless unless for local connections.

----------

## tecknojunky

That's the problem.  I did try to get this working by adding an xinetd entry for xdmcp.  When I connect to the vnc server, it tries to contact the xdmcp server thrue port 711.  xinetd catch that and starts gdm, which it will apear in the xvnc viewer.

The only problem is that gdm is too dumb to be only a xdmcp server.  What I mean is that if I plug in a monitor, there is also an instance of gdm running on the physical terminal too.

I tried to make gdm to serve only to Xvnc, but it's too stuburn.  The closest I came to, was that when gdm was called, it complained that X was already started (Xvnc).

So, I must conclude that this is not possible to do with gdm.  A special greeter should be made for Xvnc only box.  While at it, it should be tunneled thrue ssh.

In clear, gdm's main purpose is to be a local terminal greeter.  The xdmcp for vnc is an hack around for a Xvnc's really really dumb implementation because it lacks any decent security features.

----------

## vdboor

 *tecknojunky wrote:*   

> Xvnc is an intermediary between the remote viewer and the real X.
> 
> If you look at ~/.vnc/xstartup, you will see that eventualy, the real X is started.
> 
> So Xvnc is not a replacement of X, it's more like a redirector of keyboard/mouse inputs and screen outputs over the network.
> ...

 

No. I think you got it wrong. There isn't such a thing as "the real X", nor does Xvnc start it.

X11-clients (kde, xterm, gdm-greeter) all open a connection an X11-server. This can be Xwin.exe, Xsun, XFree86, X.org, WeirdX (a java applet!), and even Xvnc ...whatever as long as it speaks X11R6.

Both XFree and Xvnc create an image from the X11 commands they receive. (Xvnc even contains XFree code) The big difference is however, Xvnc exports it to the network, and XFree instructs your video-card to display it. That's all.

gdm/kdm/xdm are display managers, they control how X servers are spawned locally on your display. gdm/kdm/xdm also contain a xdmcp-daemon.

XDMCP is a different story. Instead of telnetting/ssh-ing to your box, and changing the $DISPLAY variable, this handshake-stuff happens over a separate protocol, hence XDMCP.

----------

## javock

Hey there,

    I had the grey X cursor screen problem, I was able to correct it. Now everytime I start a vnc session, I have a glimpse of the greeter and then the vnc client closes, I can see the processes running, and the display number incrments each time I try to reconnect. I'm using gdm, and trying to use XFCE4 and run out of ideas to try.

/etc/X11/xdm/xdm-config :

```

DisplayManager.errorLogFile:    /var/log/xdm.log

DisplayManager.pidFile:         /var/run/xdm.pid

DisplayManager.keyFile:         /etc/X11/xdm/xdm-keys

DisplayManager.servers:         /etc/X11/xdm/Xservers

DisplayManager.accessFile:      /etc/X11/xdm/Xaccess

DisplayManager.willing:         su nobody -c /etc/X11/xdm/Xwilling

DisplayManager*authorize:       true

DisplayManager._0.setup:        /etc/X11/xdm/Xsetup_0

DisplayManager._0.startup:      /etc/X11/xdm/GiveConsole

DisplayManager._0.reset:        /etc/X11/xdm/TakeConsole

DisplayManager*resources:       /etc/X11/xdm/Xresources

DisplayManager*session:         /etc/X11/xdm/Xsession

DisplayManager*authComplain:    true

```

/etc/X11/gdm/gdm.conf

```

[daemon]

AutomaticLoginEnable=false

AutomaticLogin=

TimedLoginEnable=false

TimedLogin=

TimedLoginDelay=30

LocalNoPasswordUsers=

AlwaysRestartServer=true

Configurator=/usr/bin/gdmsetup --disable-sound --disable-crash-dialog

GnomeDefaultSession=/usr/share/gnome/default.session

Chooser=/usr/bin/gdmchooser

DefaultPath=/bin:/usr/bin:/usr/X11R6/bin:/usr/X11R6/bin:/usr/local/bin:/usr/bin

RootPath=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/X11R6/bin:/usr/local/

bin:/usr/bin

DisplayInitDir=/etc/X11/gdm/Init

Greeter=/usr/bin/gdmlogin

RemoteGreeter=/usr/bin/gdmgreeter

User=gdm

Group=gdm

KillInitClients=true

LogDir=/var/lib/gdm

PidFile=/var/run/gdm.pid

PostSessionScriptDir=/etc/X11/gdm/PostSession/

PreSessionScriptDir=/etc/X11/gdm/PreSession/

FailsafeXServer=

XKeepsCrashing=/etc/X11/gdm/XKeepsCrashing

RebootCommand=/sbin/shutdown -r now;/usr/sbin/shutdown -r now

HaltCommand=/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shu

tdown -h now

SuspendCommand=

ServAuthDir=/var/lib/gdm

SessionDir=/etc/X11/gdm/Sessions/

UserAuthDir=

UserAuthFBDir=/tmp

UserAuthFile=.Xauthority

StandardXServer=/usr/X11R6/bin/X

FlexibleXServers=5

Xnest=/usr/X11R6/bin/Xnest -audit 0 -name Xnest

FirstVT=7

VTAllocation=true

[security]

AllowRoot=true

AllowRemoteRoot=false

AllowRemoteAutoLogin=false

RelaxPermissions=0

RetryDelay=3

UserMaxFile=65536

SessionMaxFile=524388

[xdmcp]

Enable=true

HonorIndirect=true

MaxPending=4

MaxPendingIndirect=4

MaxSessions=16

MaxWait=15

MaxWaitIndirect=15

DisplaysPerHost=1

PingInterval=1

Port=177

Willing=/etc/X11/gdm/Xwilling

[gui]

GtkRC=/usr/share/themes/Default/gtk/gtkrc

MaxIconWidth=128

MaxIconHeight=128

[greeter]

TitleBar=true

ConfigAvailable=true

Browser=false

DefaultFace=/usr/share/pixmaps/nobody.png

Exclude=bin,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,nobody,gdm,

postgres,pvm,rpm

MinimalUID=100

GlobalFaceDir=/usr/share/faces/

Icon=/usr/share/pixmaps/gdm.png

LocaleFile=/etc/X11/gdm/locale.alias

Logo=/usr/share/pixmaps/gdm-foot-logo.png

Quiver=true

SystemMenu=true

Welcome=Welcome to %n

LockPosition=false

SetPosition=false

PositionX=0

PositionY=0

XineramaScreen=0

BackgroundType=2

BackgroundImage=

BackgroundScaleToFit=true

BackgroundRemoteOnlyColor=true

BackgroundProgram=

RunBackgroundProgramAlways=false

ShowGnomeChooserSession=true

ShowGnomeFailsafeSession=true

ShowXtermFailsafeSession=true

Use24Clock=false

UseCirclesInEntry=false

GraphicalTheme=gentoo-emergence

GraphicalThemeDir=/usr/share/gdm/themes/

[chooser]

DefaultHostImg=/usr/share/pixmaps/nohost.png

HostImageDir=/usr/share/hosts/

ScanTime=3

Hosts=

Broadcast=false

[debug]

Enable=true

[servers]

0=Standard

1=Terminal -query localhost

[server-Standard]

name=Standard server

command=/usr/X11R6/bin/X -nolisten tcp -audit 0

flexible=true

[server-Terminal]

name=Terminal server

command=/usr/X11R6/bin/X -nolisten tcp -audit 0 -terminate

flexible=false

handled=false

```

/etc/X11/xdm/Xaccess

```
*                                       #any host can get a login window
```

If someone has any hint, idea, comment please point out.

Thanks.

----------

## vdboor

Have you tried using a different vnc client? It almost sounds like your client crashes. I was also thinking about a firewall issue, but I don't exactly know how (because it seams to work very well for me)

Btw, if you're running gdm, you don't need to change the settings of xdm.

----------

## javock

 *vdboor wrote:*   

> Have you tried using a different vnc client? It almost sounds like your client crashes.

 

Tried different clients, no luck... TightVNC 4 win and RealVNC, tight exits with a connection lost message Real says nothing...

 *vdboor wrote:*   

> 
> 
>  I was also thinking about a firewall issue, but I don't exactly know how (because it seams to work very well for me)

 

Tested without FW... same result...

 *vdboor wrote:*   

> Btw, if you're running gdm, you don't need to change the settings of xdm.

 

OK..

This is the output of /var/log/messages, I'm using debug=true in gdm...

```

May 14 12:27:37 aqua xinetd[2070]: START: vnc pid=22185 from=200.9.75.132

May 14 12:27:37 aqua gdm[2104]: gdm_xdmcp_decode: Received opcode QUERY from client 127.0.0.1

May 14 12:27:37 aqua gdm[2104]: gdm_xdmcp_handle_query: Opcode 2 from 127.0.0.1

May 14 12:27:37 aqua gdm[2104]: gdm_xdmcp_send_willing: Sending WILLING to 127.0.0.1

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_decode: Received opcode REQUEST from client 127.0.0.1

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_handle_request: Got REQUEST from 127.0.0.1

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_handle_request: pending=0, MaxPending=4, sessions=0, MaxSessions=16

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_display_dispose_check (localhost:7)

May 14 12:27:39 aqua gdm[2104]: gdm_auth_secure_display: Setting up access for localhost:7

May 14 12:27:39 aqua gdm[2104]: gdm_auth_secure_display: Setting up socket access

May 14 12:27:39 aqua gdm[2104]: gdm_auth_secure_display: Setting up network access

May 14 12:27:39 aqua gdm[2104]: gdm_auth_secure_display: Setting up access for localhost:7 - 3 entries

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_display_alloc: display=localhost:7, session id=1084505477, pending=1

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_send_accept: Sending ACCEPT to 127.0.0.1 with SessionID=1084505477

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_decode: Received opcode MANAGE from client 127.0.0.1

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_handle_manage: Got MANAGE from 127.0.0.1

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_handle_manage: Got Display=7, SessionID=1084505477 from 127.0.0.1

May 14 12:27:39 aqua gdm[2104]: gdm_xdmcp_handle_manage: Looked up localhost:7

May 14 12:27:39 aqua gdm[2104]: gdm_choose_indirect_lookup: Host 127.0.0.1 not found

May 14 12:27:39 aqua gdm[2104]: gdm_forward_query_lookup: Host 127.0.0.1 not found

May 14 12:27:39 aqua gdm[2104]: gdm_display_manage: Managing localhost:7

May 14 12:27:39 aqua gdm[2104]: Resetting counts for loop of death detection

May 14 12:27:39 aqua gdm[2104]: gdm_display_manage: Forked slave: 22186

May 14 12:27:39 aqua gdm[22186]: gdm_slave_start: Starting slave process for localhost:7

May 14 12:27:39 aqua gdm[22186]: gdm_slave_start: Loop Thingie

May 14 12:27:39 aqua gdm[22186]: gdm_slave_run: Opening display localhost:7

May 14 12:27:39 aqua gdm[22186]: gdm_slave_greeter: Running greeter on localhost:7

May 14 12:27:39 aqua gdm[2104]: (child 22186) gdm_slave_child_handler

May 14 12:27:39 aqua gdm[22186]: gdm_slave_greeter: Greeter on pid 22188

May 14 12:27:39 aqua gdm[22186]: Sending GREETPID == 22188 for slave 22186

May 14 12:27:39 aqua gdm[22186]: Sending GREETPID 22186 22188

May 14 12:27:39 aqua gdm[2104]: Handling message: 'GREETPID 22186 22188'

May 14 12:27:39 aqua gdm[2104]: Got GREETPID == 22188

May 14 12:27:39 aqua gdm[2104]: (child 22186) gdm_slave_usr2_handler: localhost:7 got USR2 signal

May 14 12:27:42 aqua gdm[22186]: gdm_slave_wait_for_login: In loop

May 14 12:27:42 aqua gdm[2104]: mainloop_sig_callback: Got signal 20

May 14 12:27:42 aqua gdm[2104]: gdm_cleanup_children: child 22186 returned 2

May 14 12:27:42 aqua gdm[2104]: gdm_child_action: Slave process returned 2

May 14 12:27:42 aqua gdm[2104]: gdm_display_unmanage: Stopping localhost:7 (slave pid: 0)

May 14 12:27:42 aqua gdm[2104]: gdm_display_dispose: Disposing localhost:7

May 14 12:27:42 aqua gdm[2104]: (child 22186) gdm_slave_child_handler

May 14 12:27:42 aqua gdm[2104]: (child 22186) gdm_slave_child_handler: 22188 died

May 14 12:27:42 aqua gdm[2104]: (child 22186) gdm_slave_child_handler: 22188 returned 1

May 14 12:27:42 aqua gdm[2104]: main: Exited main loop

```

Also the contents of /var/lib/gdm/:4.log (and all :#.log are the same)

by the way, i'm trying this on a SUN ultra10, X at the console works well, so this (I think) should not be a problem...

```
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.24-sparc-r1 sparc64 [ELF]

Build Date: 30 January 2004

        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.4.log", Time: Thu May 13 22:42:24 2004

(==) Using config file: "/etc/X11/XF86Config"

Detected FFB2+/vertical, Z-buffer, Double-buffered.

Symbol DRIQueryVersion from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol DRICreateInfoRec from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol DRIScreenInit from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol DRIDestroyInfoRec from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol DRIGetSAREAPrivate from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol drmAddMap from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol drmAddMap from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol drmAddMap from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol drmAddMap from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol drmAddMap from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol DRICloseScreen from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol DRIDestroyInfoRec from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol DRICloseScreen from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol DRIDestroyInfoRec from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol DRIFinishScreenInit from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

Symbol GlxSetVisualConfigs from module /usr/X11R6/lib/modules/drivers/sunffb_drv.o is unresolved!

```

Regards

----------

## DAWG98

I tried the howto.  Thanks lines for putting it together.  However, when I execute vncwiever on my XP box to linux_box:82 I only get the grey screen.  Alternatively, if I start vncviewer manually and then execute vncviewer to linux_box:1 it works. 

I tried editing the xstartup; i.e., startkde &, I ensured and double and triple ensured that everything is entered as it should be, that programs are listening on the correct ports, etc (I spent over 14 hours trying to fix this), but still GREY.  

So there are a few hypo's/questions that I think may help me find the solution (please be considerate as I am a n00b):

1. I am running KDE 3.2.  Many files are duplicate under KDE 3.2 and X; i.e., I have more than one version of Xsession, Xwilling etc.  How can I ensure that the right file is being called?   What's Xvnc using?

2. In /root/.vnc/xstartup I commented the twm out and replaced with startkde...should it be something else; i.e., kdm?

3. What is the /$home/.Xresources for?  I searched for this file to no avail.  Is KDE no starting because this is missing?

4. I checked out this Howto http://www.openbrick.org/en/Members/tn/thinclient/Howto%20configure%20X%20and%20VNC

and it requires one to edit the font server...is that necessary here also?

5. Where does Xvnc log its prcgress?

Thanks for any comments in advance.

----------

## javock

OK, got tired...

I tried to use the vnc login in via ssh, then running, vncserver :# got the server spawned, now I connect using vncviewer localhost:# (I have a tunnel -L 590#:localhost:590#) and get twm PUAJ! but working. A few problems :

   * fonts look UGLY, not only ugly, but characters without sense, missing, reversed... (yes, I have xfs running, no I didn't use -f font fifo, or whatever, I will try later)

   * if i leave the server alone (only move mouse) everything OK! if I try to launch even an xterm, firefox or whatever the server closes...

Any clue?

Thanks.

----------

## thorne

OK... I went through the tutorial.  Here is my problem:

```
bash-2.05b$ vncviewer localhost:71

vncviewer: ConnectToTcpAddr: connect: Connection refused

Unable to connect to VNC server
```

If I try to connect via a different box, I get "Unable to connect" or something to that effect.

If I manually start vncserver I can connect through vncviewer on the standard ports (i.e. 5901.)

Not sure how to resolve this one.... Any help is appreciated.

----------

## geforce

i'm using KDE 3.2: 

 *Quote:*   

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

 

There is no "kde" directory in /etc... 

There is no configuration file for kde in /etc...

Can someone help me please ?

----------

## Moloch

geforce *Quote:*   

> There is no "kde" directory in /etc... 
> 
> There is no configuration file for kde in /etc...

 

Try: /usr/kde/3.2/share/config/kdm/kdmrc

thorne *Quote:*   

> vncviewer: ConnectToTcpAddr: connect: Connection refused

 

It sounds like xinetd has not been configured correctly or not started. You will usually get a connection refused when nothing is listening on that port. It could be firewall related as well.

----------

## geforce

Ok I founded it;

I setted XDPCM to

XDPCM=true

is it okay ?

Thanks alot

----------

## tactless

Any way to set the default DPI for vncserver? (For manual activation of vncserver, not inetd)

----------

## nx12

Somebody knows how to resume/suspend VNC sessions? 

I need to run some GUI apps for a really long time on the remote computer and keep the vnc window open is a bit annoying, not saying that if I close it I'll be completely fscked?

I've seen a vnc session manager project but it requires patched client and has patches only for win32 clients.  :Rolling Eyes: 

I'll be glad to hear any suggestions.

----------

## tomarsyd

After reading most of this thread, I'm wondering if it's required to have gdm/xdm/kdm/etc installed.  When I boot my machine I prefer to get a text login and then run startx to get going in my window manager of choice.  Can I still run vnc without having gdm/xdm/kdm/etc running?

Thanks.

----------

## javock

 *tomarsyd wrote:*   

> After reading most of this thread, I'm wondering if it's required to have gdm/xdm/kdm/etc installed.  When I boot my machine I prefer to get a text login and then run startx to get going in my window manager of choice.  Can I still run vnc without having gdm/xdm/kdm/etc running?
> 
> 

 

xdm/gdm/kdm will manage your XDMCP connection between the Xvnc/vncclient. 

So I think you should have one of these login mannagers running.

Another thing you could do (probably not doable, but well, I'm a n00b  :Smile: ) is set up xinitd or whatever to have it start gdm upon a connection to udp 117 (this is the part I think is not doable)

Regards.

----------

## docbill

I too was not getting a login window.  After studying the files, I found if I change the Xservers file to:

:0 local /usr/X11R6/bin/Xvnc

I also had to change the shell for nobody to /bin/bash.  I tried a more restrictive shell, but that did not work.  I also tried using a different account, i.e. 'xdmlogin', but that also did not work.

Now my only problem is once I login it tries to start kdm, even though I don't have kdm installed...

                             Bill

----------

## nx12

Hm-m, the only way to resume/reconnect to running vnc sessions I've found is to enable autologin in gdm and put vncserver comand in the .xprofile of the user..  :Rolling Eyes:   Well, it's not elegant, but at least it works.. So at the end of all I can have a bulletproof Xsession.  :Rolling Eyes: 

I feel like to try later adding some kind of init script starting  Xserver and Xvnc without gdm thingies.. If I get something interesting I'll write back.

----------

## xiando

I've used this for quite a while and I was quite annoyed with this, out of the blue, stopped working (because I had recompiled XFree).

XFree must be compiled without IPv6 support. Xdmcp does not work if XFree is compiled with IPv6 support.

```
echo "x11-base/xfree -ipv6" >> /etc/portage/package.use
```

or install using 

```
USE="-ipv6" emerge xfree
```

The Nobody Shell Issue (that will give you a gray screen without a login manager)

I use KDM as login manager. KDEs KDM does not require the user nobody to have a valid shell. XDM, on the other hand, does require nobody to have a valid shell when used as a vnc server.

```
usermod -s /bin/bash nobody
```

----------

## Ssl

Hi,

Really nice topic - thanks everyone, especially author (lines)

Few questions:

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

I have similar line but not the same. My line is:

```
#*                                       #any host can get a login window
```

There is not quote here. What to do? To simply delete '#' character?

Are steps 4) and 7) needed if I want to have gdm for vnc sessions and not xdm?

Also, I'll wait your answers on this but now I get mesage:

```
slobo@localhost slobo $ vncviewer localhost:71

VNC viewer version 3.3.7 - built Apr  1 2004 01:02:07

Copyright (C) 2002-2003 RealVNC Ltd.

Copyright (C) 1994-2000 AT&T Laboratories Cambridge.

See http://www.realvnc.com for information on VNC.

ReadFromRFBServer: rdr::EndOfStream
```

My window manager is gdm. Did 

```
emerge vnc
```

 instead 

```
emerge tightvnc
```

 - is this makes difference?

Thank you

Ssl

----------

## Ssl

Ok, unmerged vnc and installed tightvnc and now I have this:

slobo@localhost slobo $ vncviewer localhost:71

vncviewer: VNC server closed connection

nothing more. Log in /home/slobo/.vnc/localhost:1.log

```
03/06/04 03:29:29 Xvnc version 3.3.tight1.2.9

03/06/04 03:29:29 Copyright (C) 1999 AT&T Laboratories Cambridge.

03/06/04 03:29:29 Copyright (C) 2000-2002 Constantin Kaplinsky.

03/06/04 03:29:29 All Rights Reserved.

03/06/04 03:29:29 See http://www.uk.research.att.com/vnc for information on VNC

03/06/04 03:29:29 See http://www.tightvnc.com for TightVNC-specific information

03/06/04 03:29:29 Desktop name 'X' (localhost:1)

03/06/04 03:29:29 Protocol version supported 3.3

03/06/04 03:29:29 Listening for VNC connections on TCP port 5901

03/06/04 03:29:29 Listening for HTTP connections on TCP port 5801

03/06/04 03:29:29   URL http://localhost:5801

xrdb: No such file or directory

xrdb: can't open file '/home/slobo/.Xresources'

                                                                                                                                               

03/06/04 03:29:56 Got connection from client 127.0.0.1

03/06/04 03:29:56 Protocol version 3.3

03/06/04 03:29:59 Full-control authentication passed by 127.0.0.1

03/06/04 03:30:00 Pixel format for client 127.0.0.1:

03/06/04 03:30:00   32 bpp, depth 24, little endian

03/06/04 03:30:00   true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0

03/06/04 03:30:00   no translation needed

03/06/04 03:30:00 Using raw encoding for client 127.0.0.1

03/06/04 03:30:00 Using compression level 1 for client 127.0.0.1

03/06/04 03:30:00 Using image quality level 6 for client 127.0.0.1

03/06/04 03:30:00 Enabling X-style cursor updates for client 127.0.0.1

03/06/04 03:30:00 Enabling cursor position updates for client 127.0.0.1

03/06/04 03:30:00 Enabling LastRect protocol extension for client 127.0.0.1

03/06/04 03:30:10 Client 127.0.0.1 gone

03/06/04 03:30:10 Statistics:

03/06/04 03:30:10   key events received 0, pointer events 75

03/06/04 03:30:10   framebuffer updates 11, rectangles 771, bytes 3652930

03/06/04 03:30:10     cursor shape updates 5, bytes 410

03/06/04 03:30:10     cursor position updates 1, bytes 12

03/06/04 03:30:10     raw rectangles 741, bytes 3652124

03/06/04 03:30:10     copyRect rectangles 24, bytes 384

03/06/04 03:30:10   raw bytes equivalent 3652124, compression ratio 1.000000

xterm:  fatal IO error 32 (Broken pipe) or KillClient on X server ":1.0"

```

What's this: seems two errors - but maybe someone notice more  :Smile: 

Ssl

----------

## Raybdbomb

i followed the guide exactly, to the T

i tried xdm and gdm, and both give the error message when trying to run vncviewer:71

 *Quote:*   

> nix root # vncviewer localhost:71
> 
> vncviewer: ConnectToTcpAddr: connect: Connection refused
> 
> Unable to connect to VNC server
> ...

 

----------

## Raybdbomb

ok it works if i manually start the Xvnc server... but it doesn't load up a login, it just has the grey screen with cursor

i'll look through these other replies

----------

## Lechuga

Oooooh This is sooo kewl man! I love it! Now we all have Xwindows and KDE running remotely.

But you forgot to mention the following: 

 *Quote:*   

> In /usr/kde/3.2/share/config/kdm/kdmrc look for the [Xdmcp] section and change Enable = false to Enable = true
> 
> 

 

Cheers!

----------

## Child_of_Sun

Ist ja ganz nett dein Script, aber wie bekomme ich es hin das er die Sitzung beim schleißen des Client-Fensters aufrechterhält, ist nämlich nervig das Fenster bei allen Operationen geöffnet zu lassen.

CoS

Aber ansonsten hat es mich schwer beeindruckt.

----------

## javock

 :Question:   :Exclamation:   :Question:   :Exclamation:   :Exclamation:   :Question:   :Exclamation:   :Question:   :Question:   :Exclamation:   :Question: 

 *Child_of_Sun wrote:*   

> Ist ja ganz nett dein Script, aber wie bekomme ich es hin das er die Sitzung beim schleißen des Client-Fensters aufrechterhält, ist nämlich nervig das Fenster bei allen Operationen geöffnet zu lassen.
> 
> CoS
> 
> Aber ansonsten hat es mich schwer beeindruckt.

 

In english please   :Rolling Eyes: 

----------

## Child_of_Sun

Sorry, i have written at the same time in an German Forum and haven't thought about it.

I find your script very useful, but when i log off the current display won't stay open it will close and you must login every time when you close the Remote Window and reopen it. I need that the session stays open because of some Compilation an the other PC so it is not very useful for me, but i have got found out how i can do that what i want on another way.

But when it give a possibility to force the session to stay open, please tell me, because i haven't found out how.

CoS

----------

## geforce

Wich ports do I need to unlock on my firewall ?

----------

## Treo

Hi,

I just came across something in which you guys might be interested... and maybe someone could even offer a solution...

I just spent a good 4 hours to figure out why I only get grey screens when trying to vnc into my notebook... it works like a charm the other way around (NB to Desktop) and the configuration files are identical...

I have been running a Cisco wireless card on eth1/wifi0 and that was the only ethernet interface at the time. I then finally thought about using the build-in wired port and it worked, I was blown away...

And what was really strange was that it didn't even work locally on the notebook... a vncviewer localhost:72 always gave me a grey screen...

So, maybe that will solve some grey screen problems... but does anyone know how to fix this? I am not too got with X networking and all, but there must be some kind of solution so I can use both devices.

Thanks,

Treo

----------

## Lechuga

 *geforce wrote:*   

> Wich ports do I need to unlock on my firewall ?

 The ones you added to the /etc/services file and that you want to make available.

Cheers!

Lechuga

----------

## javock

 *Child_of_Sun wrote:*   

> Sorry, i have written at the same time in an German Forum and haven't thought about it.
> 
> I find your script very useful, but when i log off the current display won't stay open it will close and you must login every time when you close the Remote Window and reopen it. I need that the session stays open because of some Compilation an the other PC so it is not very useful for me, but i have got found out how i can do that what i want on another way.
> 
> But when it give a possibility to force the session to stay open, please tell me, because i haven't found out how.
> ...

 

Hey there... no prob...

I saw a posting in the tightvnc mailing https://lists.sourceforge.net/lists/listinfo/vnc-tight-list list regarding the persistence of the sessions... I just cant find it right now, but if you care to look there, or perhaps post there you will recieve some feedback...

regards!

----------

## Child_of_Sun

@Javock

Thanks at all, will search there, if i found out something, i post the link here.

CoS

----------

## rollinncoaster

Worked  exactly as described, (xdm + fluxbox). Just set your new services (there is no need to include all the services, just the ones you really need), set up the entries for the xinetd deamon, allow any client to get access to the login screen (comment out that line on the Xaccess file), restart gdm and xinetd, and open corresponding ports on the firewall. If you only use one resolution, just open one port.  Works flawlessly over the internet at 1024x768x16 with a cable connection.

Thanks again. 

RC

NOTE: anybody know about any security risk when running this kind of setup. I am going to configure some servers like this for remote administration. Is there any problems?

----------

## Lechuga

 *rollinncoaster wrote:*   

> NOTE: anybody know about any security risk when running this kind of setup. I am going to configure some servers like this for remote administration. Is there any problems?

 

Yes. VNC is unencrypted (so anyone on your network with a sniffer can listen in a get all the passwords he/she needs). When I say network, this could be the Internet if you plan to run this over it.

You should use SSH to tunel the VNC ports you want to use.

Cheers!

Lechuga

----------

## DreamweaverN

Old thread, sorry all  :Smile: . Lechuga do you have a link or a guide or something on how to set that up?

----------

## Lechuga

I don't have anything ready made, but I'll try to make something up.

Ok. If you're using Windows client and a VNC viewer (say UltraVNC, why not?) then you only need PuTTY to setup an SSH connection from Windows and then tunnel your VNC connection through it, making it safe from prying eyes. This is how:

1. Start up "putty"

2. Enter your hostserver in the "hostname" field (duh!)

3. Follow the option tree on the left to the bottom to "Tunnels"

4. Add new forwarded port as follows: 

  a. Source port: 5961 (for example, this gives you 800x600x16)

  b. Destination: yourhost:5961

5. Click on open. You should now be able to login to your host with your username and password (still text mode).

6. Now start your VNC viewer and point it to locahost:5961

Isn't it great when things are this simple?

That's it! Good luck.

----------

## slaterson

I changed /etc/X11/xdm/Xaccess to only allow connections from my network (192.168.110.*), but it still allows connections from any IP address.  Has anyone else checked this?

----------

## Lechuga

 *slaterson wrote:*   

> I changed /etc/X11/xdm/Xaccess to only allow connections from my network (192.168.110.*), but it still allows connections from any IP address.  Has anyone else checked this?

 

I think you need to look at /usr/kde/3.2/share/config/kdm/Xaccess. That is if you use KDE.

Cheers!

Lechuga

----------

## slaterson

 *Lechuga wrote:*   

>  *slaterson wrote:*   I changed /etc/X11/xdm/Xaccess to only allow connections from my network (192.168.110.*), but it still allows connections from any IP address.  Has anyone else checked this? 
> 
> I think you need to look at /usr/kde/3.2/share/config/kdm/Xaccess. That is if you use KDE.
> 
> 

 

i'm using gdm, but gdm doesn't appear to have an Xaccess file.  is it named something else?

----------

## mterlouw

Is anyone else having trouble getting this to work with xorg? I tried tracing the problem and the most I could get it to do was give me the black & white screen and X mouse cursor by specifying font paths manually in the xinetd services file. I was thinking the problem was the font paths because xorg moved them to /usr/share/fonts. Anyways without specifying the font paths manually, I only get a response on the console "VNC connection closed by server" or something to that effect.

----------

## heavy

Thanks for the great tutorial, been wanting to do this for a while.

----------

## Roderik

YES! it finally worked for me  :Smile: 

i only have one very annoying problem left, as you can see below, it doesn't show icons etc. I mean to use it in my LAN to the gentoo server without a screen over a 100mbit, largely unused network, so all the effects could transmit without a loss of speed...

Screenie 1

Screenie 2

[EDIT] ok, got it, don't open a 32bit vnc on a 24bit TFT screen  :Smile: 

----------

## Narusegawa

Is there a way of getting this methodology working with the java http client?

----------

## VinnieNZ

 *Roderik wrote:*   

> [EDIT] ok, got it, don't open a 32bit vnc on a 24bit TFT screen 

 

Heh, I did that as well  :Laughing: 

Also note that your VNC screen doesn't display correctly if you try to open a 32bit session on a remote desktop that only supports 24bit max (well duh Vinnie...  :Embarassed: )

----------

## VinnieNZ

Right, to try to complicate things some more...

I'm at work and would like to VNC in to my own machine at home (via SSH as the work network's ports are quite heavily locked).  The problem is this.  To get to my machine via SSH (which I can do from work) I go:

WorkPC -> Home Server (Debian - my flatmates setup; basically sits as a gateway between the router and the rest of the network) -> Cobra (My Gentoo setup).

So I have to SSH onto the home server then SSH from there to Cobra.

Is it possible to somehow 'bounce' the tunneling through the Home Server to my machine?  Or is this just wishful thinking  :Rolling Eyes: 

----------

## opm8

VinnieNZ,

What you need to do is establish an ssh tunnel from your work machine to Cobra through the Home Server, easily accomplished through ssh.

```

ssh HomeServer -L 2222:Cobra:22 -L 5900:Cobra:5900 -C -N

```

What this does is establishes a tunnel from your local port 2222  (on your work computer)  directly to port 22 of Cobra.  Disregard the 5900:Cobra:5900 for now, I'll explain in a minute.  The -L means it's a tunnel from local port, -C compresses the connection (a good thing, especially if you're going to use vnc), and -N simply establishes this connection without spawning a shell on Cobra.  After you enter this on the command line it will just sit there so minimize the shell to get rid of it.

Now all you need to do is

```

ssh localhost -p 2222 -l <your username on Cobra>

```

and you'll be connected directly to Cobra. That's for direct command-line level access to Cobra.  You want vnc access, which is a different kettle of fish.  :Smile: 

Here's what I do, since I have a similar setup:

At home:

```

emerge libvncserver

```

This gives you the x11vnc executable.  What you'll do is create a tunnel and then vnc through it.  This is where -L 5900:Cobra:5900 comes in.  This is a tunnel from your work machine to port 5900 on Cobra, where x11vnc is listening.  Create an executable (I call it vnc_home) and put it into /usr/local/bin.

```

#!/bin/bash

#Establish tunnel to home box and start x11vnc there

ssh localhost -C -p 2222 '/usr/local/bin/x11vnc -display :0 -bg'

#Establish a vnc session thru ssh

vncviewer localhost::5900 -passwd ~/.vnc/passwd -noshared -compresslevel 9 -quality 5 -encodings Tight -xrm '*grabKeyboard: true' -xrm '*desktop.translations: #override\n <Key>F12: Quit()'

```

You can use F8 to go to fullscreen and back, and F12 to close the session.  The ~/.vnc/passwd is created with vncpasswd so you don't have to enter the password when Cobra prompts you for it every time.  Do this before running this script.  Notice also that the connection is encoded Tight, which is one of the best features of tightvnc.  From work you now type:

```

vnc_home

```

and sit back in amazement.   :Smile:  Have fun!

--opm8

 *VinnieNZ wrote:*   

> Right, to try to complicate things some more...
> 
> I'm at work and would like to VNC in to my own machine at home (via SSH as the work network's ports are quite heavily locked).  The problem is this.  To get to my machine via SSH (which I can do from work) I go:
> 
> WorkPC -> Home Server (Debian - my flatmates setup; basically sits as a gateway between the router and the rest of the network) -> Cobra (My Gentoo setup).
> ...

 [/code]

----------

## xtcrush

Tutorial's great and It is working perfectly, but question... 

If I connect to the server, log in and then just kill the connection, when I re-login next time, is there anyway to get my original session back?  

Either that or I guess I need to know what to configure to VNC directly into the local desktop.  

Thx

----------

## opm8

xtcrush,

I'm glad you like the tutorial, it's my first one.   :Smile: 

I don't quite understand your question, but here goes. If you're connecting via ssh for command line access to the target system, then once you close out that session, it's gone forever.  Just like a shell on your local machine.

If you're connecting via vnc what you'll see is the same thing as if you were sitting in front of the target computer in person.  VNC is stateless, so if you close out your session, then establish a new one it's as though you never left, and everything is as you left it.

--opm8

 *xtcrush wrote:*   

> Tutorial's great and It is working perfectly, but question... 
> 
> If I connect to the server, log in and then just kill the connection, when I re-login next time, is there anyway to get my original session back?  
> 
> Either that or I guess I need to know what to configure to VNC directly into the local desktop.  
> ...

 

----------

## DoubleSHOT

I keep getting the following error

```
doubleshot@penthouse doubleshot $ vncviewer server:72

VNC viewer version 3.3.7 - built Aug  3 2004 15:36:06

Copyright (C) 2002-2003 RealVNC Ltd.

Copyright (C) 1994-2000 AT&T Laboratories Cambridge.

See http://www.realvnc.com for information on VNC.

VNC server supports protocol version 3.7 (viewer 3.3)

Password:

[b]VNC authentication failed[/b]

```

syslog

```
Aug  3 17:20:00 [CRON] (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )_

Aug  3 17:25:55 [xinetd] START: vnc-1024x768x24 pid=23254 from=192.168.1.15

Aug  3 17:25:55 [kdm_greet] Can't open default user face
```

I didn't notice that any of you had authentication problems at all...much less needing to authenticate at all...i've tried all the passwords i have setup for the box, also, it doesn't ask for a username...=/

any help would be appreciated...

P.S. - I'm using KDE 3.3_beta2

----------

## Doc7

i still got some problems opening a session via vnc....

i already tried about anything in this thread (except gdm/kdm)

if i start a vncserver manually i can connect to this session without a problem and get twm as expected (works also with fluxbox)

but if i try to connect to my xinetd-service i get my xdm-login and after login it disconnects.

On the client side i get the following

```
VNC server supports protocol version 3.3 (viewer 3.3)

No authentication needed

Desktop name "nobody's x11 desktop (lap0003-vm03:3)"

Connected to VNC server, using protocol version 3.3

VNC server default format:

  32 bits per pixel.

  Least significant byte first in each pixel.

  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0

Using default colormap which is TrueColor.  Pixel format:

  32 bits per pixel.

  Least significant byte first in each pixel.

  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0

Using shared memory PutImage

Same machine: preferring raw encoding

vncviewer: VNC server closed connection

ShmCleanup called

```

On the server side i get following log-entires:

```
==> /var/log/everything/current <==

Aug 19 14:21:09 [xinetd] START: vnc-800x600x24 pid=16328 from=127.0.0.1

Aug 19 14:21:09 [su(pam_unix)] session opened for user nobody by (uid=0)

Aug 19 14:21:10 [su(pam_unix)] session closed for user nobody

==> /var/log/xdm.log <==

xdm info (pid 7088): Couldn't connect to PRNGD socket "/tmp/entropy": No such file or directory
```

any suggestions ?

----------

## r0dzilla

I've got everything setup, however:

I'm trying to connect to my linux box from a windows box

I've only setup the 1024x768x24 service

When I run vncviewer on windows and have it to connect to machine:72  nothing happens, no error message or nothing.

if I change 72 to a bogus port I know I'm not using then I get a connect error.

Looking at the logs, it appears xinted is trying to start things:

```
Aug 19 10:10:41 [xinetd] Started working: 1 available service

Aug 19 10:10:48 [xinetd] START: vnc-1024x768x24 pid=31035 from=<IP ADDR REMOVED>
```

any ideas?

NOTE: I removed the ip address to protect the innocent... er somethin'    :Razz: 

----------

## Galuvian

 *Quote:*   

> vncviewer: ConnectToTcpAddr: connect: Connection refused
> 
> Unable to connect to VNC server 

 

Felt really stupid when I realized what I had to do to fix this.

In /etc/hosts.allow add the line:

```
Xvnc : 192.168.0.* : allow
```

----------

## Galuvian

Having lukewarm results getting this going from work.

Everything works fine if I use a direct VNC connection. But when I try going through ssh, it crashes whenever I try doing something on the remote machine that requires much of a re-draw.  Opening Firefox, an irc client, a KDE menu.  If I do the same thing outside of ssh there is no problem.  I've been searching for SSH help but there is so much out there I haven't found what I need yet.

SSH clients I've tried: Putty, OpenSSH, Cygwin

There is a NAT box at work. I added *.mycompany.com to hosts.allow, and it works fine without ssh.  Enable ssh and connections are refused.  Had to allow connections from * just to get it working from here.  My laptop at work is not on the company domain, but if that were the problem it shouldn't work without ssh either.

My home firewall/router is only allowing ports 22 and 5972 through.

----------

## Phorem

Has anyone been sucessful getting VNC (any kind) and OpenGL to work? I've read about xf4vnc and i tried installing chromium (not the game)  http://chromium.sourceforge.net/ but i still get the.....

>>Xlib:  extension "GLX" missing on display ":1.0" <<

I want to have OpenGL so i can watch tv at work using TVTime  :Smile: )

Anyone have OpenGL and VNC working?

----------

## tscolari

Help me here, i read half of the post and saw a lot of people with the same problem im having but no solution...

When i connect to the vnc server i see only the grey screen...

I tryed to add xdm to the .vnc/ startup file, no sucess...

I have edited all the files as the tutorial told...

also i tryed to run the vncpasswd but still my vnc dont ask for the password to connect...

What could i do to fix the grey screen problem?

And to setup a passwd to connect to the vnc?

----------

## tscolari

okay... with kdm it worked... but i really would like to make it to work with xdm... any idea?

orther question is, how can i change the resolution/quality of the connection? how can i change in the execution time the color depth/resolution? 

I saw a friend of mine doing this with his vnc

----------

## jerry arns

You can even avoid to modify the /etc/services files by configuring the /etc/xinetd.d/xvncserver file like this :

```

service vnc-what-ever-name

{

    type = UNLISTED

    port = 5950

    protocol = tcp

    socket_type = stream

    wait = no

    user = nobody

    server = /usr/X11R6/bin/Xvnc

    server_args = -inetd -query localhost -once -geometry 1024x768 -depth 24

    disable = no

}

```

i.e just add the "type" and "port" lines.

I don't know if it is better or not, just another way to do it (less work !).

----------

## tscolari

Okay... i just would like to know if someone did Xdm work on this...

im trying it but no sucess at all...

only kdm is working, xdm gives a grey screen...

----------

## Frontier

Followed the thread at all and still I can't get this to work  :Sad: 

I run KDE but I don't have KDM in my system, plus the xinet.d/xvncserver script does not get executed on startup...

----------

## JohnHerdy

Great howto, thanks a lot!

----------

## lonyx

Only got this running last week - fantastic not having to walk around the so much!

However, the latest version of PAM 0.77-r3, kindly installed after an

```
emerge -uD world
```

results in the session terminating at login.

Error messages in /var/log/everything/current contain 

```
Nov 10 21:21:56 [xinetd] START: vnc-800x600x16 pid=612 from=xxx.xxx.xxx.xxx

Nov 10 21:22:17 [PAM-env] Unknown PAM_ITEM: <XAUTHORITY>

Nov 10 21:22:17 [gdm] PAM pam_putenv: delete non-existent entry; XAUTHORITY

Nov 10 21:22:17 [PAM-env] Unknown PAM_ITEM: <XAUTHORITY>

Nov 10 21:22:17 [gdm] PAM pam_putenv: delete non-existent entry; XAUTHORITY

Nov 10 21:22:17 [gdm(pam_unix)] session opened for user lonyx by (uid=0)

Nov 10 21:22:17 [gdm(pam_unix)] session closed for user lonyx

Nov 10 21:22:17 [PAM-env] Unknown PAM_ITEM: <XAUTHORITY>

Nov 10 21:22:17 [gdm] PAM pam_putenv: delete non-existent entry; XAUTHORITY

Nov 10 21:22:17 [PAM-env] Unknown PAM_ITEM: <XAUTHORITY>

Nov 10 21:22:17 [gdm] PAM pam_putenv: delete non-existent entry; XAUTHORITY
```

Forgive me if this is blindingly obvious to fix, but I'm a complete noob (started with Linux in July).

----------

## Veneroso

I've seen this question posted a few times in this thread, but I haven't been able to find a solution that works.

I have everything set up according to the guide, and when I connect to my server with vncviewer it brings up the login screen.  However after I login, a grey screen comes up and nothing else and I get this error message:

```
vncviewer: VNC server closed connection
```

This happens even when I launch the vncviewer locally.  It allows me to login, brings up the grey screen, sits for about a minute, then sudenly closes.

I am currently using gdm, but kdm has the same problem.

I broke down and installed the demo of Starnet's X-win32 to see if XDMCP was working, which it does.  I was able to login normally, although there was a long delay in the desktop being loaded (probably due to it being run on my old pentium 166).  But at least it worked.  X11 forewarding with ssh has virtually no delay when launching individual X-apps from the terminal.

I am running:

tightvnc-1.3_alpha5

xorg-x11-6.8.0-r1

I am leaning towards this being an issue with tightvnc, I will try an earlier version.

--edit--

nope, not tightvnc...well, tightvnc-1.2.9-r1 has the same problem, and its the version I had on the last time this worked, a few months ago on a stage 3 install.  So my guess that its not it.  It shouldn't be xorg either because XDMCP does work in the standard mode, so I don't know.

Any suggestions?

----------

## schneider

 *Veneroso wrote:*   

> This happens even when I launch the vncviewer locally.  It allows me to login, brings up the grey screen, sits for about a minute, then sudenly closes.
> 
> 

 

edit /etc/security/pam_env.conf and comment out the following lines:

```
REMOTEHOST     DEFAULT= OVERRIDE=@{PAM_RHOST}

DISPLAY        DEFAULT=${REMOTEHOST}:0.0 OVERRIDE=${DISPLAY}

XAUTHORITY     DEFAULT= OVERRIDE=@{XAUTHORITY}

```

----------

## frenkel

Hi, I'm trying to set up Tightvnc with XDM and Fluxbox. Everything seems to work when I do a vncviewer localhost:71, I get a XDM login screen. After typing in a username and password, I get disconnect from the server.

Here are my logs:

 *Quote:*   

> 
> 
> /var/log/xdm.log:
> 
> <snip>
> ...

 

 *Quote:*   

> 
> 
> ~/.xsession-errors:
> 
> Xlib: connection to "localhost:1.0" refused by server
> ...

 

Does anybody know how to solve this?

Thanks,

Frank

----------

## frenkel

Doesn't anyone know how to solve this? I need this for school  :Crying or Very sad: 

Thanks in advance,

Frank

----------

## abeowitz

emerge pam-0.77-r2.ebuild and do the etc-update.

This fixed my remote GDM login problem, my tightvnc server problem, AND my SSH DISPLAY="localhost:10.0" problem!!!!

----------

## ezechiel_dantec

 *schneider wrote:*   

>  *Veneroso wrote:*   This happens even when I launch the vncviewer locally.  It allows me to login, brings up the grey screen, sits for about a minute, then sudenly closes.
> 
>  
> 
> edit /etc/security/pam_env.conf and comment out the following lines:
> ...

 

I have the same problem, and these lines are NOT commented in my pam_env.conf...

I don't get it...   :Confused: 

EDIT: I emerged the r2 version of pam, but now, how do I avoid it getting updated when I  

```
emerge -Dua world
```

?

----------

## GrimSage

Ok I dont know if this is possible or not, not the best with all this stuff.

Is is possible to do something like screen with this.  As in can I connect do soemthing to detach from the session but keep it running then when I get back to the computer reconnect to it?

I didnt read though all 11 pages so I dont know if this has been asked, if it has please forgive me and direct me to where it is.

----------

## ezechiel_dantec

 *GrimSage wrote:*   

> Ok I dont know if this is possible or not, not the best with all this stuff.
> 
> Is is possible to do something like screen with this.  As in can I connect do soemthing to detach from the session but keep it running then when I get back to the computer reconnect to it?
> 
> I didnt read though all 11 pages so I dont know if this has been asked, if it has please forgive me and direct me to where it is.

 

AFAIK nothing exists of this sort, and I looked for it...

However there's something you can do to take control of you currently opened session... if you're interested...

----------

## GrimSage

yeah how would I accomplish that?

----------

## frenkel

 *ezechiel_dantec wrote:*   

>  *schneider wrote:*    *Veneroso wrote:*   This happens even when I launch the vncviewer locally.  It allows me to login, brings up the grey screen, sits for about a minute, then sudenly closes.
> 
>  
> 
> edit /etc/security/pam_env.conf and comment out the following lines:
> ...

 

Read what he says... COMMENT OUT THE FOLLOWING LINES, so you have to make them comments, that's the whole point...  :Rolling Eyes: 

Good luck!

Frank

----------

## ezechiel_dantec

There you go, just follow the documentation, and you should be fine!

http://xf4vnc.sf.net

----------

## GrimSage

That seems to be timing out.... Interesting never seen sf down...

typing in sourceforge seemed to work though.  Now my question is will this whole guide work with xf4vnc rather than tightvnc?Last edited by GrimSage on Tue Nov 16, 2004 4:03 pm; edited 1 time in total

----------

## ezechiel_dantec

just checked works for me...

----------

## Veneroso

Thanks alot Frenkel, that did the trick.  Sorry for my late reply, but I forgot all about this issue because I was busy with other matters.  Thanks again.

----------

## ezechiel_dantec

 *Frenkel wrote:*   

>  *ezechiel_dantec wrote:*    *schneider wrote:*    *Veneroso wrote:*   This happens even when I launch the vncviewer locally.  It allows me to login, brings up the grey screen, sits for about a minute, then sudenly closes.
> 
>  
> 
> edit /etc/security/pam_env.conf and comment out the following lines:
> ...

 

Sorry for being French. I'm not quite used to the use of comment out. Thought it meant "to put out the #", seems it means to put them in.

----------

## meglamaniac

What can I say?

Worked first time and I'm a complete newbie at this.

A touch of class.

Thanks!

BTW, I had no trouble and I'm only using xdm. gdm and kdm are not installed. My window manager is fluxbox. However, it doesn't like it if I try 32bit colour mode - I just get the plain old X screen then. I suspect that's more to do with the old graphics card than anything else.

----------

## Sir_Chancealot

 *lines wrote:*   

> ... tightvnc, which is almost just as thin as rdp.  ...
> 
> 

 

That isn't saying much.    :Wink:   :Twisted Evil: 

----------

## bruor

wanted to say thanks to schneider for the post about commenting out the lines,  solved my problems here as well.

----------

## Kioshen

 *schneider wrote:*   

>  *Veneroso wrote:*   This happens even when I launch the vncviewer locally.  It allows me to login, brings up the grey screen, sits for about a minute, then sudenly closes.
> 
>  
> 
> edit /etc/security/pam_env.conf and comment out the following lines:
> ...

 

Thanks a lot that did the trick for me. I had these lines in my gdm's log if anyone is interested because I was trying to log remotely (don't ask why I use XFree) :

```

This is a pre-release version of XFree86, and is not supported in any

way.  Bugs may be reported to XFree86@XFree86.Org and patches submitted

to fixes@XFree86.Org.  Before reporting bugs in pre-release versions,

please check the latest version in the XFree86 CVS repository

(http://www.XFree86.Org/cvs).

XFree86 Version 4.3.0.1

Release Date: 15 August 2003

X Protocol Version 11, Revision 0, Release 6.6

Build Operating System: Linux 2.6.9-gentoo-r1 i686 [ELF]

Build Date: 22 November 2004

        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 Nov 25 09:58:00 2004

(==) Using config file: "/etc/X11/XF86Config"

AUDIT: Thu Nov 25 09:58:55 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34284

AUDIT: Thu Nov 25 09:58:55 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34285

AUDIT: Thu Nov 25 09:58:55 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34286

AUDIT: Thu Nov 25 09:58:55 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34287

AUDIT: Thu Nov 25 09:58:56 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34288

AUDIT: Thu Nov 25 09:58:56 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34289

AUDIT: Thu Nov 25 09:58:56 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34290

AUDIT: Thu Nov 25 09:58:56 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34291

AUDIT: Thu Nov 25 09:58:56 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34292

AUDIT: Thu Nov 25 09:58:56 2004: 3388 X: client 4 rejected from IP 127.0.0.1 port 34293
```

----------

## Shrekkie

Hello fellow-gentoo-ers,

*** GREY-SCREEN STORY ***

I had the stupid grey-screen problem, and I did try anything in this thread, except the re-emerge of xfree with USE="-ipv6", cause i didn't like the long compile. Anyway at the end it was indeed the solution for me.  So try recompiling your xfree without the ipv6 flag if you are as desperate as i was.

Hope this helps someone,

Greetz

----------

## ShastaMaroon

I followed the directions (first post) but I still can't get this to work.

When I type vncviewer localhost:71 I get the error:

Error: Can't open display: localhost:0.0.

Anyone have any ideas how to fix this?

----------

## tscolari

how can i fix this kind of problem:

vncviewer: VNC server closed connection

i tryed to run vncserver to see if it fixes it, but then i got that my display was sancho:1 (sancho is my hostname), shouldnt it be localhost:1? also connect to the hostname doesnt work...

----------

## SidneyKi

I was able to test vnc by running

vncviewer localhost: 71

on the box it self.

but when I try to connect from my laptop I get an error:

unable to connect to host: Connection refused(10061)

----------

## Ceapollo

I am just used to ssh into the box and tunneling the connecting over.

I am going to be setting up a machine tonight i might give this a try we will see.

----------

## tscolari

 *tscolari wrote:*   

> how can i fix this kind of problem:
> 
> vncviewer: VNC server closed connection
> 
> i tryed to run vncserver to see if it fixes it, but then i got that my display was sancho:1 (sancho is my hostname), shouldnt it be localhost:1? also connect to the hostname doesnt work...

 

----------

## SidneyKi

how do you vnc into a gentoo box with a windows 2000 OS latop?

Thanks

----------

## Bob Paddock

Has anyone been able to get this setup to work by using a web browser for a client?

I can get it to work if I start up a vncserver manually but not via this Xvnc Terminal Server

set up.

I set up the services and xvncserver file to have ports such as 5870, 5871 etc.

In the end when I try to login with the browser is "RFB 003.007" as a respons

to my request: http://othermachine.com:5871

 *tecknojunky wrote:*   

> Any hints on enabling the java viewer in this fashion?
> 
> So far, I've added "vnc-http 5800/tcp" in /etc/services and  ...
> 
>  *Quote:*   
> ...

 

----------

## BigMichi1

Is there a way of getting glx available for xvnc on this how-to?

----------

## Schmokin

I already made the changes to /etc/security/pam_env.conf as noted above, but when I try to connect from a remote host I get this in /var/log/messages:

```
Dec 27 16:12:00 aliens xinetd[14388]: START: vnc-1024x768x16 pid=14658 from=xx.xx.xxx.xxx

Dec 27 16:12:00 aliens Xvnc[14658]: segfault at ffffffff95fdb1c8 rip 0000002a95e57e9b rsp 0000007fbfffeed0 error 4
```

Yes I purposely x'd out my IP.

----------

## cpdsaorg

I think those pam_rhost settings are there for a reason and i feel a little uncomfortable "just commenting them out".

are there any guru's out there that know how to set this up another way?? it seems to me that there should be a way to add specific hosts to remote hosts or allow only certain users to log in remotely all configured from pam or something...

----------

## danomac

Another grey screen update:

I did not explicitly specify ipv6 in my USE flags, but I did come across a solution for this in my specific case. I followed the instructions from lines in the first post and I too was plagued with the gray X screen whenever I logged in. After a lot of head-scratching, I realized I goofed up at:

 *lines wrote:*   

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

 

In my case, I looked for the above file and it didn't exist, so I assumed I was using xdm (big mistake on my part   :Embarassed:  ). How I mixed up kdm/xdm is beyond me (tried xdm - uuuugly.) After checking my rc.conf I found out I was using kdm - but the kdmrc was not in the specified folder.

Doing a `find / -name "kdmrc"` revealed to me that in kde-3.3.2 that is was now located here:

```

/usr/kde/3.3/share/config/kdm/kdmrc

```

So, I made the appropriate change in step 5 here, and now I am logged in on my VNC-spawning server posting this article.

I hope this helps others - just a simple overlook caused this in my case.

D

----------

## Mord

Using xdm/fluxbox and got the grey screen problem.  Currently re-emerging xorg-x11 with USE="-ipv6" and hoping this works.

----------

## Mord

Holy crap it worked.  Now I don't get a grey screen anymore, I get xdm.  But now as soon as I log in, I get dropped and the windows closes.

One tiny step closer...

EDIT: YAY PAGE 13!

----------

## Mord

Well, using Xnest (raw XDMCP) works just fine with no problems (I get the XDM logon screen and it takes me into a fluxbox session).  Great!

However, if I use vncviewer, I get XDM, but once I log in, the vncviewer exists.  The last message on the console is "ReadFromRFBServer: rdr::EndOfStream".  Something is messed here.  Someone else in this thread was having this problem but I don't think they ever fixed it.  Any thoughts?

(EDIT: Damn Xnest is sweet though.  You can run any geometry....I open a 1000x700 window to my server from my laptop, who's little screen runs at 1024x768...  :Very Happy: )

----------

## fdarling

 *lines wrote:*   

> 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)
> ...

 

Let me explain how VNC works... It has a remote X server that has all the clients (windows having visual output) running on it. It takes a picture when something changes on the screen, just a bitmap, compresses it with JPEG and sends it over to the client. Thus the client only needs to know how to uncompress and view a JPEG, it doesn't need to know anything else about the server.

However, there is another technology called XDMCP. Thats where the person connecting to the server is running the X server at their end, and then the applications with visual output and whatnot are running on the server, and they communicate over the network with your server.

The reason you would want that is because instead of just receiving JPEGs, you are receiving the actual pre-rendered instructions, and instead of all the windows on your screen being blobbed into one JPEG, they are seperate windows on your end. Thus dragging windows and stuff would seem faster. And also, since the whole point of OpenGL is to say "draw a polygon using this image and these coordinates" and have the hardware deal with it for speed, but it has to interface closely with the hardware to do this. XDMCP, since the clients are using *you're* X server, running on *you're* hardware, OpenGL will work. With VNC its running on *their* server without OpenGL support, since everything is rendering into JPEGs and not using the video card at all.

So why doesn't everyone use XDMCP? Because... You have to have a local X server running, and in windows its harder to do that. VNC is nicer for cross-platform stuff, and also its faster since it blobs all the windows into one image, then compresses it.

Sorry if this was a bit of a long post   :Wink:   I just wanted to let ya know the difference between the methods

----------

## befortin

I'm trying to get XFCE to work with VNC. VNC works very well, but after I login through XDM, I fall in the ugly twm.  Here's my ~/.vnc/xstartup file : 

```

startxfce4 &

```

Anyone has an idea??

----------

## Mord

If everyone follows the howto at the very beginning, how on earth are you getting a .vnc/xstartup file?!?

Or are people just trying to get Xvnc working without the rest of the junk dropping into this thread for help?

I for one could not get Xvnc working the way the howto suggests, even though individually my XDMCP and Xvnc standalone servers work perfectly.  So I just launch Xvnc servers manually when I need them via SSH.

One more problem I noticed just using Xnest in Gnome to connect to an XDMCP session:  If I switch to another virtual desktop in gnome, and back to the desktop that has my Xnest session, I lose all keyboard to the Xnest session and I have to restart it.  So for this reason, I'm just using Vnc client from both Windows and linux clients when connecting to my server, tunnelling through ssh when appropriate.

----------

## fdarling

 *befortin wrote:*   

> I'm trying to get XFCE to work with VNC. VNC works very well, but after I login through XDM, I fall in the ugly twm.  Here's my ~/.vnc/xstartup file : 
> 
> ```
> 
> startxfce4 &
> ...

 

....yeah. Edit your /etc/rc.conf and change

#XSESSION="Gnome"

to

XSESSION="XFCE-4"

that should fix it! =) That will make XDM use XFCE-4

----------

## tscolari

 *tscolari wrote:*   

>  *tscolari wrote:*   how can i fix this kind of problem:
> 
> vncviewer: VNC server closed connection
> 
> i tryed to run vncserver to see if it fixes it, but then i got that my display was sancho:1 (sancho is my hostname), shouldnt it be localhost:1? also connect to the hostname doesnt work... 

 

nobody knows what cause this?

----------

## befortin

I'm trying to configure xdm to set a background but it doesn't work. I've tried all I could, googled a lot and still I can't find how to get the background color as I would like it to be (black!)...

In my /etc/X11/xdm/Xsetup_0 file, I have the following : 

```

/usr/X11R6/bin/xsetroot -display 192.168.2.34:1.0 -solid black

```

ad my $DISPLAY=192.168.2.34:1.0 when I'm connected through VNC.

I've also tried to not use the -display option and to use it with the following values :

- :0.0

- :0.1

- :$DISPLAY

but the background is that ugly default xdm background!! I've done "/etc/init.d/xdm restart" each time I changed the config.

----------

## epx

Has anyone here who has had the "sudden close" after an xdm login resolved there issues yet? I am doing a recompile of X without ipv6, we-ll see what happens.

----------

## Mord

 *epx wrote:*   

> Has anyone here who has had the "sudden close" after an xdm login resolved there issues yet? I am doing a recompile of X without ipv6, we-ll see what happens.

 

That only fixed my inability to connect via vncclient at all.  I still had the "connect to xdm, log in, bye-bye" problem.  Are you launching vncclient from a command prompt?  Windows or linux.  On linux, vncclient will spit information out to stdout in the console window.  On Windows, vncclient writes to a log file somewhere, I think its accessible through the vncclient interface.  I'd have to double check that though.

----------

## zehnan1

I followed the steps in the tutorial, only I used vnc, since tightvnc segfaults here on amd64.  When I try to connect with vncviewer I get:

```

 CConnection: No password configured for VNC Auth

 main:        No password configured for VNC Auth

```

I've tried setting pass with vncpasswd, as root or as user... didn't make any difference.  If I start vncserver manually, I type in the password (previously set with vncpasswd) and it works well.  Any ideas how to solve this?

Thanks.

----------

## eagle_cz

Nice how to , but its probably too old or it isnt universal.

i had to change /etc/inetd.d/xvncserver

server_args = -fp unix/:-1 -inetd -query localhost -once -geometry 1280x1024 -depth 32

and also make sure, that you doesnt have /tmp/.0.... something related to Xvnc,

When Xvnc crash due to font problem, it will not run even when you fix xinetd.d, coz his lock file.

----------

## gungholady

 *eagle_cz wrote:*   

> Nice how to , but its probably too old or it isnt universal.
> 
> i had to change /etc/inetd.d/xvncserver
> 
> server_args = -fp unix/:-1 -inetd -query localhost -once -geometry 1280x1024 -depth 32
> ...

 

This didn't help with the "connect to xdm, log in, bye-bye" problem. Can't find any log files anywhere. From the terminal:

```
Connected to RFB server, using protocol version 3.7

Enabling TightVNC protocol extensions

No authentication needed

Desktop name "nobody's x11 desktop (gungholady:1)"

VNC server default format:

  32 bits per pixel.

  Least significant byte first in each pixel.

  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0

Using default colormap which is TrueColor.  Pixel format:

  32 bits per pixel.

  Least significant byte first in each pixel.

  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0

Using shared memory PutImage

Same machine: preferring raw encoding

vncviewer: VNC server closed connection

ShmCleanup called
```

Edit:

My user had export DISPLAY=:0.0 in his home .xinitrc file. I commented that line out and it is working again for me.

I tried realvnc and like someone else got the passwd authentication errors. Wish we could solve this soon.

----------

## Pret3ndeR

Hi everyone!

Congrats to lines, this HOW-TO rocks  :Smile:  I just got it running out-the-box with my GDM and Gnome desktop.

But now I have another machine (PII 350) only running XDM and Fluxbox, and I can't get it to work. I've read almost all pages and saw people with the same problem, but no solution.

And yes, I've tripled check my configs ... I don't know what to do  :Sad: 

If someone can help me, I appreciate  :Smile: 

----------

## flbiggs

Like zehnan1, I also use RealVNC instead of TightVNC because I have not been successful at getting TightVNC to work on the AMD64 kernel.  Anyway, I have been able to implement the method described in this HowTo just fine with RealVNC.  The only change I had to make was to add the following to the end of each "server_args" line in the /etc/xinetd.d/xvncserver file:  "-SecurityTypes None".  I am no expert, and the experts are welcome to correct me, but I think that this change is required because RealVnc defaults to requiring a password, even when login is "Nobody."  Hope this helps others!

----------

## Mord

 *Pret3ndeR wrote:*   

> But now I have another machine (PII 350) only running XDM and Fluxbox, and I can't get it to work. I've read almost all pages and saw people with the same problem, but no solution.

 

I posted further up this page about a problem like this.  I too was simply using XDM and Fluxbox and this turorial would not work.  So I recompiled X without ipv6 support (the xdm implementation of XDMCP must be bugged) and it fixed one of the problems.  I was then able to connect via vncclient and get the XDM logon screen.  But after that, as soon as I logged into XDM, the vncclient session would die.  I was never able to fix this problem.

Since then, I don't even start XDM anymore, and I just start vncservers for myself directly, and everything works just fine.  I do the bulk of my remote server administration via SSH anyway.  I don't ever really NEED a remote desktop.

----------

## nesl247

Any way to connect to the first running x session and when disconnecting it keeps the x session running.. Just like windows remote desktop connection?

----------

## Colddiver

First, great how-to!

My only problem is that I can't seem to be able to figure out how to start apps from the terminal, when logged as ROOT. I always get these errors:

Xlib: connection to "localhost:1.0" refused by server

Xlib: Client is not authorized to connect to server

I tried a few apps as a normal user and it worked fine. I only get these errors when I try to run an app as root. This is quite annoying since I need my VNC'ed box to burn CDs and DVDs using k3b (which needs to run as root). Other tools where not as reliable (especially with all the recent kernel trouble with CD/DVD burning).

Anybody has a clue?

Colddiver

----------

## gungholady

 *Colddiver wrote:*   

>  This is quite annoying since I need my VNC'ed box to burn CDs and DVDs using k3b (which needs to run as root). Other tools where not as reliable (especially with all the recent kernel trouble with CD/DVD burning).
> 
> Anybody has a clue?
> 
> Colddiver

 

I use k3b and do not have to run it as root. I just make sure that cdrecord is not set suid and that my user is a member of the cdrw group on my computer.

----------

## jhboricua

Just a though for those having problems connecting after following the instructions.

I was having connectivity issues with this.  Symptoms went from getting socket errors to no errors at all but no connection being made either.  In MY CASE, the problem seems to be that portage has the 1.3-alpha version of Tightvnc marked as stable, don't ask me why.  Masking THAT PACKAGE and then emerging tightvnc-1.2.9-r1 fixed my problem.  Now I get the login screen just fine and can work on my box remotely.

This was really killing me because I had it working before and didn't think about the package being upgrade during a update world emerge being the problem until now.  What really is confusing to me is why an alpha release of tightvnc-1.3 is marked stable in portage.

----------

## mahir

which is better?

tightVNC or Vino? (vino comes in gnome)

----------

## mholtz

I am frustrated because I had this working perfectly up until a few months ago.  I made the change to PAM, but I still get this every time I try to use Xvnc with xinetd:

```

$ vncviewer localhost:71

vncviewer: VNC server closed connection

$ 

```

The odd thing is that I can manually setup a Xvnc server from the command line and it works great.  Is there some bizarre thing I broke with xinetd?  How does Xvnc choose a display from X when run via xinetd?  Here is its output from the command line: 

```

$  /usr/bin/Xvnc ¥:1 -query localhost -once -geometry 800x600 -depth 16 -fp unix/:-1

07/03/05 22:24:50 Xvnc version TightVNC-1.3dev5

07/03/05 22:24:50 Copyright (C) 2000-2003 Constantin Kaplinsky

07/03/05 22:24:50 Copyright (C) 1999 AT&T Laboratories Cambridge

07/03/05 22:24:50 All Rights Reserved.

07/03/05 22:24:50 See http://www.tightvnc.com/ for information on TightVNC

07/03/05 22:24:50 Desktop name 'x11' (sakura:1)

07/03/05 22:24:50 Protocol versions supported: 3.7t, 3.7, 3.3

```

Here are few config files:

```

$ cat /etc/xinetd.conf

defaults

{

        #only_from      = localhost

        instances      = 60

        log_type       = SYSLOG authpriv info

        log_on_success = HOST PID

        log_on_failure = HOST

        cps            = 25 30

}

includedir /etc/xinetd.d

$

```

Here is the other relevant file:

```

$ cat /etc/xinetd.d/xvncserverservice 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 -fp unix/:-1

}

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 -fp unix/:-1

}

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 -fp unix/:-1

}

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 -fp unix/:-1

}

...[etc.]

$

```

Oh, and here is my log:

```

$ tail -30 /var/log/everything/currentMar  7 22:10:41 [xinetd] START: vnc-800x600x16 pid=12627 from=127.0.0.1

Mar  7 22:10:42 [xinetd] START: vnc-800x600x24 pid=12629 from=127.0.0.1

Mar  7 22:10:45 [xinetd] START: vnc-800x600x32 pid=12632 from=127.0.0.1

Mar  7 22:10:47 [xinetd] START: vnc-640x480x32 pid=12634 from=127.0.0.1

Mar  7 22:10:52 [xinetd] START: vnc-1024x768x24 pid=12638 from=127.0.0.1

Mar  7 22:10:53 [xinetd] START: vnc-800x600x24 pid=12640 from=127.0.0.1

```

...just a bunch of entries like that (once per vncviewer attempt) and nothing else.  How can I get Xvnc do give me some debugging info?  How do I tell xinetd to do the same?  How does Xvnc choose its display number?  Most importantly, how can I get this working?  Thanks!

----------

## mholtz

This is interesting:

```

$ telnet localhost:5971

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

Connection closed by foreign host.

$ 

```

Any time I try to connect to that port, the connection is immediately closed.  xinetd is letting me in, but Xvnc is kicking me out immediately.  Any ideas??

----------

## mouser

Hi! I'm italian and at first I want to ask the excuse for my horrible english  :Rolling Eyes: 

Anyone know some link for more information about GNU/Radius? I search an howto for my work!

I don't know if it is the wrong thread, but I've search the keyword "Radius" and in the result list this thread appear.

Thanks a lot to everyone!

Ciao

mouser  :Wink: 

----------

## socr0819

Not sure if I'm asking too much here, but this is what I would like to setup: 

1) Have the normal screen that you see if you were to walk up to the box and log-on (with the list of users to logon as).

2) If that's not possible, allowing the 'vncserver' service to start for a user (who is not root) and then be presented with that user's desktop. (I've tried this, but I still get the grey screen, even if my 'xstartup' file has 'startkde' in it.

----------

## ducklord

Awesome guide, but I've got a little problem...

With this procedure, somebody can login to new X-Sessions, right?

Well, can there be some combination, or something, where a user from a different pc (internal or external network) will be able to connect, at the same time, both in a new X-Session as well as the one running - maybe by use of different ports, or something?

That was the first question, and my main problem... The second one is a bit idiotic, and I... beg for your forgiveness!

I had followed this guide when it was first posted, before the "days of the Wiki". I needed, though, to be able to connect to the running X-session, wich couldn't be done with this procedure (or, at least, so I thought), so I followed some other guides I found on the net. Now, excuse me, but I don't have any serious experience in linux. I did some stuff, I added some programs and, behold, I was able to connect to my X-session, and still am.

Until some days ago, I had installed programs, added and changed stuff, but hadn't connected to my PC "from outside" for some time. Yesterday I tried connecting and couldn't. When I returned home, I met a requester that asked "If I granted access to the incoming connection" (or something along these lines).

So, now, I'm in a position where...

a. I don't know... (don't laugh)... how many different VNC flavours are in my PC

b. how to find out the above

c. how to configure them so that a) I'll be able to connect to my running session from someplace else without granting permition from my own pc (what's the use of that?  :Wink:  )

d. how to combine the above with your solution so as to be able for other users to connect to autonomous X-sessions.

Sorry for bothering you with these problems, if somebody knows anything, please, help. I had previously (when I first tried this stuff) read a-lot of threads, this one among them, regarding VNC, and none combined or acknowledged these two different ways of connecting to a pc. The worst was that each way mentioned cancelled the others, and being a newb and jumping from one to the next I got a bit lost...

Thanks in advance for any possible answers.

----------

## outspoken

 *Rosjahh wrote:*   

> Another good article on connecting to you vncserver (even when it's behind a router) from windows with ssh tunneling:
> 
> [url]http://

 

arg!!! what the hell.. there is a bunch of porn on that page!!!

EDIT:  Removed URL.   --pjp

----------

## outspoken

Here is a link on how to 'resume' your X session:

"connect to the running (and persisent) Gnome session from the lan on whatever machine I feel like."

----------

## andreas.bisiach

Hi,

has anybody solved the issue of allowing a user to logon remotely, start a bunch of program, disconnect from the session and later on reconnect upon successfully logon (with same userid) and find the same programs still running

I am looking for a multi user solution (pretty much like Windows Terminal Server)

I can see that it has been discussed in this thread but I cannot find a definitive answer.

(I know that sun has something call Sun Ray, but I guess it is not open and requires proprietary thin clients)

Thanks

/Andreas

----------

## andreas.bisiach

After a closer search I have found out that there is commercial product called NX Server  that does resume your session after upon reconnect. It is available on portage

There is also a free version called freenx also available on portage.

----------

## Fireklar

 *outspoken wrote:*   

>  *Rosjahh wrote:*   Another good article on connecting to you vncserver (even when it's behind a router) from windows with ssh tunneling:
> 
> http:// 
> 
> arg!!! what the hell.. there is a bunch of porn on that page!!!

 

Sweet!  Thanks for the tip.

However, if it's not porn you are looking for, the Internet Archive is often helpful.

----------

## brazilian_joe

My setup refuses to work. This shows up in my log:

```

Apr 28 12:19:57 [xinetd] Protocol tcp_ not in /etc/protocols [file=/etc/xinetd.d/xvncserver] [line=3]

Apr 28 12:19:57 [xinetd] Error parsing attribute protocol - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=3]

Apr 28 12:19:57 [xinetd] Bad socket type: stream_ [file=/etc/xinetd.d/xvncserver] [line=4]

Apr 28 12:19:57 [xinetd] Error parsing attribute socket_type - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=4]

Apr 28 12:19:57 [xinetd] Bad value for wait: no_ [file=/etc/xinetd.d/xvncserver] [line=5]

Apr 28 12:19:57 [xinetd] Error parsing attribute wait - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=5]

Apr 28 12:19:57 [xinetd] Unknown user: nobody_ [file=/etc/xinetd.d/xvncserver] [line=6]

Apr 28 12:19:57 [xinetd] Error parsing attribute user - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=6]

Apr 28 12:19:57 [xinetd] Server /usr/bin/Xvnc_ is not executable [file=/etc/xinetd.d/xvncserver] [line=7]

Apr 28 12:19:57 [xinetd] Error parsing attribute server - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=7]

Apr 28 12:19:57 [xinetd] Protocol tcp_ not in /etc/protocols [file=/etc/xinetd.d/xvncserver] [line=13]

Apr 28 12:19:57 [xinetd] Error parsing attribute protocol - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=13]

Apr 28 12:19:57 [xinetd] Bad socket type: stream_ [file=/etc/xinetd.d/xvncserver] [line=14]

Apr 28 12:19:57 [xinetd] Error parsing attribute socket_type - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=14]

Apr 28 12:19:57 [xinetd] Bad value for wait: no_ [file=/etc/xinetd.d/xvncserver] [line=15]

Apr 28 12:19:57 [xinetd] Error parsing attribute wait - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=15]

Apr 28 12:19:57 [xinetd] Unknown user: nobody_ [file=/etc/xinetd.d/xvncserver] [line=16]

Apr 28 12:19:57 [xinetd] Error parsing attribute user - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=16]

Apr 28 12:19:57 [xinetd] Server /usr/bin/Xvnc_ is not executable [file=/etc/xinetd.d/xvncserver] [line=17]

Apr 28 12:19:57 [xinetd] Error parsing attribute server - DISABLING SERVICE [file=/etc/xinetd.d/xvncserver] [line=17]

...

```

There is no underscore after the 'tcp' in xvncserver. What is going on?

----------

## cbolin

This guide works great, but I have one nit issue with it I can't stand.l  When I invoke vnc the default (ugly IMHO) default X grey background is displayed.

If I use this tip found here on the forums and the gentoo wiki, it removes the ugly black background for all local logins but not for those using vnc.  http://gentoo-wiki.com/TIP_Changing_Gray_Startup_Background

I know this can be done because in Fedora you see a black background (for a flash) and no grey background.

Any ideas?  Where is X being invoked when you login via VNC?

----------

## beuselinck

Thanks for this great guide!

(I'm using my laptop (running xdm and fluxbox) as a terminal and my desktop pc (running gdm and xfce4) as a server.)

I've managed to get the vnc server working. I can start the vncviewer on my laptop with the desired resolution, I get my desktop login screen (gdm) on my laptop and am able to login, starting a new xfce4 session.

But is there by any chance a way of doing the following:

When i boot up my laptop, I first get a local graphical login screen (xdm), when I login, I get my laptop fluxbox session. From there I start vncviewer etc...

I would like to combine these two steps: when my laptop starts X, I want the (gdm) login screen from my desktop immediately. This way I don't have to start a local X session (fluxbox), and my laptop is acting as a true terminal.

Anybody managed to do this and wants to share his experiences?

Any ideas?

Thanks in advance.

----------

## mholtz

Well, I figured out my problem with VNC -- the problem with vnc where the connection is inexplicably closed immediately after connection to a VNC port.  I have the setup outlined in this document, but after an xorg-x11 upgrade things broke.  

I first tried some manual patching of VNC so it would actually produce logs in a useful directory (found those here.).  This was due to the fact that Xvnc defaults to /usr/adm for its log directory -- a directory which is non-existant on a Gentoo machine.  This directory, incidentally, may be overridden at compile-time be changing the Makefile.   However, this was a wild goose chase.

To see if you have the problem, run 

```

$ Xvnc :1 -desktop 800x600 -depth 16

```

See if Xvnc complains about not being able to find fixed fonts and exits.  If that is the case, then the solution is below.

The problem, of course, is xorg fonts, and is due to the fact that the X font server is not used in the latest update of xorg-x11. 

Here is an example entry from my /etc/xinetd.d/xvncserver.  Notice the -fp unix/:-1 argument.  Looking through the vncserver script and the source code of Xvnc, I saw that you can actually set the fontpath on the command line, though this is undocumented in the man page.  I set mine to my X font server because it was simpler than passing the whole font path to it.

[code]

service vnc-800x600x32

{

          protocol = tcp

          socket_type = stream

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = -inetd -query localhost -once -geometry 1024x768 -depth 16 -fp unix/:-1

}

So, make sure you have font-server in your USE flags and re-merge xorg-x11.  That should take care of the problem.

----------

## djsmiley2k

i had the lovely grey screen problem, but managed to get rid of that by starting xdm (and adding it - rc-update add xdm default).

now i just have the problem of that im dropped into twm instead of evilwm. Any ideas? i think i've done all the confiig files, but there seems to be a lot to check?

Cheers in advance.

----------

## AnimeUnrivaled

Well, I've followed the steps exactly as indicated (did have to do a "locate kdmrc" to find its actual location), and I've read every single response in this thread. I've searched as much as possible across the internet only to find that I can't solve my prblem. No, I'm not having the grey screen problem. I'm not that lucky. Each time I do attempt to connect via vncviewer, I get:

```
vncviewer: VNC server closed connection 
```

That's all.

xinetd is loaded correctly, the ports are being listened on correctly, and I can't figure out what's wrong. If I start a vncserver manually as a user, I can connect to it no problem. This message reminds me of an error that I will rarely come up against while running a RealVNC server on Windows XP. Occasionally the server will still be running but will simply "close" the connection immediately upon connecting from elsewhere. A quick restart of the Windows system fixes the problem. It seems to occur at random, but only if I've been connected several times during the current boot (It never happens the first or second time I connect after a reboot). I don't care about fixing the Windows thing, but I wanted to put that out there for reference.

So, the problem is that Xvnc seems to be running, but it is closing connections immediately (ie, never actually letting me do anything at all).

Any help would be appreciated.

----------

## Costanza

I wrote this:

 *Quote:*   

> Any ideas what might cause this:
> 
> ```
> htpc@HTPC htpc $ vncviewer localhost:71
> 
> ...

 

My problem is now solved. It had noting to do with the configuration or anything. The problem was that my xinetd and vnc packages was compiled with -march=pentium4, when -march=pentium3 is the correct for my computer. I think vnc simply didn't work correctly. (I've had illegal instruction errors from various applications)

/OlofLast edited by Costanza on Sat Jun 25, 2005 2:01 pm; edited 1 time in total

----------

## mahir

i think its called a persistant connection

when i close the connection

and re-connect

i want to continue where i left off

like screen but with a gui  :Smile: 

how would i do that?  :Very Happy: 

----------

## Costanza

Got this working now, and it works perfectly, but now I have another newbie question.

The next step for my HTPC (the Gentoo machine) is connecting it to my TV via a VGA->Euroscart connection. For that connection to work, I need to modify modelines to match my TV. The question is, will this effect my possibilitys to have this VNC connection exactly the way I have it now?

I want the computer to be physically connected to my TV for normal HTPC use, but I also want to be able to do upgrades and tuning and so on using VNC.

I havent tried anything yet, so maybe it works the way I want already?

/Olof

----------

## LimeFrog

I got this working without a fuzz, i can login into a gnome session perfetctly. But once inside the Gnome session my keyboard mapping goes crazy and not a single key turns out as it should, for example i press "Q" on the keyboard and i get "C" in Gnome.

Anyone experienced this before?

----------

## mahir

can SOMEBODY help me

with this persistant connectino thing!

somebody told me to try freenx, cos it supports it

but the problem is

i'm going to have to install the client on machines

and I AM NOT ALLOWED TO INSTALL ANYTHING ON THE MACHINES

apart from the server (dont ask, 2 sister companies, 1 wanker of a boss) anyway...

so i need to have accesss to a SCREEN via the JAVA class/jar thing u get on the windows version.

how do i doooooooo that?

and 2ndly,

i neeeeed to make the connections persissssssstanttttttt!

help me plzzzz

----------

## mholtz

 *mahir wrote:*   

> can SOMEBODY help me
> 
> with this persistant connectino thing!
> 
> somebody told me to try freenx, cos it supports it
> ...

 

Login to the machine remotely.  Run vncserver.  Look at the screen number you get assigned.  Connect to that screen number on the remote host.  For example, if you are assigned :2, connect to remotecomputer:2.  If you are running over ssh, then you might want to specify the display number on the command line of vncserver.

----------

## mahir

ok. this sounds cool.

but with the xvnx terminal server thing

the vnc kicks in and then i log on using xdm

will i get the same thing??

----------

## mattjgalloway

NICE tutorial! Great stuff!

Has anyone managed to get the java bit working yet? Would be cool to be able to open a browser and login to my system from any pc without having to install software on that pc!

----------

## Thunrida

Hi.

I have a funny problem. I have 2 gentoo boxes configured by this instructions, and with kubuntu laptop I am able to access them with ssh tuneling. However, I cannot go from either box to another one. I tried adding hosts allow, shutting down iptables, but it did not help.

Error I get is below. I have ssh connection established before trying to connect to localhost

( ~ $ ssh -C -L 5901:localhost:5971 192.168.0.55)

 ~ $ vncviewer localhost:5901

vncviewer: ConnectToTcpAddr: connect: Connection refused

Unable to connect to VNC server

----------

## newtonian

 *AnimeUnrivaled wrote:*   

> Well, I've followed the steps exactly as indicated (did have to do a "locate kdmrc" to find its actual location), and I've read every single response in this thread. I've searched as much as possible across the internet only to find that I can't solve my prblem. No, I'm not having the grey screen problem. I'm not that lucky. Each time I do attempt to connect via vncviewer, I get:
> 
> ```
> vncviewer: VNC server closed connection 
> ```
> ...

 

I had the same problem after going through this howto.

To fix it I did:

```

tail -f /var/log/everything/current

```

in my logs there was an error about the format of my hosts.allow file

After I fixed my hosts.allow file I stopped getting the error you're getting.

This may or may not be the problem, but it's worth a look.

Cheers,

----------

## XtAzY

arg... ok i did all those steps correctly just to setup this

but when i type "vncviewer localhost:73" it just gave me:

```
Error: Can't open display:
```

help plz... thanks!!!

----------

## newtonian

Hi-

I followed this tutorial and got everything to work fine.

The users that use the vnc terminal system primarily use eclipse.

There is a bug in vnc versions before 4.0-5 that causes the vncserver 

to crash when used with eclipse.  Details at :

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=127134

Any tips on how to install VNC server 4.1.1?

Is it just a matter of umerging vnc, downloading the source from realvnc and running the install script?

Do you think the RealVNC 4.0-r1 ebuild is newer than 4.0-5?

Cheers,Last edited by newtonian on Fri Aug 12, 2005 2:42 pm; edited 1 time in total

----------

## newtonian

 *newtonian wrote:*   

> Hi-
> 
> I followed this tutorial and got everything to work fine.
> 
> The users that use the vnc terminal system primarily use eclipse.
> ...

 

I verified this bug on :

*  net-misc/vnc

      Latest version available: 3.3.7

and 

*  net-misc/tightvnc

      Latest version available: 1.3_alpha5

Then I tried:

net-misc/xf4vnc

      Latest version available: 4.3.0.104

      Latest version installed: 4.3.0.104

and NO MORE bug   :Very Happy: 

Hope this helps anyone trying to run Eclipse over vnc.

BTW xf4vnc works fine for me with this terminal server setup.

Cheers,

David

----------

## maneesh

I figured out how to get a persistent connection working with KDE or any other window manager! Try this (worked for me)

1) make sure "vncserver" is installed on your gentoo box.

2) with the user you want to log on with, edit the file  ~/.vnc/xstartup

3) change the last line so that your document looks like this:

```
#!/bin/sh

xrdb $HOME/.Xresources

xsetroot -solid grey

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

startkde &

```

 (Note: if you want to use gnome or enlightenment or anything, change the line "startkde &"

4) in a shell, run vncserver

5) check the output, which will say something like this

```

New 'X' desktop is linux:2

```

 (linux will be the hostname of your computer)

6) wait about 30 seconds (kde will be booting up) and run 

```
vncserver localhost:2
```

The number "2" will be the number given by output from step 5.

7) Enter your password determined by ~/.vnc/passwd

8)Enjoy! You can log in from external locations by using "hostname:2"

Let me know if it works!

-Maneesh

----------

## Uwe

I also tried the how-to, with a fresh installes xorg-x11 and gnome/gdm environment. I'm encountering the same issues as many others here... the vncserver process stops immediately after getting started. I can manually start Xvnc anc connect to my X-server, but when i run Xvnc with the -inetd parameter, it just wont start a process at all... It ios not a problem with font-server neither with hosts-allow... march is pentium3 (on a pentium 3  processor  :Wink: ). Anybody got a clue?

----------

## phsdv

I could not get it working. I followed the howto at http://gentoo-wiki.com/HOWTO_Xvnc_terminal_server. But finnaly I found that when I removed 

```
securitytypes=none
```

 in the file /etc/xinetd.d/xvncserver every thing works great!

Should this securitytypes=none be removed from the wiki or is there something else I should do to get it working with this option? I have thighvnc 1.3_alpha5 and using only xdm (not gdm nor kde).Last edited by phsdv on Sun Aug 21, 2005 2:43 pm; edited 1 time in total

----------

## Uwe

That did the trick, thank you very much!!!

----------

## newtonian

Hi-

I want to get a vnc terminal server working with vncserver 4.0.5 or better.

I've got about 5 users using my vnc terminal server that I set up with this tutorial.

Originally, I used tightvnc 1.3 alpha5 but that crashed when we used Eclipse.  

There is a known bug when you select incorrect code in Eclipse(red wiggly line).  

The realvnc vncserver in portage has the same problem.  

I tried xf4vnc server in portage.  xf4vnc doesn't crash Eclipse but it gives the same

key codes for semi-colon and colon with a Japanese 106 keyboard.  Parenthesis and

brackets also have key codes that overlap with other keys, so it's not anything I can

fix with xmodemap.

I asked the users if they would rather have the stability of xf4vnc with

US keyboard mappings or the instability of pre 4.0 vncserver with Japanese key mappings.  

They all chose the unstable(with Eclipse) vncserver 3.X series vncserver because they didn't

want to give up their Japanese keyboards.  Now my users

are crashing an average of every 30 minutes.  The crashing introduces a whole new slew

of problems with locks, unsaved files and runaway processes.

I'd like to give realvnc server version 4.0.5 or newer a try or even something comparable

with tightvnc.  Is there an ebuild out there?  I've seen some people in the forum post about

the vncserver 4.0.X ebuild, but I haven't found it on bugzilla.  I also read that the ebuild

had been pulled.  I tried downloading the 4.X vncserver binary from realvnc but my clients

couldn't connect.  Anyone have any advice on where I can find the vncserver 4.X ebuild?  

Has anyone had any success getting 4.X to work with the terminal server?

Cheers,Last edited by newtonian on Tue Aug 23, 2005 12:39 pm; edited 1 time in total

----------

## branana

I'm having problems getting vnc server running at all, on amd64

is this /usr/bin/Xvnc beast supposed to be symbolic link to something funny?

Mine says

fragbot bran # vncviewer localhost:71

Not a valid VNC server

----------

## newtonian

 *newtonian wrote:*   

> Hi-
> 
> I want to get a vnc terminal server working with vncserver 4.0.5 or better.
> 
> Cheers,

 

Ok, I figured out how to get vnc-4.0-r1.ebuild working with this howto.

vim /etc/make.conf

Add the word server to the USE="xxx" line.  AKA USE variables.   :Wink: 

I did locate vnc | grep ebuild to find the latest vnc ebuild on my system which was vnc-4.0-r1.

```

mammoth david # locate vnc | grep ebuild

/usr/portage/app-vim/svncommand/svncommand-0.2.ebuild

/usr/portage/app-vim/svncommand/svncommand-1.67.3.ebuild

/usr/portage/net-libs/libvncserver/libvncserver-0.7.ebuild

/usr/portage/net-libs/libvncserver/libvncserver-0.7.1.ebuild

/usr/portage/net-misc/directvnc/directvnc-0.7.5.ebuild

/usr/portage/net-misc/tightvnc/tightvnc-1.3_alpha5.ebuild

/usr/portage/net-misc/tightvnc/tightvnc-1.2.8.ebuild

/usr/portage/net-misc/tightvnc/tightvnc-1.2.9-r1.ebuild

/usr/portage/net-misc/tightvnc/tightvnc-1.3_alpha7.ebuild

/usr/portage/net-misc/vnc/vnc-3.3.7.ebuild

/usr/portage/net-misc/vnc/vnc-4.0.ebuild

/usr/portage/net-misc/vnc/vnc-4.0-r1.ebuild

/usr/portage/net-misc/vncrec/vncrec-0.2.ebuild

/usr/portage/net-misc/vncsnapshot/vncsnapshot-1.1.ebuild

/usr/portage/net-misc/vncsnapshot/vncsnapshot-1.2a.ebuild

/usr/portage/net-misc/xf4vnc/xf4vnc-4.3.0.103.ebuild

/usr/portage/net-misc/xf4vnc/xf4vnc-4.3.0.104.ebuild

/usr/portage/x11-misc/vnc2swf/vnc2swf-0.3.ebuild

/usr/portage/x11-misc/vnc2swf/vnc2swf-0.4.2-r1.ebuild

/usr/portage/x11-misc/x2vnc/x2vnc-1.6.1.ebuild

/usr/portage/x11-misc/x11vnc/x11vnc-0.7.2.ebuild

/usr/portage/x11-misc/x11vnc/x11vnc-0.7.1-r1.ebuild

/usr/portage/x11-misc/x11vnc/x11vnc-0.7-r1.ebuild

/var/db/pkg/net-misc/vnc-3.3.7/vnc-3.3.7.ebuild

```

get rid of the current vnc if you are using it.

```

emerge unmerge vnc

```

next cd to the ebuild directory and and emerge the ebuild:

```

cd /usr/portage/net-misc/vnc/

emerge vnc-4.0-r1.ebuild

```

It might take a while to compile.

After it's done compiling, you need to fix your  /etc/xinetd.d/xvncserver (add -SecurityTypes None) to the server_args line.  

```

service vnc-640x480x8

{

protocol = tcp

socket_type = stream

wait = no

user = nobody

server = /usr/bin/Xvnc

server_args = -inetd -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None  -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -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 -SecurityTypes None   -query localhost -once -geometry 1600x1200 -depth 32

}

```

Then reboot.  It worked for me on my x86 machine.

Cheers,

----------

## newtonian

Hi-

I tested the vnc-4.0-r1.ebuild to see if it crashes with Eclipse like version vnc 3 does.

vnc-4.0-r1.ebuild failed the Eclipse bug test and crashed like version 3.  

In contrast to xf4vnc(which doesn't contain the Eclipse bug), the keyboard mappings work 

fine with Japanese 106 keyboards.

Anybody have any luck with getting vnc 4.1 running?

Cheers,

----------

## PraetorZero

 *phsdv wrote:*   

> I could not get it working. I followed the howto at http://gentoo-wiki.com/HOWTO_Xvnc_terminal_server. But finnaly I found that when I removed 
> 
> ```
> securitytypes=none
> ```
> ...

 

Y'know, I removed that line and was finally able to connect to the box, but now I can't logout of the session normally.  I have to close the VNC window or force-quit X when I'm logged on normally.

----------

## mog

Is there a terminal service alternative to VNC and X11 over SSH on linux? I have setup tightvnc TS as per instructions in this guide, but unfortunately, the performance is not ... lets say ... astonishing  :Sad: . So, I was wondering if there is any alternative that comes closer to Microsoft's RDP performance wise?

----------

## philidias

 *Uwe wrote:*   

> I also tried the how-to, with a fresh installes xorg-x11 and gnome/gdm environment. I'm encountering the same issues as many others here... the vncserver process stops immediately after getting started. I can manually start Xvnc anc connect to my X-server, but when i run Xvnc with the -inetd parameter, it just wont start a process at all... It ios not a problem with font-server neither with hosts-allow... march is pentium3 (on a pentium 3  processor ). Anybody got a clue?

 

thanks, its working

----------

## hokie99cpe

I followed the tutorial and got it sorta working when I removed the securitytypes flag from /etc/xinet.d/xvncserver. Now, when I connect, I get KDM. When I login, the connection dies off with this error message showing up in /var/log/messages:

```
Sep  3 16:03:34 localhost kdm: localhost:2[6783]: Cannot execute startup script "/usr/kde/3.4/share/config/kdm/Xstartup"
```

Xstartup has just this line for my wheelmouse:

```
exec /usr/bin/xmodmap -e "pointer = 1 2 3 6 5 4"
```

I commented out that line and was able to connect via VNC. Anyone have a clean method around this, or will I need to write some logic to detect VNC vs console?

--------------------------------------

I fixed this shortly after posting. I just compared the environment variables when using VNC versus via the console... on the console, DISPLAY = :0. A quick if then fi and I was in business.

Now that that's taken care of, is it possible to use this framework to connect to the console session independent of the user logged on? Or will that user need to enable Xvnc when they login?

-dan

----------

## micah_death

Is this supposed to allow you to connect, disconnect and reconnect to the same session? Mine initializes a new instance and I'd lilke to connect to my previous instance... (so I can leave stuff open and come back to it at a later date/time)

Right now it closes everything and cleans up =(  

(I am the only user of this PC too if that helps)

----------

## lassic

I was also able to get this working only after I removed the following:

securitytypes=none

from /etc/xinetd.d/xvncserver 

Should I be concerned about this?

----------

## forbjok

I've tried to get this working. When I log in using vncviewer from another computer, I just get the so-called grey screen and the X cursor, and no login window, or anything else for that matter. It also seems to disconnect automatically after a while (I haven't timed it, but I'm guessing a few minutes)

I've checked the configs several times, and had to add "-SecurityTypes None" in order to even be able to log in using VNC.

This is running on a server, which isn't really supposed to run X on the local console at all, but it did seem to work before I disabled it. (displayed the login window)

I noticed that many others have posted about similar issues, and some have gotten it working, but I can't seem to find any solution to this. I also noticed that this tutorial is rather old, so maybe there is something more that needs to be done for it to work on an updated system?

Anyone have any ideas what could cause this problem?

Thanks in advance.

EDIT:

After doing some more testing on this, I have found that everything seems to be configured correctly, but for some reason, XDMCP is using an incorrect IP address. (don't ask me why, or what for)

When running

```
X -query localhost
```

locally on the server, I got the exact same thing: A useless X session with no login box. Then after a few minutes of idleing, it drops out with the error message:

```
XDMCP fatal error: Session failed Session 207248002 failed for display 192.168.1.1:0: Cannot open display
```

Upon seeing that, I was thinking "192.168.1.1? where the h* is it getting that from"... so I check ifconfig, and indeed that IP has been set on eth2.

Well, eth2 isn't used for anything, so I disable the interface and try to connect again, and BEHOLD... the login box reveals itself.

Then I re-enable eth2, and it immediately goes back to not working.

So, the question is, where on earth is XDMCP getting that IP address from?  :Confused: 

That interface isn't even used for anything at the moment, and neither is the 192.168.1.1 address - and it most certainly isn't specified anywhere in the XDM configuration. (yes, i tried "grep -r" for it in /etc/xdm)

Does anyone know the reason for this, and/or a way to avoid this problem? (it really should only be using 127.0.0.1, if it needs to use an IP address at all)

At the moment, simply disabling the eth2 interface isn't a problem, but it might be if some day I need to use it for anything...

----------

## linuxgeek

Anyone seen a difference with KDE 3.4.2-r1 and 3.4.3-r1 and Xvnc via Xinetd not working.?

I following with Wiki for Howto Xvnc Terminal server.. on 2 servers.. One works just fine {3.4.2-r1} and

the other does not {3.4.3-r1}

Is there some other security added with

I have tried both settings with and without securitytypes=none

I cannot connect at all.. I can run vncserver and connect to the one it creates remotely.

$ vncviewer serverA:50

Connected to RFB server, using protocol version 3.7

No authentication needed

vncviewer: read: Connection reset by peer

Any ideas?

----------

## linuxgeek

Nvm I found it...

I had 192.168.25.* for Xaccess changed this * and it worked.

Did a find for Xaccess and found 2 files. I modified both.

----------

## valkyrite

Thanks for the excellent guide.

I tried everything.

I edited the kdmrc file in /usr/kde/3.4/share/config/kdm/kdmrc. Here is the relevant portion

 *Quote:*   

> 
> 
> [Xdmcp]
> 
> # Whether KDM should listen to incoming XDMCP requests.
> ...

 

Here is the output of nmap

 *Quote:*   

> 
> 
> Starting nmap 3.83.DC13 ( http://www.insecure.org/nmap/ ) at 2005-12-23 19:49 EST
> 
> Interesting ports on localhost (127.0.0.1):
> ...

 

When I try vncviewer localhost:71

Here is what I get

 *Quote:*   

> 
> 
> vncviewer: ConnectToTcpAddr: connect: Connection refused
> 
> Unable to connect to VNC server
> ...

 

I am guessing the server has not yet started. Here is the output of rc-status

 *Quote:*   

> 
> 
> Runlevel: default
> 
>  xdm                                                                                                                                             [ started ]
> ...

 

Any idea what may be wrong. I am using kdm

What should I do?

----------

## valkyrite

OK figured out the problem:

In the file /etc/xinetd.d/xvncserver,

I had to change the following to as follows:

Instead of 

 *Quote:*   

> 
> 
> server = /usr/bin/Xvnc
> 
> 

 

change to

 *Quote:*   

> 
> 
> server = /usr/bin/vncserver
> 
> 

 

I did not had any Xvnc in /usr/bin or elewhere.

Thanks all of you for an excellent guide.

----------

## snizfast

Chances are you are using something other than the tightvnc that the author indicates.  I have /usr/bin/Xvnc on my system.  The VNC packages are almost drop in replacements for another but they all seem to have their quarks.

----------

## valkyrite

I do not know the cause of the problem but I am using tightvnc

 *Quote:*   

> 
> 
> Searching...
> 
> [ Results for search key : tightvnc ]
> ...

 

I do not have anything by the name Xvnc, but I do have vncserver.

I do not know the reason for it, but now XDMCP works so I am happy.   :Smile: 

----------

## valkyrite

Is it possible to operate the machine directly from a browser?

Tightvnc supports it if a session is started.

I want it via XDMCP so that if I write the url with a particular port, it starts a session for me which I can operate from the browser.

Any pointers would be helpful.

----------

## SpikeXtrem

hi!

I haven't gone trough all the 15 pages, but I read a couple. When I connect to my server, it opens a basing windows like the first time you connect locally on your pc using startx. I need to know how to connect to gnome using this remote desktop.

thx!

----------

## valkyrite

Do you have gnome in /etc/rc.conf.

What is the value of environment variable XSESSION

----------

## SpikeXtrem

```

# /etc/rc.conf: Global startup script configuration settings

# UNICODE specifies whether you want to have UNICODE support in the console.

# If you set to yes, please make sure to set a UNICODE aware CONSOLEFONT and

# KEYMAP in the /etc/conf.d/consolefont and /etc/conf.d/keymaps config files.

UNICODE="no"

# Set EDITOR to your preferred editor.

# You may use something other than what is listed here.

EDITOR="/bin/nano"

#EDITOR="/usr/bin/vim"

#EDITOR="/usr/bin/emacs"

# What display manager do you use ?  [ xdm | gdm | kdm | entrance ]

DISPLAYMANAGER="gdm"

# 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 are smart enough to

# look in all bin directories if it cant find a match in /etc/X11/Sessions/,

# so setting it to "enlightenment" 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 ~/.xsession exists, 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="Gnome"

```

I guess I have to uncomment the XSESSION line... I'll try it. But anyone can tell me if it is possible to start a remote session if gnome is'nt started on the local server? Like on the server you would see only the basic command line interface without gnome or kde started, but the remote would enter gnome  when they connect vnc?

And I would like a confirmation that the session that is opened trough VNC remains active when you disconnect the server and come back later.

And the vncserver is not active until I type vncserver on the server via ssh.... which is not what I want! How can the vnc server start when the computer boots? 

Thank you for answering my questions!

----------

## SpikeXtrem

I tried to reboot and see. I still have the same xterm session or whatever it's called.  :Sad: 

----------

## MasterOfTheHat

Awesome job! I've used this on several builds and never had an issue!

Now to try and get e17 to work...

----------

## rush_ad

i got this 'how t0' to work but when i connect my server computer from a client computer, i get to the login windows. when i try to login with the same user who is already logged in, i cannot run applications and my icons and looks are screwed up.

is there any way to make it so that when the same user logs in from a client computer, it first log off the previous session. i mean something like windows remote desktop where server computer logs out and then client computer logs in.

----------

## fangorn

Hi

Nice howto!

But I have a problem getting connected.

I followed the tip to the comma, but when connecting I get the following error

```

vncviewer: ConnectToTcpAddr: connect: Connection refused

Unable to connect to VNC server

```

I disabled the firewall, added xinetd to /etc/hosts.allow. To no avail. 

Do I have to add all the vnc-servers to /etc/hosts.allow too?

Thanks in advance

fangorn

----------

## squid

How can i make my sessions be resumable? I have already setup the remote manage with tightvnc but when i log out and save the session the programms already running are not available on the next login  :Sad: 

Can anybody help me?

Thanks a lot m8's

 :Rolling Eyes: 

----------

## electrofreak

I would like to know how to keep my session going, keeping my programs and such all running when I disconnect.

Basically...my server is at my brother's place... and he some times uses it locally (has it on his KVM switch). I figured out long ago how to login remotely and use it for my self. But then... I'm left logged in for him to use. So... I want to know how I can keep a session running for me that he can't see.

----------

## Nitro_146

Hi, I followed the tutorial, but when I launch vncviewer localhost:71 I have :

```
VNC server supports protocol version 3.3 (viewer 3.3)

No authentication needed

vncviewer: read: Connection reset by peer
```

Where to look at ?

----------

## MHenry676

Based off a post (can't remember but it was on page 15) I tried this in the /etc/xinetd.d/xvncserver

```

server_args = -inetd -SecurityTypes None  -query localhost -once -geometry 1152x864 -depth 24

```

and it worked!

This is using RealVNC (emerge vnc)

The difference from the HOWTO:

no :00 (or :##) and -SecurityTypes None instead of -SecurityTypes=None

Also, I only have one instance of the server in xvncserver and at 24 depth. I just use the options in the viewer (Windows ver) to select the color depth.

Not sure why, but it works. Otherwise, RealVNC veiwer just kept saying Connection Reset

Now how can I reconnect to a previous session?

Would using tightvnc give better performance over RealVNC when it comes to higher colors?

Anyone know why this works?

----------

## electrofreak

I found how to do resumable sessions... and it works. Just make sure you don't use tightvnc for the server... actually 'emerge vnc' with USE="server" After that... the basic configuration listed below will all you to resume a session. (But it seems only have 1 session going at a time. But running on more ports could easily take care of that, I guess.)

/etc/xinetd.d/xvncserver:

```
service vnc-1024x768x16 

{ 

          protocol = tcp 

          disable = no

          type = UNLISTED

          socket_type = stream 

          wait = yes

          user = root

          server = /usr/bin/Xvnc 

          server_args = -inetd :1 -query localhost -once -geometry 1024x768 -depth 16 -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

          port = 5900

}
```

Also... just create a vncpassword file like this:

```
vncpasswd /root/.vncpasswd
```

...The basic idea is there. I just now got it working (and I only need 1 session at a time), so further expansion of this concept could easily be desired.

----------

## MHenry676

Ok, that didn't work for me.

This did:

```

service vnc-1024x768x24

{

         protocol = tcp

         disable = no

#        type = UNLISTED

         socket_type = stream

         wait = yes

         user = root

         server = /usr/bin/Xvnc

         server_args = -inetd -query localhost -once -geometry 1024x768 -depth 24 -DisconnectClients

=0 -NeverShared passwordFile=/root/.vncpasswd

#         server_args = :00 -inetd -query localhost -once -geometry 1152x864 -depth 24

#         server_args = -inetd -SecurityTypes None -query localhost -once -geometry 1024x768 -depth

24 -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

#        port=5900

}

```

I uncommented the lines that didn't work for me. And having either type = UNLISTED and port=5900 did not work. I could understand why the port line didn't work, because...

```

#

#       VNC Servers

#

vnc-1024x768x24 5900/tcp

```

from /etc/services probably opens the port and then this entry in /etc/xinetd.d/xvncserver tries to use it. (Haven't looked at the logs yet)

What's type = UNLISTED do?

I can work with this, but I really want what Remote Desktop does in WinXP. I want to be able to connect to already running sessions, or start a new one. When I get to the console, I'd like to connect to the session I remoted into. Is this possible? At least to connect to at the console into a session previously opened remotely.

Also, what about connecting through a web browser on port 5800?

----------

## baaann

 *Quote:*   

> I can work with this, but I really want what Remote Desktop does in WinXP. I want to be able to connect to already running sessions, or start a new one. When I get to the console, I'd like to connect to the session I remoted into. Is this possible? At least to connect to at the console into a session previously opened remotely. 

 

Have you tried FreeNX

https://forums.gentoo.org/viewtopic-t-214455-start-475.html

Brief howto at

https://bugs.gentoo.org/attachment.cgi?id=84778

Commercial site

http://www.nomachine.com

Its work in progress, but suspends / resumes sessions, programs continue to run while the session is suspended and it  will resume after losing connection. Also supports smb mounting of  remote share's(i have found this inconsistant, but useful when it works). Remote printing is also possible via smb, but I haven't got that to work yet. Its integrated with ssh plus the option of using ssl. You can have a number of independant sessions/users connected at once and it is quick

----------

## Kelvie

If you would like to keep the vnc server running, log in via SSH and run the `vncserver' script that was provided by tightvnc.

You may have to tweak with the fontpaths or colorpaths, though, I modified these two lines inside it:

```
kelvie@crunchy ~ $ egrep '(fontPath =|colorPath =)'  ~/bin/vncserver

$fontPath = "/usr/share/fonts/misc,/usr/share/fonts/75dpi,/usr/share/fonts/100dpi";

$colorPath = "/usr/share/X11/rgb";

```

It might be a good idea to copy the vncserver script to somewhere (like I did, to $HOME/bin) so that updates won't overwrite it.

Then run as follows:

```
kelvie@crunchy ~ $ vncserver

Warning: crunchy:2 is taken because of /tmp/.X2-lock

Remove this file if there is no X server crunchy:2

Warning: crunchy:3 is taken because of /tmp/.X3-lock

Remove this file if there is no X server crunchy:3

New 'X' desktop is crunchy:4

Starting applications specified in /home/kelvie/.vnc/xstartup

Log file is /home/kelvie/.vnc/crunchy:4.log

```

You can exit from the ssh session if you like, and connect with the following command:

```
kelvie@valour ~ $ vncviewer crunchy:4

```

Where you'd use your server and display number displayed above, or similarly with whatever vnc client you'd like.

When you need to terminate, do this:

```
kelvie@crunchy ~ $ vncserver -kill :4

Killing Xvnc process ID 20366

```

and all is well.

--

Kelvie

----------

## MHenry676

Well, in the end, this works well for me:

This is using RealVNC (USE="server" emerge -av vnc)

/etc/xinetd.d/xvncserver

```

service vnc-1024x768x24

{

         protocol = tcp

         disable = no

         socket_type = stream

         wait = yes

         user = root

         server = /usr/bin/Xvnc

         server_args = -inetd -query localhost -once -geometry 1024x768 -depth 24 -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

}

```

/etc/services

```

...

#

#       VNC Servers

#

vnc-1024x768x24 5900/tcp

...

```

and then using...

```
vncpasswd /root/.vncpasswd
```

to create the vnc password.

If you need to start something that you want to connect into later, start a new vnc localy 

```

vncviewer localhost

```

Just exit out, don't log off cause that will kill the session. Remote in to find your processess still running. When you get back to local, simply vncviewer localhost finish up, then log out of it. 

Closest I can come to what I want to do. I did get nxserver-freenx running and it is sweet. Read the wiki's HOWTO, but the link to the forum is what got me running good. And I do like the layer of security. Only problem is that there is no resuming of sessions whatsoever. Use it for doing simple things, like checking email. Ofcourse, the commercial version of the nxserver at www.nomachine.com I think does do resuming if you wanta pay. I might.

----------

## baaann

 *Quote:*   

> 
> 
> Closest I can come to what I want to do. I did get nxserver-freenx running and it is sweet. Read the wiki's HOWTO, but the link to the forum is what got me running good. And I do like the layer of security. Only problem is that there is no resuming of sessions whatsoever. Use it for doing simple things, like checking email. Ofcourse, the commercial version of the nxserver at www.nomachine.com I think does do resuming if you wanta pay. I might.
> 
> 

 

Hmm, nxserver-freenx resumes sessions consistantly for me  :Confused:  , I can resume from different machines and locations, applications continue to run between suspended/resumed sessions. Are you using the overlay and instructions listed here?

https://bugs.gentoo.org/attachment.cgi?id=84778

The only issues I currently have, are that the samba shares to the remote machine, work inconsistantly.

Barrie

----------

## MHenry676

Hmm, well this mentions nxserver-freenx 1.5 and I'm running 0.2.8. BIG DIFFERERENCE I would say. The HOWTOs I followed I guess are a little old or inaccurate as there is no mention of using the ~x86 flag. 

So what does the use of multiple overlays and the subversion package do?

----------

## electrofreak

Yeah... I tried nxserver and it wouldn't resume sessions... but they were still running. I had to always create a new session... so I went back to just using vnc.

I guess I don't know what version I had... I may investigate it again soon.

----------

## baaann

 *MHenry676 wrote:*   

> Hmm, well this mentions nxserver-freenx 1.5 and I'm running 0.2.8. BIG DIFFERERENCE I would say. The HOWTOs I followed I guess are a little old or inaccurate as there is no mention of using the ~x86 flag. 
> 
> So what does the use of multiple overlays and the subversion package do?

 

Sorry, assumed you followed links I posted earlier  :Rolling Eyes: 

There is a thread on the forum

https://forums.gentoo.org/viewtopic-t-214455-start-475.html

As the subversion suggests it is actively being revised, but I have found it very stable and when there has been a problem on svn update, StifflerStealth who maintains the ebuilds answers quickly. It really is very good! As to why there are multiple overlays, I am not certain, but I am sure a post on the freeNX thread will provide the answer

----------

## MHenry676

Well, I tried nxserver, and I love it. Though vnc is nice when you can't install the nxclient on the pc you are at. But it does work great and resumes, if you follow the 'bugs' link he posted, it mentions using the subversion and overlay. One thing is, that it is not reuseable at a different location. But I've even played dvix encoded videos with lan connection, though above a 1.5 diagonal does get screwy. I must mention that this video/nxserver was coming from a P3 500 on a 100mbit lan and sound was still on the server, not client machine.

One thing I don't understand is why my VNC, which hasn't changed configuration and was working when I initially tried nxserver using the portage, does not work after I've used these new ones (as set up as my previous post describes). I'm half tempted to remove the VNC. As long as it is resumeable, I can vnc locally and finish what i've started, but not with nxserver. It also seems more resource hog, but can be run without X running locally where vnc does need X running. 

nxserver is a great way for a setup with not so powerful clients runing from a good server. Like I said, nxserver runs fine without X running so no expensive video card needed. Almost like the beginings of a free and open CITRIX. Even load balancing between servers can be done, so I saw from the config files options.

----------

## ]Trix[

OK. I have tried and realised I really dont need it cause I prefer ssh which is much faster. So i Tried to uninstal it. But evertime I i get the screen checking for local servers and ofcourse it cannot find any because i disabled xdmcp... What have I missed? Is there a way to get it back as it was - normal gdm login screen... or do i have to reinstall everything

I have removed tightvnc and xinetd, changed all configuration files that were used in howto to previous state, but it still doesnt work.

----------

## timbobsteve

Hi all,

I can get this tutorial to work quite well using gdm and Xorg, but one thing I cannot do is multiple connections. I can have a single connection to each service say,

1 PC connects to vnc-800x600x16

1 PC connects to vnc-1024x768x16

etc...

etc...

What I cannot do is have 2 connections to the same service (eg. 2 ppl both running vnc connections to vnc-800x600x16) so for me I can only have one session for each resolution/depth combination. This isn't very fun.

I thought by the name of this HOWTO, the end result would allow multiple connections to the same res/depth combination. Is this supposed to happen or am I thinking beyond this tutorial?

Thanks for any help you can give me. It would be nice to have everyone in my family just running sessions from my linux machine. It would mean faster internet for them and less headaches for me.

-Timbobsteve

----------

## col

Here is an init script if you only want to run a single user - reusable vnc session like me:

```

 # vi /etc/init.d/vncserver

Make it look like:

#!/sbin/runscript

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

depend() {

   need net

}

checkconfig() {

        ebegin "Load config"

   PATH="$PATH:/usr/X11R6/bin/"

   

   # The Username:Group that will run VNC

   export USER="vampas"

   #${RUNAS}

   # The display that VNC will use

   DISPLAY="0"

   # Color depth (between 8 and 32)

   DEPTH="16"

   

   # The Desktop geometry to use.

   #GEOMETRY="<WIDTH>x<HEIGHT>"

   #GEOMETRY="800x600"

   GEOMETRY="1024x780"

   #GEOMETRY="1280x1024"

   # The name that the VNC Desktop will have.

   NAME="aMule"

   OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"

   eend $? "Config not Loaded"

} 

   

start() {

        checkconfig

   ebegin "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"

   su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"

   eend $?

}

stop() {

   checkconfig

   ebegin "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}"

   su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"

   eend $?

}

restart() {

   svc_stop

   sleep 3

   svc_start

}

```

Change the runas user and save this as /etc/init.d/vncserver. Dont forget to set the vncpasswd & xstartup in ~/.vnc/

```

chmod +x  /etc/init.d/vncserver

rc-update add vncserver default

/etc/init.d/vncserver start

```

----------

## BlackEdder

When using the vnc terminal server like this I get an error when opening emacs:

undefined color: "black"

I found out that this is caused because vncserver can't find the rgb.txt file. The vncserver script (/usr/bin/vncserver) solves this by defining the variable $colorPath before running Xvnc. Is there a way to do this for this setup. Just replacing Xvnc by vncserver in the xinetd.d config doesn't seem to work.

----------

## njcwotx

```
XDMCP socket creation failed, errno 97
```

Im getting this in messages, im using kdm on this box.  A previous poster had and ipv6 issue, but im not running ipv6.

 *Quote:*   

> Solved:
> 
> Added the following to /usr/kde/3.5/share/config/kdm/Xaccess so that xdmcp is forced to listen to ipv4
> 
> ```
> ...

 

----------

## katowulf

 *mholtz wrote:*   

> 
> 
> To see if you have the problem, run 
> 
> ```
> ...

 

This little bit of advice solved hours of searching for me... thanks!  I was so happy to see an error message show up on the screen I nearly fainted. : )

----------

## psih128

Hi

I have a problem with configuring my vnc server.

I was following the tutorial on wiki (which is equal to the one in first post), but I can not see gnome login window in vncviewer. When I open it - it shows a grey window with graphic console, but no login prompt or something.

any ideas how to make gnome show up in vncviewer? do you guys need any files from my box to help with that, if you plan to do so?  :Cool: 

Thanks

Anton

----------

## pzasso

I have followed the howto as well as many others have, but I am not sure where I screwed up.  Everything looks good and I don't receive any error messages, yet I never get a login prompt.  I am connecting into my home machine from work, and am doing the following.

As my userid, with the vnc password already set, I issue the following command to start things up.

vncserver :1 -geometry 1024x768 -depth 16 -fp /usr/share/fonts/misc/,/usr/share/fonts/Type1/ -co /usr/share/X11/rgb -localhost    (VNC starts on port 5901and I see it in the process table)

Next I connect from my office linux box with the following commands:

ssh -l myusername -X -L 5903:localhost:5901 myhomeipaddress    (I am able to login via ssh and send an xclock back to my desktop)

In a separte window I run   vncviewer localhost:3    (It connects to my home server, but it just hangs and never prompts me for a password)

All I see is this on my terminal:

$ vncviewer localhost:3

VNC Viewer Free Edition 4.1.2 for X - built Dec  4 2006 15:07:40

Copyright (C) 2002-2005 RealVNC Ltd.

See http://www.realvnc.com for information on VNC.

Fri Jan 19 17:35:00 2007

 CConn:       connected to host localhost port 5903

 CConnection: Server supports RFB protocol version 3.130

 CConnection: Using RFB protocol version 3.8

And on the server side, this is what I see in the log.

19/01/2007 17:35:24 Got connection from client 127.0.0.1

19/01/2007 17:35:24 Protocol version 3.8

19/01/2007 17:35:24 Ignoring minor version mismatch

And when I control-c after giving up this is what I see in that same log.

19/01/2007 17:35:52 Client 127.0.0.1 gone

19/01/2007 17:35:52 Statistics:

19/01/2007 17:35:52   framebuffer updates 0, rectangles 0, bytes 0

It looks like I am close, but I am not sure what I am missing.  

Any help would be appreciated.

Thank you,

--Paul

----------

## elvanor

Hi,

I am also having problems. I have followed the How To. I am on AMD64, I installed TightVNC (client and server via the USE flag). When loading the server via the vncserver program (script), everything works ok and I am able to connect locally (although only twm shows up, which is normal). 

It fails when trying to use xinetd. Here is my conf:

In /etc/services:

vnc-1024x768x16 5913/tcp

In /etc/xinet.d/xvncserver:

service vnc-1024x768x16

{

          protocol = tcp

          socket_type = stream

          wait = no

          user = root

          server = /usr/bin/Xvnc

          server_args = -inetd :5913 -query localhost -once -desktop X -geometry 1024x768 -depth 16 -rfbauth /root/.vnc/passwd -fp /usr/share/fonts/misc/,/usr/share/fonts/Type1/

}

I had the problems with the fonts path, so that's why I added the -fp /usr/share/fonts/misc/,/usr/share/fonts/Type1/. I don't really understand the other arguments that are passed to the server...

Anyway, when I type vncviewer localhost::5913 I receive:

vncviewer: VNC server closed connection

In my xinetd log, however, the connection attempt is logged:

07/1/21@12:45:46: START: vnc-1024x768x16 pid=6827 from=192.168.0.2

So I believe the problem arises when xinetd tries to launch the Xvnc binary. How/where can I obtain logs of this?

Btw, when I type in a terminal /usr/bin/Xvnc -inetd :5913 -query localhost -once -desktop X -geometry 1024x768 -depth 16 -rfbauth /root/.vnc/passwd -fp /usr/share/fonts/misc/,/usr/share/fonts/Type1/, nothing happens (but the command seems to complete...?)

Any help is welcomed...

Elvanör

----------

## pzasso

It looks like /etc/hosts.allow is what was holding things up.  I put an ALL:ALL in that file and everything is working.  I am still not sure what specific line I need to put in /etc/hosts.allow so I don't have to leave it wide open, but other than that, it's working great.

--Paul

----------

## maiku

Well, I got it set up no problem.  Followed a bit of help from this guide and the one on the forums.  Works great.  I can log in under any name I want in the KDM list and the multiple port options tied to different resolutions gives me the resolution I want except one thing, most applications that aren't KDE based (such as mozilla-firefox, mozilla-thunderbird) don't work in 32-bit versions.  It crashes and leaves an error saying "Cairo doesn't support the image format" and it lists the 32 color mode.

Is there really much of a difference between 24 and 32 bit color?  'Cause I was just going to say "forget it."

----------

## jesse_kahtava

hello everyone!

I followed the guide and have it mostly working.

my problem is that after logging in and starting Gnome the keyboard mapping seems to go all wonky.

I tried logging in to a failsafe terminal and the keyboard is fine, but once I start gnome-settings-daemon the keys produce irregular characters.

For instance :

typing asdf produces abfh

typing zxcv produces */d,

pressing space produces a 7

pressing enter produces a space

typing 1234 produces 90-=

The keyboard settings in gnome are set correctly and work fine when logging in normally.

I get the following messages when starting gnome-settings-daemon from a failsafe terminal:

```
** (gnome-settings-daemon:16959): WARNING **: numlock: XkbQueryExtension returned an error

** (gnome-settings-daemon:16959): WARNING **: Neither XKeyboard not Xfree86's keyboard extensions are available,

no way to support keyboard autorepeat rate settings

```

any ideas? again, it only does this when logging in using vnc and gdm...

----------

## a_me

 *maiku wrote:*   

> Is there really much of a difference between 24 and 32 bit color? 

 

If you won't treat images or do some grafic stuff, you won't even notive the difference between the two color modes (In my opinion). 

And I don't assume you are going to do that, logged in over a vnc connection?   :Wink: 

----------

## manji_

Maybe this question has been aswered before here, and if so plz forgive me. I have used the tutorial and everything has worked fine. What i want to know is if there is a way to use xinetd and tightvnc and be able to resume a session. Because now, as soon as i close the window i have opened with vncviewer, the computer with vncserver shows "session closed for user...". I 've read somewhere that this can be achieved with x11vnc.

----------

## manji_

Ok, i have searched the posts and i see that this can be done, using realvnc and having a password in etc/xinetd.d/xvncserver. I have tried that, and although it seems to work fine, my session ends as soon as i exit the vncviewer window. My etc/xinetd.d/xvncserver file is:

service vnc-1024x768x24

```

service vnc-1024x768x24

{

          protocol = tcp

          disable = no

          type = UNLISTED

          socket_type = stream

          wait = no

          user = manji

          server = /usr/bin/Xvnc

          server_args = -inetd -query localhost -once -geometry 1024x768 -depth 24 -DisconnectClients=0 -NeverShared passwordFi$

          port = 5972

}
```

The only thing i do is "vncviewer desktop:5972", then i enter the vncpasswd and then i have to enter my user username and passwd in xdm(which i don't think should be happening). But xhen i close the window, the session closes too. Any ideas?

----------

## Artello

Hi guys,

Having trouble with МТС server on my Linux server. I followed thought this guide http://gentoo-wiki.com/HOWTO_RealVNC%2C_TightVNC%2C_XF4VNC, but still getting a gray X window screen (no kdm login prompt) while trying to connect from WinXP box. Any ideas that could cause such problem?

Any help/advices very appreciated  :Smile: 

P.S. I'm using thightvnc + kdm

----------

## clytle374

I found the end of this post and it still doesn;t work;)

I followed this http://gentoo-wiki.com/HOWTO_Xvnc_terminal_server and have tried about everything here, everything I think.

I can log in if I manually run vncserver, or Xnest -ac -query 192.168.1.101 :1 or the GDM login manager from my other Gentoo box.  No matter what I try VNC wants a password, and skips the gdm login.  I haven't tried configuring one since it shouldn't be needed.

```
cat /etc/xinetd.d/xvncserver 

service vnc-640x480x8

 {

          protocol = tcp

          socket_type = stream

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = :50 -inetd -query localhost -once -geometry 640x480 -depth 8 -SecurityTypes=None  

 }

service vnc-800x600x8

 {

          protocol = tcp

          socket_type = stream

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = :51 -inetd -query localhost -once -geometry 800x600 -depth 8 -SecurityTypes=None 

 }

ect..ect

```

Both just like in the wiki, and I have tried every variations in this thread.

```

/etc/services

vnc-640x480x8 5950/tcp

vnc-800x600x8 5951/tcp

ect..ect 

```

```

/var/log/messages shows

Mar  1 01:42:23 localhost xinetd[7253]: removing vnc-640x480x8

Mar  1 01:42:23 localhost xinetd[7253]: removing vnc-800x600x8

Mar  1 01:42:23 localhost xinetd[7253]: removing vnc-1024x768x8

ect..ect
```

Looks like it is removing them all, but I don't understand this part. I do get a VNC response so VNC must be running.

I have edited /etc/X11/gdm/custom.conf, /usr/share/gdm/defaults.conf, and set the GUI for XDMCP=True remote and listening to port 177 but netstat shows.

```
netstat -anpA inet

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   

tcp        0      0 0.0.0.0:44873           0.0.0.0:*               LISTEN      -                   

tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      6912/X              

tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      5298/portmap        

tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN      6912/X              

tcp        0      0 192.168.3.101:3632      0.0.0.0:*               LISTEN      5243/distccd        

tcp        0      0 0.0.0.0:55615           0.0.0.0:*               LISTEN      5360/rpc.statd      

udp        0      0 0.0.0.0:32768           0.0.0.0:*                           5360/rpc.statd      

udp        0      0 0.0.0.0:68              0.0.0.0:*                           4358/dhclient       

udp        0      0 0.0.0.0:872             0.0.0.0:*                           5360/rpc.statd      

udp        0      0 0.0.0.0:111             0.0.0.0:*                           5298/portmap    

```

That it is not listening to port 177.  I believe this is my problem, yet VNC should be not be asking for a passwd?

xinetd is running.  

Running net-misc/vnc-4.1.2-r3 with USE="server"

Any ideas?

----------

## GTS_Baka

Hello,

Please first forgive my mistakes, my english is bad.

I use VNC & Xinetd for Terminal Server with Thin Client.

Sometimes, after some users connect, it seems VNC ( or GDM, or Xinetd ) rejects connexion on a specific port.

I've many VNC services in /etc/services, and when it crash, only one of them reject connexion. People using another resolution or depth can still connect.

When trying with a vncviewer on a console, it just says : "End of stream" and close itself.

In /etc/gdm/gdm.conf there's

MaxSessions=70

in the [xdmcp] section

In /etc/xinetd.conf there's

instances = 60

When I start vncviewer with -log *:stderr:100 param, it says :

Timer: handleTimeout(0x542ea8 )

I didn't find any other log on server-side. 

Any idea why it seems to "close a port" ( since it happens frequently, i can run some tests if needed ) ?

Thanks

----------

## leosgb

Hi, I am not sure if this topic is still alive after all these years. But I have just tried it and didnt have success.

This is my message:

 *Quote:*   

> 
> 
> vncviewer tuxtv:51
> 
> vncviewer: ConnectToTcpAddr: connect: Connection refused
> ...

 

I got this even after I stopped iptables.

Does anyone have some time to help me fix this?

Thank you in advance.

----------

## lluisparcet

Hello:

I am also having problems. I installed xinetd-2.3.14, tightvnc-1.3.9-r1 (client and server) and configured as indicated in the wiki in a pentium3 (x86) with Xfce4 and xdm. When launch the server via vncserver :1, everything works ok and I am able to connect from another computer in my home network.

It fails when trying the "automatic vncserver response" via xinetd. I launch 

```
vncviewer pentium3:62
```

 and the login manager screen appears, but after typing the username and password the window is closed and the session ends.

This is my vncserver log:

```

24/04/08 19:07:35 Xvnc version TightVNC-1.3.9

24/04/08 19:07:35 Copyright (C) 2000-2007 TightVNC Group

24/04/08 19:07:35 Copyright (C) 1999 AT&T Laboratories Cambridge

24/04/08 19:07:35 All Rights Reserved.

24/04/08 19:07:35 See http://www.tightvnc.com/ for information on TightVNC

24/04/08 19:07:35 Desktop name 'x11' (PENTIUM3:1)

24/04/08 19:07:35 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t

Font directory '/usr/X11R6/lib/X11/fonts/Speedo/' not found - ignoring

24/04/08 19:07:36 Using protocol version 3.8

24/04/08 19:07:36 Pixel format for client 192.168.1.37:

24/04/08 19:07:36   8 bpp, depth 6

24/04/08 19:07:36   true colour: max r 3 g 3 b 3, shift r 4 g 2 b 0

24/04/08 19:07:36 Enabling full-color cursor updates for client 192.168.1.37

24/04/08 19:07:36 rfbProcessClientNormalMessage: ignoring unknown encoding -223

24/04/08 19:07:36 rfbProcessClientNormalMessage: ignoring unknown encoding 16

24/04/08 19:07:36 Using hextile encoding for client 192.168.1.37

24/04/08 19:07:37 Pixel format for client 192.168.1.37:

24/04/08 19:07:37   16 bpp, depth 16, little endian

24/04/08 19:07:37   true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0

24/04/08 19:07:37   no translation needed

AUDIT: Thu Apr 24 19:07:45 2008: 4806 Xvnc: client 2 rejected from IP 127.0.0.1 port 56666

  Auth name: MIT-MAGIC-COOKIE-1 ID: -1

AUDIT: Thu Apr 24 19:07:46 2008: 4806 Xvnc: client 2 rejected from IP 127.0.0.1 port 56667

  Auth name: MIT-MAGIC-COOKIE-1 ID: -1

AUDIT: Thu Apr 24 19:07:46 2008: 4806 Xvnc: client 2 rejected from IP 127.0.0.1 port 56668

  Auth name: MIT-MAGIC-COOKIE-1 ID: -1

AUDIT: Thu Apr 24 19:07:46 2008: 4806 Xvnc: client 2 rejected from IP 127.0.0.1 port 56669

  Auth name: MIT-MAGIC-COOKIE-1 ID: -1

AUDIT: Thu Apr 24 19:07:47 2008: 4806 Xvnc: client 2 rejected from IP 127.0.0.1 port 56670

  Auth name: MIT-MAGIC-COOKIE-1 ID: -1

```

Somebody knows what can be the problem?

My /etc/xinetd.conf:

```

#

# This is the master xinetd configuration file. Settings in the

# default section will be inherited by all service configurations

# unless explicitly overridden in the service configuration. See

# xinetd.conf in the man pages for a more detailed explanation of

# these attributes.

defaults

{

# The next two items are intended to be a quick access place to

# temporarily enable or disable services.

#

#   enabled      =

#   disabled   =

# Define general logging characteristics.

   log_type   = SYSLOG daemon info 

   log_on_failure   = HOST

   log_on_success   = PID HOST DURATION EXIT

# Define access restriction defaults

#

#   no_access   =

#   only_from   = localhost

#   max_load   = 0

   cps      = 50 10

   instances   = 50

   per_source   = 10

# Address and networking defaults

#

#   bind      =

#   mdns      = yes

   v6only      = no

# setup environmental attributes

#

#   passenv      =

   groups      = yes

   umask      = 002

# Generally, banners are not used. This sets up their global defaults

#

#   banner      =

#   banner_fail   =

#   banner_success   =

}

includedir /etc/xinetd.d

```

My /etc/services:

```

#

# VNC Servers

#

vnc-640x480x8 5950/tcp

vnc-800x600x8 5951/tcp

vnc-1024x768x8 5952/tcp

vnc-640x480x16 5960/tcp

vnc-800x600x16 5961/tcp

vnc-1024x768x16 5962/tcp

vnc-640x480x24 5970/tcp

vnc-800x600x24 5971/tcp

vnc-1024x768x24 5972/tcp

vnc-640x480x32 5980/tcp

vnc-800x600x32 5981/tcp

vnc-1024x768x32 5982/tcp

```

My /etc/xinetd.d/xvncserver:

```

service vnc-640x480x8

{

          protocol = tcp

          socket_type = stream

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = :50 -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 = :51 -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 = :52 -inetd -query localhost -once -geometry 1024x768 -depth 8

}

service vnc-640x480x16

{

          protocol = tcp

          socket_type = stream

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = :60 -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 = :61 -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 = :62 -inetd -query localhost -once -geometry 1024x768 -depth 16

}

service vnc-640x480x24

{

          protocol = tcp

          socket_type = stream

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = :70 -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 = :71 -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 = :72 -inetd -query localhost -once -geometry 1024x768 -depth 24

}

service vnc-640x480x32

{

          protocol = tcp

          socket_type = stream

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = :80 -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 = :81 -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 = :82 -inetd -query localhost -once -geometry 1024x768 -depth 32

}

```

Thank you in advance.

Regards.

----------

## leosgb

Hi,

This is how i got it to work but now i broke it and cant fix it :) my logs are in the other thread too...

https://forums.gentoo.org/viewtopic-t-679361-highlight-.html

Good luck.

----------

## Unlucky_Alf

Here are some of my config files. Hope they will be usefull for someone   :Smile:  I use Tightvnc.

/etc/xinetd.d/xvncserver

-ac is required to connect without password. This fixes errors about magic cookies.

-fp (fontpath) is also required for the server to be able to start.

-co (rgbpath) is there to get rid of error message, but it is optional. You can verify your rgbpath from xorg.conf.

```
service vnc-1024x768x24 

{ 

          protocol = tcp 

          socket_type = stream 

          wait = no 

          user = nobody 

          server = /usr/bin/Xvnc 

          server_args = -inetd -query localhost -once -ac -geometry 1024x768 -depth 24 -fp /usr/share/fonts/misc/,/usr/share/fonts/Type1/ -co /usr/share/X11/rgb

}

service vnc-1440x900x24

{

          protocol = tcp

          socket_type = stream

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = -inetd -query localhost -once -ac -geometry 1440x900 -depth 24 -fp /usr/share/fonts/misc/,/usr/share/fonts/Type1/ -co /usr/share/X11/rgb

}
```

/usr/kde/3.5/share/config/kdm/kdmrc

```
[Xdmcp]

Enable=true

#Willing=/usr/kde/3.5/share/config/kdm/Xwilling

Port=177
```

/usr/kde/3.5/share/config/kdm/Xaccess make sure you have theese two lines uncommented. You can repace the asterisk with IP address eg. 192.168.0.*

```
*               #any host can get a login window

*      CHOOSER BROADCAST   #any indirect host can get a chooser
```

Tip: read /usr/bin/vncserver to find out undocumented switches  :Smile: 

----------

## webified

Does anyone know how to disable KDE4 desktop effects for a vnc session? I want to keep the effects when physically logging in to the desktop and automatically disable them for remote/vnc sessions. Perhaps even specifying a different theme might be useful too.

Is there some option I can add to the "startkde" part of my ~/.vnc/xstartup file?

----------

## Parag Patel

 *psih128 wrote:*   

> Hi
> 
> I have a problem with configuring my vnc server.
> 
> I was following the tutorial on wiki (which is equal to the one in first post), but I can not see gnome login window in vncviewer. When I open it - it shows a grey window with graphic console, but no login prompt or something.
> ...

 

Try recompiling gdm (KDM XDM...) with the use flag "-ipv6." It seems that Xvnc doesn't play well in ipv6.

----------

## Parag Patel

 *col wrote:*   

> Here is an init script if you only want to run a single user - reusable vnc session like me:
> 
> ```
> 
>  # vi /etc/init.d/vncserver
> ...

 

Actually, you can get the windows manager to start any number of "terminals" on predefined displays. These act like real terminals, so if you don't log out of the session, the session stays open, the next time you connect. The risk/downside I was not able to resolve (though I really didn't try) is that if you disconnect he session on display :1, the next time you reconnect to that display, the session is completely open, exactly the way it was when you disconnected. There should be a way to lock the screen prior to disconnecting, or using a password protected screen saver that would protect the session.

I can post the relevant configuration for gdm, I think that I still have it for xdm. Both are pretty clearly described in the config files.

Parag

----------

## soya

Hi, does anyone one know why i can't make sessions reusable (resume a session). I've follow the howto and also have read the full thread but there's no way to get session reusable. When i set wait = yes i can't connect to the server. i hope someoen can help, thanks in advanced  :Smile: 

```
service vnc-800x600x32

{

          protocol = tcp

          socket_type = stream

disable = no

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = -inetd :1 -SecurityTypes None -query localhost -once -geometry 800x600 -depth 32 -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

}

service vnc-1024x768x32

{

          protocol = tcp

          socket_type = stream

disable = no

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = -inetd :1 -SecurityTypes None -query localhost -once -geometry 1024x768 -depth 32 -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

}

service vnc-1280x1024x32

{

          protocol = tcp

          socket_type = stream

        disable = no

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = -inetd :1 -SecurityTypes None -query localhost -once -geometry 1280x1024 -depth 32 -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

}

service vnc-1600x1200x32

{

          protocol = tcp

          socket_type = stream

        disable = no

          wait = no

          user = nobody

          server = /usr/bin/Xvnc

          server_args = -inetd :1 -SecurityTypes None -query localhost -once -geometry 1600x1200 -depth 32 -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

}

```

----------

## garlicbread

Finally got this working, for info

First I upgraded tightvnc to 1.3.10-r1

by adding =net-misc/tightvnc-1.3.10-r1 to /etc/portage/package.keywords

I've noticed that the -inetd flag suppresses all output from Xvnc

so you'll get more information from Xnvc if your running it directly by ommitting this flag temporarily

I also noticed that the fonts directory needs to be specified as well for this to work

e.g. for example to test that the parameters are correct for Xvnc try something like

(this only seems to work while xdm is stopped)

```

Xvnc -query localhost -once -geometry 1024x768 -depth 24 -fp /usr/share/fonts/misc/,/usr/share/fonts/Type1/

```

this won't do much other than give a basic X window to connect to

but it is a way of checking if the parameters to be used within /etc/xinetd.d/xvncserver are correct / will work

next stop Xvnc, and add a rule to /etc/xinetd.d/xvncserver

e.g. this is what I'm using at the moment

```

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 -fp /usr/share/fonts/misc/,/usr/share/fonts/Type1/

}

```

Edit for a persistant connection

edit /etc/conf.d/vnc

and add a line such as

```

DISPLAYS="exampleuser:0"

```

to get kde to auto start

edit /home/exampleuser/.vnc/xstartup

and add something like

```

#!/bin/sh

/usr/kde/3.5/bin/startkde &

```

then just start vncserver

```
/etc/init.d/vnc restart
```

----------

## langa

 *soya wrote:*   

> Hi, does anyone one know why i can't make sessions reusable (resume a session). I've follow the howto and also have read the full thread but there's no way to get session reusable. When i set wait = yes i can't connect to the server. i hope someoen can help, thanks in advanced 
> 
> 

 

I am having the same issue. Cant' get it to work with wait = yes.

See syslog:

```

Jul  8 09:22:24 localhost xinetd[9261]: FAIL: vnc5 address from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: START: vnc5 pid=9261 from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: EXIT: vnc5 status=0 pid=9261 duration=0(sec)

Jul  8 09:22:24 localhost xinetd[9262]: FAIL: vnc5 address from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: START: vnc5 pid=9262 from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: EXIT: vnc5 status=0 pid=9262 duration=0(sec)

Jul  8 09:22:24 localhost xinetd[9263]: FAIL: vnc5 address from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: START: vnc5 pid=9263 from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: EXIT: vnc5 status=0 pid=9263 duration=0(sec)

.

.

.

.

Jul  8 09:22:24 localhost xinetd[9308]: FAIL: vnc5 address from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: START: vnc5 pid=9308 from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: EXIT: vnc5 status=0 pid=9308 duration=0(sec)

Jul  8 09:22:24 localhost xinetd[9309]: FAIL: vnc5 address from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: START: vnc5 pid=9309 from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: EXIT: vnc5 status=0 pid=9309 duration=0(sec)

Jul  8 09:22:24 localhost xinetd[9310]: FAIL: vnc5 address from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: START: vnc5 pid=9310 from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: EXIT: vnc5 status=0 pid=9310 duration=0(sec)

Jul  8 09:22:24 localhost xinetd[8779]: Deactivating service vnc5 due to excessive incoming connections.  Restarting in 10 seconds.

Jul  8 09:22:24 localhost xinetd[8779]: FAIL: vnc5 connections per second from=<no address>

Jul  8 09:22:34 localhost xinetd[8779]: Activating service vnc5

```

----------

## danomac

I've been migrating my old box to all-new software, including a migration to tigervnc and kde4.

I've come across an issue where the whole thing goes kaboom when trying to vnc in:

```

xinetd[11546]: START: vnc-800x600x32 pid=11907 from=192.168.1.5

kernel: drkonqi[11925]: segfault at 4 ip b63aed6b sp bffacc60 error 4 in libQtGui.so.4.6.2[b607b000+9df000]

kdm: localhost:2[11923]: Received unknown or unexpected command -2 from greeter

kdm: localhost:2[11923]: Abnormal termination of greeter for display localhost:2, code 125, signal 0

xinetd[11546]: EXIT: vnc-800x600x32 status=0 pid=11907 duration=0(sec)

```

```

kdm[11844]: XDMCP socket creation failed, errno 97

```

```

KCrash: Application 'kdmgreet' crashing...

```

After about two hours of scratching my head, I've discovered an unusual problem: kde4 and vnc can't spawn sessions with a 32-bit colour depth. Setting the colour depth to 16-bit for my services defined in /etc/services and /etc/xinetd.d/xvncserver fixed the problem.

Hopefully this will help someone and prevent them from wasting so much time on a silly problem.   :Confused: 

Software I have installed:

```

[I--] [  ] kde-base/kdebase-meta-4.3.5 (4.3)

[I--] [  ] x11-base/xorg-x11-7.4-r1

[I--] [  ] x11-base/xorg-server-1.6.5-r1

[I--] [  ] net-misc/tigervnc-1.0.0-r4

[I--] [  ] sys-apps/xinetd-2.3.14

```

----------

## Havin_it

 *langa wrote:*   

>  *soya wrote:*   Hi, does anyone one know why i can't make sessions reusable (resume a session). I've follow the howto and also have read the full thread but there's no way to get session reusable. When i set wait = yes i can't connect to the server. i hope someoen can help, thanks in advanced 
> 
>  
> 
> I am having the same issue. Cant' get it to work with wait = yes.
> ...

 

Me three   :Sad:   Same exact output, a million different config options tried. I'm using TigerVNC and the TightVNC+SSH Java client to connect, FWIW, and it works fine using wait = no or the tigervnc initscript. Anyone any ideas?

----------

## Scotty49

Today I stumbled upon this howto, trying to set up a VNC server on my gentoo box with KDE 4. At all, it worked pretty good, but I found out a few things which may hopefully be useful in the future:

1. The file /etc/X11/xdm/xdm-config doesn't exist any more. As it seems, editing this file is obsolete.

2. In the kdmrc file (/usr/share/config/kdm/kdmrc), it is important to comment the line

```
#Willing=/usr/share/config/kdm/Xwilling
```

out

3. The file /etc/X11/xdm/Xaccess is also not existing. The correct path (for me) is /usr/share/config/kdm/Xaccess.

4. The following problem

```
...

Jul  8 09:22:24 localhost xinetd[9261]: FAIL: vnc5 address from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: START: vnc5 pid=9261 from=<no address>

Jul  8 09:22:24 localhost xinetd[8779]: EXIT: vnc5 status=0 pid=9261 duration=0(sec) 

...

```

as reported by Havin_it, langa and soya occured for me, when I edited the Xaccess file and wrote

```
192.168.0.*                                       #any host [in my lan] can get a login window
```

instead of

```
*                                       #any host can get a login window
```

I probably got something wrong there - I suppose, I would have to add localhost (127.0.0.1) to the configuration, but the docs are pretty sparse concerning this point. Anyway, after using the line with just the asterisk, it worked. The access restrictions of xinetd should, in addition, cover the 192.168.0.* setting. (You would use

```
only_from       = 192.168.0.1/24
```

in your /etc/xinetd.conf file).

5. To make the whole thing work for me, I had to explicitely specify the Screen ":1" when starting the Xvnc server, as there was (or could be) a local X running on Screen :0. To do this, you would just add :1 to the server_args in the /etc/xinetd.d/xvncserver file:

```
...

server_args = :1 -inetd -query localhost -once -geometry 1620x1200 -depth 16

...

```

I read, that it has to be the first argument, but I didn't test it another way.

6. Tigervnc is better than tightvnc (at least for me): Using tightvnc, I had some really ugly graphics glitches which did not only look bad but even made some texts unreadable. With tigervnc, they are all gone, just the task bar looks a little strange, but is usable anyway. Additionally, it seems to me, that the access is "smoother" in tigervnc.

You can follow the HowTo as it is, just emerge tigervnc instead of tightvnc. And there's one option you would have to add to the entries in /etc/xinetd.d/xvncserver:

```
...

server_args = :1 -inetd -query localhost -once -geometry 1620x1200 -depth 16  -SecurityTypes none

...

```

(Concerning the :1, please see point 5.) If -SecurityTypes none is not set, the system expects a password set by vncpasswd. Otherwise, you can use your desktop environment's login and authentication mechanism as usual.

That's it. I hope, I didn't write too much stuff, that already seemed clear to everyone or was explained already.  :Smile: 

----------

## lines

I just logged in for fun. Wow this topic is till active :O

----------

