Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to turn your box into a Xvnc Terminal Server
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 15, 16, 17  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
elvanor
Developer
Developer


Joined: 11 Oct 2004
Posts: 178
Location: France

PostPosted: Sun Jan 21, 2007 12:44 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
pzasso
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2003
Posts: 94
Location: California

PostPosted: Mon Jan 22, 2007 8:55 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 500
Location: Long Island, NY

PostPosted: Wed Mar 28, 2007 8:57 pm    Post subject: Reply with quote

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."
_________________
- Mike A. Leonetti
Back to top
View user's profile Send private message
jesse_kahtava
n00b
n00b


Joined: 30 Nov 2004
Posts: 66
Location: Ontario, Canada

PostPosted: Thu Apr 26, 2007 4:40 am    Post subject: Reply with quote

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:

Code:
** (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...
Back to top
View user's profile Send private message
a_me
n00b
n00b


Joined: 21 Jan 2006
Posts: 43

PostPosted: Sat Apr 28, 2007 8:25 pm    Post subject: Reply with quote

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:
Back to top
View user's profile Send private message
manji_
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2007
Posts: 120

PostPosted: Tue Jul 31, 2007 12:33 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
manji_
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2007
Posts: 120

PostPosted: Thu Aug 02, 2007 12:37 am    Post subject: Reply with quote

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

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?
Back to top
View user's profile Send private message
Artello
n00b
n00b


Joined: 27 Apr 2007
Posts: 13

PostPosted: Mon Jan 14, 2008 1:04 pm    Post subject: Reply with quote

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

P.S. I'm using thightvnc + kdm
Back to top
View user's profile Send private message
clytle374
Apprentice
Apprentice


Joined: 01 Aug 2006
Posts: 166

PostPosted: Sat Mar 01, 2008 8:07 am    Post subject: Reply with quote

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.


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

Code:

/etc/services

vnc-640x480x8 5950/tcp
vnc-800x600x8 5951/tcp
ect..ect



Code:

/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.
Code:
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?
_________________
NooB since RedHat 6.1
Back to top
View user's profile Send private message
GTS_Baka
n00b
n00b


Joined: 15 Jan 2007
Posts: 5

PostPosted: Thu Mar 06, 2008 11:38 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
leosgb
Apprentice
Apprentice


Joined: 07 Mar 2006
Posts: 272
Location: Rio de Janeiro, Brazil

PostPosted: Thu Mar 27, 2008 5:46 am    Post subject: Reply with quote

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
Unable to connect to VNC server


I got this even after I stopped iptables.

Does anyone have some time to help me fix this?

Thank you in advance.
Back to top
View user's profile Send private message
lluisparcet
Tux's lil' helper
Tux's lil' helper


Joined: 21 Sep 2004
Posts: 111
Location: Roses

PostPosted: Thu Apr 24, 2008 6:18 pm    Post subject: Reply with quote

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

Code:

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:

Code:

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

Code:

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

Code:

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.
Back to top
View user's profile Send private message
leosgb
Apprentice
Apprentice


Joined: 07 Mar 2006
Posts: 272
Location: Rio de Janeiro, Brazil

PostPosted: Thu Apr 24, 2008 7:15 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Unlucky_Alf
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2003
Posts: 92

PostPosted: Mon Oct 06, 2008 4:08 pm    Post subject: Reply with quote

Here are some of my config files. Hope they will be usefull for someone :) 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.
Code:
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
Code:
[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.*
Code:
*               #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 :)
Back to top
View user's profile Send private message
webified
n00b
n00b


Joined: 13 Nov 2005
Posts: 12

PostPosted: Tue Oct 14, 2008 7:06 am    Post subject: Disable KDE4 desktop effects for vnc? Reply with quote

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?
Back to top
View user's profile Send private message
Parag Patel
n00b
n00b


Joined: 12 Dec 2007
Posts: 21

PostPosted: Wed Feb 18, 2009 3:17 am    Post subject: Reply with quote

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.

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

Thanks
Anton


Try recompiling gdm (KDM XDM...) with the use flag "-ipv6." It seems that Xvnc doesn't play well in ipv6.
Back to top
View user's profile Send private message
Parag Patel
n00b
n00b


Joined: 12 Dec 2007
Posts: 21

PostPosted: Wed Feb 18, 2009 3:29 am    Post subject: Reply with quote

col wrote:
Here is an init script if you only want to run a single user - reusable vnc session like me:

Code:

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

Code:

chmod +x  /etc/init.d/vncserver

rc-update add vncserver default

/etc/init.d/vncserver start



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
Back to top
View user's profile Send private message
soya
Guru
Guru


Joined: 29 Jan 2004
Posts: 423

PostPosted: Mon Apr 20, 2009 8:56 pm    Post subject: Reply with quote

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

Code:
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
}

_________________
Si el tonto te alaba lamentalo, si el listo te censura piensalo...
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 180

PostPosted: Sun May 17, 2009 8:25 pm    Post subject: Reply with quote

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

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

Code:

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

DISPLAYS="exampleuser:0"


to get kde to auto start
edit /home/exampleuser/.vnc/xstartup
and add something like
Code:

#!/bin/sh
/usr/kde/3.5/bin/startkde &


then just start vncserver
Code:
/etc/init.d/vnc restart
Back to top
View user's profile Send private message
langa
n00b
n00b


Joined: 21 May 2006
Posts: 11
Location: Melbourne Aust

PostPosted: Tue Jul 07, 2009 11:25 pm    Post subject: Reply with quote

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

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
Back to top
View user's profile Send private message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 817
Location: Vancouver, BC

PostPosted: Sun Mar 07, 2010 4:40 am    Post subject: Reply with quote

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:

Code:

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)


Code:

kdm[11844]: XDMCP socket creation failed, errno 97


Code:

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

Software I have installed:
Code:

[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
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1070
Location: Edinburgh, UK

PostPosted: Sun Mar 13, 2011 10:05 pm    Post subject: Reply with quote

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.

See syslog:
Code:

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


Me three :( 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?
Back to top
View user's profile Send private message
Scotty49
Tux's lil' helper
Tux's lil' helper


Joined: 14 May 2003
Posts: 81

PostPosted: Tue Jan 03, 2012 10:02 pm    Post subject: Reply with quote

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

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

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

Code:
192.168.0.*                                       #any host [in my lan] can get a login window


instead of

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

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

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

Code:
...
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. :)
Back to top
View user's profile Send private message
lines
n00b
n00b


Joined: 29 Jul 2003
Posts: 20

PostPosted: Wed Jan 04, 2012 9:56 pm    Post subject: Wow, this topic is still active Reply with quote

I just logged in for fun. Wow this topic is till active :O
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3 ... 15, 16, 17
Page 17 of 17

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum