Page 2 of 64 FirstFirst 12341252 ... LastLast
Results 11 to 20 of 637

Thread: HOWTO: Set up VNC server with resumable sessions

  1. #11
    Join Date
    Apr 2005
    Beans
    54

    Re: HOWTO: Set up VNC server with resumable sessions

    Yes, I also noticed like kacheng that no process is killed after issuing the command killall Xvnc.

  2. #12
    Join Date
    Jan 2005
    Beans
    199

    Re: HOWTO: Set up VNC server with resumable sessions

    From your description it seems that after the reboot xinetd is listening on port 5901 and the setup is correct.

    xinetd is supposed to start Xvnc as soon as it gets an incoming connection from a VNC client.

    I assume you copied /etc/xined.d/Xvnc exactly from this howto without changing anything, right ? if so, then maybe the fact you are using the old vnc sever (version 3.x) is related because it might not support some of the arguments ?

    After you start the vncviewer, xinetd should spwan Xvnc with the arguments specified in the Xvnc file we created in step 3. So immediately after starting vncviewer (and even before entering the vnc password), you can check the Xvnc started by issueing this command:

    Code:
    ps -ef | grep Xvnc
    This should show something like this:

    root 9777 9527 0 15:28 ? 00:00:00 Xvnc -inetd :1 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd
    If it doesn't work it means that Xvnc wasn't started. So in that case I would suggest to try starting Xvnc manually (not from within xinetd) just to make sure it can run at all (we will use screen :2 so it doesn't overlap with the original Xvnc):

    Code:
    sudo Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd
    Now, from another terminal try to connect:

    Code:
    vncviewer localhost:2
    tell me if that works......

  3. #13
    Join Date
    Apr 2005
    Beans
    54

    Re: HOWTO: Set up VNC server with resumable sessions

    Yes, I copied the /etc/xinetd.d/Xvnc exactly as you mentioned.

    I issued :
    $ vncviewr localhost:1
    which yields
    VNC viewer version 3.3.7 - built Sep 27 2005 11:12:00
    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::SystemException: read: Connection reset by peer (104)

    As you can see I am running vncserver 3.3.7, since I have an AMD64 chipset and in this matter I followed the old how-to by not installing vnc4server.

    After this command I issued
    $ps -ef | grep Xvnc
    which yields
    myname 19963 8823 0 11:12 pts/1 00:00:00 grep Xvnc

    Now I issued the big command :
    $sudo Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

    It asked for root passwd :
    Password:
    After entering the password, it said
    Unrecognized option: -DisconnectClients=0
    use: X [:<display>] [option]
    -a # mouse acceleration (pixels)
    -ac disable access control restrictions
    -audit int set audit trail level
    -auth file select authorization file
    bc enable bug compatibility
    -bs disable any backing store support
    -c turns off key-click
    c # key-click volume (0-100)
    -cc int default color visual class
    -co file color database file
    -core generate core dump on fatal error
    -dpi int screen resolution in dots per inch
    -deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs
    -f # bell base (0-100)
    -fc string cursor font
    -fn string default font name
    -fp string default font path
    -help prints message with these options
    -I ignore all remaining arguments
    -ld int limit data space to N Kb
    -lf int limit number of open files to N
    -ls int limit stack space to N Kb
    -nolock disable the locking mechanism
    -logo enable logo in screen saver
    nologo disable logo in screen saver
    -nolisten string don't listen on protocol
    -p # screen-saver pattern duration (minutes)
    -pn accept failure to listen on all ports
    -nopn reject failure to listen on all ports
    -r turns off auto-repeat
    r turns on auto-repeat
    -s # screen-saver timeout (minutes)
    -su disable any save under support
    -t # mouse threshold (pixels)
    -terminate terminate at server reset
    -to # connection time out
    -tst disable testing extensions
    ttyxx server started from init on /dev/ttyxx
    v video blanking for screen-saver
    -v screen-saver without video blanking
    -wm WhenMapped default backing-store
    -x string loads named extension at init time
    -query host-name contact named host for XDMCP
    -broadcast broadcast for XDMCP
    -indirect host-name contact named host for indirect XDMCP
    -port port-num UDP port number to send messages to
    -once Terminate server after one session
    -class display-class specify display class to send in manage
    -cookie xdm-auth-bits specify the magic cookie for XDMCP
    -displayID display-id manufacturer display ID for request
    Xvnc version 3.3.7 - built Sep 27 2005 11:14:24

    -geometry WxH set framebuffer width & height
    -depth D set framebuffer depth
    -pixelformat format set pixel format (BGRnnn or RGBnnn)
    -rfbport port TCP port for RFB protocol
    -rfbwait time max time in ms to wait for RFB client
    -nocursor don't put up a cursor
    -rfbauth passwd-file use authentication on RFB protocol
    -httpd dir serve files via HTTP from here
    -httpport port port for HTTP
    -deferupdate time time in ms to defer updates (default 40)
    -economictranslate less memory-hungry translation
    -maxrects num max number of rectangles in an update (default 50)
    -desktop name VNC desktop name (default x11)
    -alwaysshared always treat new clients as shared
    -nevershared never treat new clients as shared
    -dontdisconnect don't disconnect existing clients when a new non-shared
    connection comes in (refuse new connection instead)
    -localhost only allow connections from localhost
    -inetd Xvnc is launched by inetd

    Although I understand that it didn't work, even then I tried to issue this command from another workspace

    $vncviewer localhost:2

    which gave the expected result :

    VNC viewer version 3.3.7 - built Sep 27 2005 11:12:00
    Copyright (C) 2002-2003 RealVNC Ltd.
    Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
    See http://www.realvnc.com for information on VNC.
    vncviewer: ConnectToTcpAddr: connect: Connection refused
    Unable to connect to VNC server

    Is it possible that I am using vncserver 3.3.7, it doesn't understand the commnds given in /etc/xinetd.d/Xvnc file? This file also contains the option -DisconnectClients and the above output shows that it is not a valid option.
    Last edited by mssm; January 29th, 2006 at 10:29 AM.

  4. #14
    Join Date
    Jan 2005
    Beans
    199

    Re: HOWTO: Set up VNC server with resumable sessions

    Ok, just for you I installed vncserver package on my system instead of vnc4server. It looks like this old version of vncserver has slighlty different options.

    Here's how your /etc/xinetd.d/Xvnc config file should look like:

    Code:
    service Xvnc
    {
            type = UNLISTED
            disable = no
            socket_type = stream
            protocol = tcp
            wait = yes
            user = root
            server = /usr/bin/Xvnc
            server_args = -inetd :1 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -nevershared -rfbauth /root/.vncpasswd
            port = 5901
    }
    Now repeat step 5, and then try to connect:

    Code:
    vncviewer localhost:1
    If that doesn't work then reboot and try to connect again.

    Now I'm pretty sure it should work......keep us posted !
    Last edited by Tichondrius; January 30th, 2006 at 11:37 PM.

  5. #15
    Join Date
    Apr 2005
    Beans
    54

    Re: HOWTO: Set up VNC server with resumable sessions

    Nope, it's not working.

    I issued the commands of step 5 after I modified /etc/xinetd.d/Xvnc to its latest form and rebooted the machine. Next I issued the command :

    $ vncviewer localhost:1
    VNC viewer version 3.3.7 - built Sep 27 2005 11:12:00
    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::SystemException: read: Connection reset by peer (104)

    What does this output imply?

    Finally I issued the command as a root, after going to superuser shell by issuing su. Alas, I have no success this time too.

    Did it work for your machine? Is it an AMD64?

  6. #16
    Join Date
    Jan 2005
    Beans
    199

    Re: HOWTO: Set up VNC server with resumable sessions

    Turn OFF your firewall software (e.g. firestarter) - or at least add a rule to allow inbound connections on all ports from the localhost. I just realized it might be causing a problem even when connecting from localhost.

    Now Try this - open a terminal and enter this command:

    Code:
    sudo /usr/bin/Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -nevershared -rfbauth /root/.vncpasswd
    The Xvnc program should start correctly which will be confirmed by its output which will include a line tlike this:

    29/01/06 03:20:11 Listening for VNC connections on TCP port 5902
    Now, open another terminal (do not kill the Xvnc you started above) and give this command:

    Code:
    vncviewer localhost:2
    You SHOULD be able to connect and see a login screen. Otherwise something is messed up in your system. And yes, this works for me 100%.
    Last edited by Tichondrius; January 30th, 2006 at 11:37 PM.

  7. #17
    Join Date
    Apr 2005
    Beans
    54

    Re: HOWTO: Set up VNC server with resumable sessions

    Quote Originally Posted by Tichondrius
    Turn OFF your firewall software (e.g. firestarter) - or at least add a rule to allow inbound connections on all ports from the localhost. I just realized it might be causing a problem even when connecting from localhost.

    Now Try this - open a terminal and enter this command:

    Code:
    sudo /usr/bin/Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -NeverShared -rfbauth /root/.vncpasswd
    The Xvnc program should start correctly which will be confirmed by its output which will include a line tlike this:



    Now, open another terminal (do not kill the Xvnc you started above) and give this command:

    Code:
    vncviewer localhost:2
    You SHOULD be able to connect and see a login screen. Otherwise something is messed up in your system. And yes, this works for me 100%.
    I do not have any firewall software installed in my computer. On my cable modem cum router I have the ports 5900 and 5901 both open in firewall config. for both incoming and outgoing requests. Also these ports are forwarded to my internal IP address. Should I try to open any other ports? I did one extra thing : I have opened a UDP port no. 177 in my firewall for XDMCP. I shall turn it off and try.

    I am at my office right now. So I shall try all these after I get back home. Thanks a lot for your patience and help.

    BTW, I have tried a completely different thing : I tried to install tightvnc java-client from this thread

    http://www.ubuntuforums.org/showthre...light=tightvnc

    and it is perfectly working for me. I think this is allowed only when remote desktop is turned on. From my office computer, I just issued te command

    $vncviewer myservername.org

    It opened the login screen but the one due to tightvnc java based client. Issuing the command

    $vncviewer myservername.org:1

    gives connection reset by peer. To avoid confusion, I should add that vncserver was not working even befoer installing tightvnc java client, since it may seem that they are kind of conflicting each other. I forget to ask one thing: should I turn off ubuntu's built-in remote desktop feature for vncserver to work properly?
    Last edited by mssm; January 30th, 2006 at 11:03 AM.

  8. #18
    Join Date
    Apr 2005
    Beans
    54

    Re: HOWTO: Set up VNC server with resumable sessions

    Yes, Tichondrius, it works !!!

    After issuing that big command I got this output

    30/01/06 22:03:59 Xvnc version 3.3.7 - built Sep 27 2005 11:14:24
    30/01/06 22:03:59 Copyright (C) 2002-2003 RealVNC Ltd.
    30/01/06 22:03:59 Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
    30/01/06 22:03:59 All Rights Reserved.
    30/01/06 22:03:59 See http://www.realvnc.com for information on VNC
    30/01/06 22:03:59 Desktop name 'x11' (strings:2)
    30/01/06 22:03:59 Protocol version supported 3.3
    30/01/06 22:03:59 Listening for VNC connections on TCP port 5902

    From another terminal, when I I issued :

    $vncviewer localhost:2

    I got my login screen along with this output inside that terminal :
    VNC viewer version 3.3.7 - built Sep 27 2005 11:12:00
    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.3 (viewer 3.3)
    Password:
    VNC authentication succeeded
    Desktop name "root's x11 desktop (strings:2)"
    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 and visual, TrueColor, depth 24.
    Got 256 exact BGR233 colours out of 256
    Using BGR233 pixel format:
    8 bits per pixel.
    True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
    Throughput 20000 kbit/s - changing to Hextile
    Throughput 20000 kbit/s - changing from 8bit
    Using viewer's native pixel format:
    8 bits per pixel.
    True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
    Throughput 20000 kbit/s - changing to Hextile
    Throughput 20000 kbit/s - changing from 8bit
    Using viewer's native 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
    Throughput 20000 kbit/s - changing to Raw

    So what should I do now? Should I change my /etc/xinetd.d/Xvnc? I should also add that after startind xinetd by issuing

    $sudo /etc/init.d/xinetd start

    and then issuing this command :

    $ps -ef |grep xinetd

    yields

    myname 26831 24082 0 22:59 pts/2 00:00:00 grep Xvnc

    It seems Xvnc is not running.

    Another wild guess: does it depend in anyway on the permission of this file?
    Last edited by mssm; January 30th, 2006 at 10:03 PM.

  9. #19
    Join Date
    Jan 2005
    Beans
    199

    Re: HOWTO: Set up VNC server with resumable sessions

    Great, Xvnc works for you when you start manually, so now the only issue is to get it started by xinetd. Let me just clarify that xinetd listens on the requested port but only starts Xvnc when a client is attempting to connect. So it's ok that you don't see Xvnc running before connecting with a client.

    So yeah, now go ahead and change the /etc/xinetd.d/Xvnc file to have the same options (on the server_args line) as when you started it manually, except that you should use screen :1 and also the "-inetd" option. That's exactly what I listed in my message #14 above.

    Then try to connect to localhost:1 and see that it works. If it doesn't then maybe it's something with your Kubuntu display manager that is different than regular GDM on Ubuntu.

    BTW, you can also try to connect from another PC to the Xvnc you started locally by using the VNC server machine address with :2 appended.
    Last edited by Tichondrius; January 30th, 2006 at 11:18 PM.

  10. #20
    Join Date
    Dec 2005
    Beans
    113

    Re: HOWTO: Set up VNC server with resumable sessions

    mssm I'm very jealous that you got it to work!

    I just upgraded to Dapper to try and solve my nvidia driver issue. Now I can't install vncserver due to dependency issue.
    vncserver:
    Depends: xserver-common but it is not installable


    However, I can install tightvncserver, but when I run your command Tichondrius, I get:

    # sudo /usr/bin/Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -nevershared -rfbauth /root/.vncpasswd

    Couldn't open RGB_DB '/usr/X11R6/lib/X11/rgb'
    MAXSOCKS=1000
    Segmentation fault



    Is this something to do with Dapper and it's changes in the Xserver?
    How would I fix it?
    Last edited by kacheng; January 31st, 2006 at 06:46 PM.

Page 2 of 64 FirstFirst 12341252 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •