Page 7 of 7 FirstFirst ... 567
Results 61 to 69 of 69

Thread: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

  1. #61
    Join Date
    Aug 2008
    Beans
    2

    Re: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

    hi,

    in /etc/kde3/kdm/kdmrc I did exactly what was suggested in the HowTo:
    (relevant section)
    Code:
    [Xdmcp]
    # Whether KDM should listen to incoming XDMCP requests.
    # Default is true
    Enable=true
    # The UDP port on which KDM should listen for XDMCP requests. Do not change.
    # Default is 177
    Port=177
    # File with the private keys of X-terminals. Required for XDM authentication.
    # Default is ""
    #KeyFile=/etc/kde3/kdm/kdmkeys
    # XDMCP access control file in the usual XDM-Xaccess format.
    # Default is "/etc/kde3/kdm/Xaccess"
    Xaccess=/etc/kde3/kdm/Xaccess
    # Number of seconds to wait for display to respond after the user has
    # selected a host from the chooser.
    # Default is 15
    #ChoiceTimeout=10
    # Strip domain name from remote display names if it is equal to the local
    # domain.
    # Default is true
    #RemoveDomainname=false
    # Use the numeric IP address of the incoming connection on multihomed hosts
    # instead of the host name.
    # Default is false
    #SourceAddress=true
    # The program which is invoked to dynamically generate replies to XDMCP
    # DirectQuery or BroadcastQuery requests.
    # If empty, no program is invoked and "Willing to manage" is sent.
    # Default is ""
    Willing=/etc/kde3/kdm/Xwilling
    in /etc/kde3/kdm/Xaccess I also just uncommented the two lines listed in the HowTo.

    I installed the vnc4server (deb-package).

    The I modified /etc/xinet.d/Xvnc:

    Code:
    service Xvnc_user1
    {
            type = UNLISTED
            disable = no
            socket_type = stream
            protocol = tcp
            wait = yes
            user = root
            server = /usr/bin/Xvnc
    	server_args = :1 -geometry 1280x768 -depth 16 -query localhost -inetd -once -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/75dpi/ -DisconnectClients=0 -AlwaysShared -IdleTimeout=0 passwordFile=/home/user1/.vncpasswd_user1 -extension XFIXES
            port = 5901
    }
    
    service Xvnc_user5
    {
            type = UNLISTED
            disable = no
            socket_type = stream
            protocol = tcp
            wait = yes
            user = root
            server = /usr/bin/Xvnc
    	server_args = :2 -geometry 1280x768 -depth 16 -query localhost -inetd -once -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/75dpi/ -DisconnectClients=0 -AlwaysShared -IdleTimeout=0 passwordFile=/home/user5/.vncpasswd_user5 -extension XFIXES
            port = 5902
    }
    
    service Xvnc_user3
    {
            type = UNLISTED
            disable = no
            socket_type = stream
            protocol = tcp
            wait = yes
            user = root
            server = /usr/bin/Xvnc
    	server_args = :3 -geometry 1280x768 -depth 16 -query localhost -inetd -once -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/75dpi/ -DisconnectClients=0 -AlwaysShared -IdleTimeout=0 passwordFile=/home/user3/.vncpasswd_user3 -extension XFIXES
            port = 5903
    }
    
    service Xvnc_user2
    {
            type = UNLISTED
            disable = no
            socket_type = stream
            protocol = tcp
            wait = yes
            user = root
            server = /usr/bin/Xvnc
    	server_args = :4 -geometry 1280x768 -depth 16 -query localhost -inetd -once -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/75dpi/ -DisconnectClients=0 -AlwaysShared -IdleTimeout=0 passwordFile=/home/user2/.vncpasswd_user2 -extension XFIXES
            port = 5904
    }
    
    service Xvnc_user4
    {
            type = UNLISTED
            disable = no
            socket_type = stream
            protocol = tcp
            wait = yes
            user = root
            server = /usr/bin/Xvnc
    	server_args = :5 -geometry 1280x768 -depth 16 -query localhost -inetd -once -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/75dpi/ -DisconnectClients=0 -AlwaysShared -IdleTimeout=0 passwordFile=/home/user4/.vncpasswd_user4 -extension XFIXES
            port = 5905
    }
    
    service Xvnc_user6
    {
            type = UNLISTED
            disable = no
            socket_type = stream
            protocol = tcp
            wait = yes
            user = root
            server = /usr/bin/Xvnc
    	server_args = :6 -geometry 1280x768 -depth 16 -query localhost -inetd -once -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/75dpi/ -DisconnectClients=0 -AlwaysShared -IdleTimeout=0 passwordFile=/home/user6/.vncpasswd_user6 -extension XFIXES
            port = 5906
    }
    
    service Xvnc_student
    {
            type = UNLISTED
            disable = no
            socket_type = stream
            protocol = tcp
            wait = yes
            user = root
            server = /usr/bin/Xvnc
    	server_args = :7 -geometry 1280x768 -depth 16 -query localhost -inetd -once -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/75dpi/ -DisconnectClients=0 -AlwaysShared -IdleTimeout=0 passwordFile=/root/.vncpasswd_student -extension XFIXES
            port = 5907
    }
    By convention I assigned a specific port to a specific user. Ports 5901 to 5906 are connected to VNC-password-files in the according user's home folder (apply chown userX:userX to it, so that the user can change his password using vncpasswd himself).
    We have an additional VNC-account for a 'rightless' student - hence, his vncpasswd file is in the root-home.

    This VNC-policy works really good, but unfortunately the GLX-extension is not supported by Xvnc. There is a project xf4vnc obviously supporting GLX, but there are no deb-packages and 64bit-binaries and I have not successfully compiled it, yet.

    At the moment we are executing GLX-dependent applications via ssh -X, but this is not resumable like the VNC-policy is ...


    >Anyway, if I could set this up, can I start these sessions (and the applications they have to run) at the boot time? - so, before the user logs in by vnc.

    I cannot really tell you, but I think it could be possible to 'simulate' logins on the machine itself (maybe via a cron-job and some bash-scripts?). We do not need comparable features - our machine is something like a power-slave which we are using for complex and time-consuming model-calculations (therefore the resumable-aspect is quite important to us).

    > Although this is Debian, I think there isn't many differences...
    I think this, too!


    cheers, lars

  2. #62
    Join Date
    Aug 2008
    Beans
    2

    Talking Re: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

    Quote Originally Posted by lars-friedrich View Post
    in /etc/kde3/kdm/kdmrc I did exactly what was suggested in the HowTo:
    ...
    Thank you very much, now it works for me with vnc4server.

    Also, I can start the server for every user by su - user command.

    Thanks again.

  3. #63
    Join Date
    Sep 2008
    Beans
    26

    Re: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

    Running Ubuntu Server 8.10 with KDE 4 installed.

    Works fine. I use it with SSH tunneling.
    The problem is that the vnc server and client are connected with 1000MB LAN, but the quality is very bad. I have set the depth to 24 but still bad quality. You can't see the text in task manager. The icons are not OK. Client is set to maximum? How can I get better quality or I should use other vnc server?

    /etc/kde4/kdm/kdmrc
    Enable=true
    Port=177
    Xaccess=/etc/kde4/kdm/Xaccess
    Willing=/etc/kde4/kdm/Xwilling
    /etc/kde4/kdm/Xaccess
    * #any host can get a login window
    *
    * CHOOSER BROADCAST #any indirect host can get a chooser
    /etc/xinetd.d/Xvnc
    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 1024x768 -depth 24 -once -fp/usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueTy -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
    port = 5901
    }


    Here is a screenshot:
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	screen.jpg 
Views:	41 
Size:	12.2 KB 
ID:	91279  

  4. #64
    Join Date
    Nov 2008
    Beans
    1

    Re: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

    I have the same settings as above and am also experiencing really terrible display issues. Many of the menu items are un readable... see attached picture. Any suggestions???
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Picture 4.png 
Views:	31 
Size:	827.0 KB 
ID:	91414  

  5. #65
    Join Date
    Sep 2008
    Beans
    26

    Re: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

    the same as mine

  6. #66
    Join Date
    Oct 2007
    Beans
    10

    Re: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

    I'm also having exactly the same problem with an almost unreadable screen with KDE4 over vnc.

  7. #67
    Join Date
    Jul 2007
    Location
    Tyaskin, Maryland
    Beans
    15
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

    I'm having problems setting this up,...

    I'm trying to connect via RealVNC windows client 4.1.3 (although it doesnt work on localhost either).

    On client side: I get the "grey screen" without a console box.

    On server side: While tailing /var/log/syslog I see:
    Code:
    Jan 27 02:37:07 bigblackbox xinetd[5631]: warning: can't get client address: Transport endpoint is not connected
    Jan 27 02:37:07 bigblackbox kdm: bigblackbox.blah.com:1[5644]: Abnormal termination of greeter for display bigblackbox.blah.com:1, code 1, signal 0
    Just befor client is prompted for a password.

    Any ideas?


    btw: the blah.com is a "fake" domain setup just for my network, as these machines never see the internet anyway. DHCP & Bind is setup properly on another ubuntu machine.
    Last edited by joegeek; January 27th, 2009 at 09:07 AM.

  8. #68
    Join Date
    Sep 2008
    Beans
    26

    Re: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

    I have modified the previous how-to so it works for Kubuntu 8.10 with KDE 4.1 or 4.2

    The bug I mentioned few posts ago is still there. Non visible Desktop plasmoid and plasmoid options.

    Required packages:

    To make sure you have the proper software installed, execute the following:

    Type in a terminal:

    Code:
    sudo apt-get install vnc4server xinetd xvnc4viewer
    The latest versions are:
    vnc4server: Xvnc Free Edition 4.1.1
    xvncviewer: VNC Viewer Free Edition 4.1.1 for X - built Apr 16 2008 13:23:14

    If you're using previous versions of any of these packages, there's no guarantee this will work. (Actually, there's no guarantee this will work anyway, but if you use versions below what I indicated, then you're just making it harder on yourself)


    I use VI as text editor (there is a bug in the default vi installation), so we need to install:

    Code:
    sudo apt-get install vim-full
    THE STEPS:

    1. ENABLE XDMCP IN KDE


    Type in a terminal:

    Code:
    sudo vi /etc/kde4/kdm/kdmrc
    Find the Xdmcp section and uncomment and edit the lines so they look like this:

    Code:
    [Xdmcp]
    Enable=true
    Port=177
    Xaccess=/etc/kde4/kdm/Xaccess
    Willing=/etc/kde4/kdm/Xwilling

    Save the file and quit. Then type this in your terminal:

    Code:
    sudo vi /etc/kde4/kdm/Xaccess
    This is a big file and can be confusing, so make sure you do this exactly as shown. Scroll down and find this line:

    Code:
    #*                                       #any host can get a login window

    Remove the # from the beginning of that line, so it looks like this:

    Code:
    *                                       #any host can get a login window


    Then find this line:

    Code:
     #*               CHOOSER BROADCAST       #any indirect host can get a chooser
    Remove the # from the beginning of that line, so it looks like this:

    Code:
     *               CHOOSER BROADCAST       #any indirect host can get a chooser
    Save the file and quit out of VIM.

    Now we need to restart the KDM process so it will re-read the configuration file. The easiest way to do this is to just reboot the machine. The quickest is to do the following:

    Code:
    ps -ef | grep kdm

    This will print out a list of processes with the letters 'kdm' in the name. Find the one that looks like the following (Specifically the one that ends in /usr/bin/kdm):

    Code:
    root    4530      1     0 0:09:20 ?          00:00:00 /usr/bin/kdm
    See the number right after root? 4530 in my example, you will almost certainly have a different number. That's the process ID or PID. Type the following command to restart kdm (Substituting the PID number you have for the 4530 in my example):

    Code:
    sudo kill -HUP 4530

    2. SET THE VNC PASSWORD


    Type this in a terminal:

    Code:
    sudo vncpasswd /root/.vncpasswd

    3. ADD VNC SERVICE TO XINETD

    Type this in a terminal:

    Code:
    sudo vi /etc/xinetd.d/Xvnc
    Enter this in to the new file:

    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 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
    port = 5901
    }
    To ensure that your font path (-fp) is correct you can use:

    Code:
    xset q

    note: Doesn't work under SSH


    I recommend leaving all of that code alone, but you can safely change the 1024x768 to be a bigger or smaller resolution for your Xvnc window, depending on what you want. You can also change the depth, but understand that increasing the depth bits will cause more bandwidth to be used over your network, which could slow down your VNC experience considerably.

    4. Edit /root/.vnc/xstartup with correct parameters for KDE,

    Code:
    sudo vi /root/.vnc/xstartup
    so the file looks like this

    Code:
    #!/bin/sh
    # Uncomment the following two lines for normal desktop:
    unset SESSION_MANAGER
    exec /etc/X11/xinit/xinitrc
    
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    startkde &
    5. RESTART XINETD

    If the following code does not work, try rebooting:

    Code:
    sudo /etc/init.d/xinetd stop
    sudo killall Xvnc
    sudo /etc/init.d/xinetd start
    Don't worry if you see a message like "Xvnc: no process killed". This just means there was no open, active session of VNC running at the time. This is expected and is normal.


    6. TEST

    If you followed all of the above steps correctly, you should now be able to test your VNC server. Type the following in a terminal:
    Code:

    vncviewer localhost:1

    You should be prompted for the VNC password, and then see the KDM login screen where you can login and start a new X session. If that works, you can now go ahead and try to connect from remote machine using your favorite VNC client (remember to first close the local vncviewer we started above). Remember to use the VNC server machine's domain name or IP address, followed by :1 (e.g. 192.168.0.100:1). If connecting locally as shown above works, but connecting remotely fails, then this means you have a problem with a firewall which is blocking some ports. See the notes below about how to deal with that.

    Note about ports: The VNC server set up as shown uses TCP port 5901. If you are using firewall software (e.g. firestarter) on that machine, you need to allow incoming connections on this port. If you are using a router which assigns your machine a private address (e.g. 192.168.0.100) which is not accessible from the internet, then you need to forward TCP port 5901 from the router to this machine.

    Note about security: This setup allows any user to start an X-session remotely by logging in using his regular password (after starting the VNC connection using the VNC password), so if the user disconnects without logging out, any other user which knows the VNC password can connect afterwards and resume the same session that the first user started. So if you do not want to log out before disconnecting, it's advisable to at least lock your VNC X-session screen. Also note that while a remote user is connected thru VNC, no other connection will be accepted. An idle VNC client will be disconnected after one hour, but this can be changed by using the "-IdleTimeout" option in the server_args line in /etc/xinetd.d/Xvnc. For example, you can add "-IdleTimeout 300" to change it to 5 minutes.

  9. #69
    Join Date
    Feb 2005
    Beans
    56

    Re: HOWTO: Set up VNC server with resumable sessions - KUBUNTU VERSION

    Anyone have this working in lucid kubuntu?

    as user i get fail with

    Code:
    vncviewer localhost:1
    
    VNC Viewer Free Edition 4.1.1 for X - built Apr  9 2010 18:41:55
    Copyright (C) 2002-2005 RealVNC Ltd.
    See http://www.realvnc.com for information on VNC.
    
    Mon Jul 26 20:18:13 2010
     CConn:       connected to host localhost port 5901
    
    Mon Jul 26 20:18:14 2010
     main:        read: Connection reset by peer (104)
    as root

    Code:
    root@prospero:/home/michael/.ssh# /usr/bin/Xvnc :2 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd
    
    Xvnc Free Edition 4.1.1 - built Apr  9 2010 18:47:36
    Copyright (C) 2002-2005 RealVNC Ltd.
    See http://www.realvnc.com for information on VNC.
    Underlying X server release 40300000, The XFree86 Project, Inc
    
    
    Mon Jul 26 20:14:07 2010
     vncext:      VNC extension running!
     vncext:      Listening for VNC connections on port 5902
     vncext:      created VNC server for screen 0

    what i can see on root test is it looking for connection on port 5902 but in Xvnc config file it is set to 5901?


    cheers

Page 7 of 7 FirstFirst ... 567

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
  •