Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [SOLVED] Start VNC automatically in Kubuntu

  1. #1
    Join Date
    Jun 2008
    Beans
    38

    Unhappy [SOLVED] Start VNC automatically in Kubuntu

    I am trying to get VNC (server) to start automatically on my desktop running Kubuntu 8.04. I need to be able to graphically login without any local intervention. Our power company is rather inconsistent here, and we lose power fairly frequently. Another requirement is that I also need to be able to connect from both GNU/Linux and Windows XP.


    I have read numerous other pages and spent the better part of today searching these forums and Google How do I get this working without local intervention?

  2. #2
    Join Date
    Jun 2008
    Beans
    170
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Start VNC automatically in Kubuntu

    Do you know the command that starts the server? If so, just append it to ~/.bashrc, the shell script.
    !#> man women
    No manual entry for women

  3. #3
    Join Date
    Jun 2008
    Beans
    38

    Re: Start VNC automatically in Kubuntu

    Quote Originally Posted by gr4nf View Post
    Do you know the command that starts the server? If so, just append it to ~/.bashrc, the shell script.
    Then it would run every time a bash shell was spawned. I want it to kick off once when the computer boots, not with me having to login.

    The correct way, I thought, to do automatic loading was with a script in /etc/init.d/ and to use update-rc.d; however the x11vnc process does not continue running via that method (or at least with the script I had).

  4. #4
    Join Date
    Jun 2008
    Beans
    170
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Start VNC automatically in Kubuntu

    check your /etc/rc3.d

    it is possible that it is already there, created by the installer, but is not set to run.
    !#> man women
    No manual entry for women

  5. #5
    Join Date
    Jun 2008
    Beans
    38

    Re: Start VNC automatically in Kubuntu

    Quote Originally Posted by gr4nf View Post
    check your /etc/rc3.d

    it is possible that it is already there, created by the installer, but is not set to run.
    It wasn't. There was no init.d script created or run-level symlinks. I had to make those myself. I saw the script kick off in the framebuffer when Kubuntu was booting, but when the OS was loaded, the x11vnc process was not in memory (ps -ef | grep -i x11).

  6. #6
    Join Date
    Jun 2008
    Beans
    170
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Start VNC automatically in Kubuntu

    You could try this tiny one:
    Code:
    #!/bin/sh
    #
    # Startup/Stop script for vncservers for some users.
    #
    
    case "$1" in
    
    'start')
       /bin/su - bob -c "/usr/local/bin/vncserver :1"
       /bin/su - sally -c "/usr/local/bin/vncserver :2"
       /bin/su - jim -c "/usr/local/bin/vncserver :3"
       ;;
    
    'stop')
       /bin/su - bob -c "/usr/local/bin/vncserver -kill :1"
       /bin/su - sally -c "/usr/local/bin/vncserver -kill :2"
       /bin/su - jim -c "/usr/local/bin/vncserver -kill :3"
       ;;
    
    *)
       echo "Usage: /etc/init.d/rc.vnc { start | stop }"
       ;;
    
    esac
    !#> man women
    No manual entry for women

  7. #7
    Join Date
    Jun 2008
    Beans
    38

    Re: Start VNC automatically in Kubuntu

    Which package is that for? aptitude install ________

  8. #8
    Join Date
    Dec 2006
    Beans
    810

    Re: Start VNC automatically in Kubuntu

    Quote Originally Posted by mwjones View Post
    The correct way, I thought, to do automatic loading was with a script in /etc/init.d/ and to use update-rc.d; however the x11vnc process does not continue running via that method (or at least with the script I had).
    I think the best way is to start x11vnc in an "Xsetup" script. Then whenever the X server is started x11vnc is also started & attached to it. It shows the GDM/KDM/etc login screen.

    http://www.karlrunge.com/x11vnc/faq....isplay-manager

    Another option is inetd, but like any init.d scheme it needs to guess the DISPLAY (nearly always ":0") and XAUTHORITY (often has a random basename).

    http://www.karlrunge.com/x11vnc/faq.html#faq-inetd
    Last edited by krunge; January 28th, 2009 at 02:09 AM. Reason: the term "X session" is incorrect.

  9. #9
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Start VNC automatically in Kubuntu

    Have you tried the remote desktop software that comes with Ubuntu? You can enable it in System-->Preferences-->Remote Desktop.

    Just tried it from windows using vncviewer and it works quite well.

    I see you're on Kubuntu, but if you don't mind using a few gnome tools the programs you need are vinagre and vino

    Jim
    Last edited by cariboo; June 13th, 2008 at 05:15 AM. Reason: just tried it from windows

  10. #10
    Join Date
    Jun 2008
    Beans
    38

    Re: Start VNC automatically in Kubuntu

    krunge: Thanks so much, your doc had the piece I needed. Here is the line:

    /etc/kde3/kdm/Xsetup
    Code:
    x11vnc -forever -rfbauth /home/xyz/.vnc/passwd -bg -o /var/log/x11vnc.log
    From another doc, I already had a couple commands in that file as well as Xsession. But commenting out the previous commands, and just adding the one above has made it work correctly. Thanks!


    cariboo907: Thank you for your suggestion and testing as well. Those apps would have been my next move in the process.

    Cheers,
    mwjones

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •