Find the answer to your Linux question:
Results 1 to 5 of 5
Does anyone know if VNC server can be run as a daemon at server startup, as opposed to being run in a client session?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Posts
    3

    VNC Server


    Does anyone know if VNC server can be run as a daemon at server startup, as opposed to being run in a client session?

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,875
    Yes, edit /etc/sysconfig/vncservers, you want to put in it something like:

    Code:
    VNCSERVERS="1:<username>"
    VNCSERVERARGS[1]="-geometry 800x600 -depth 24"
    And for the user you specified with <username> make a .vnc directory in their home directory, and make a file in it called xstartup which contains the line 'startkde' or 'gnome-session' depending on your preferences. This directory and file should be owned by the user. Make sure that the xstartup file is user and group executable (i.e. 'chmod ug+x xstartup').

    Make sure you run the vncpasswd tool as that user before starting the vnc service.

    Start off the vnc server with this (as root):

    Code:
    service vncserver start
    Once it's up and running, you can connect with 'vncviewer :1' in this case (or it depends on the screen number you chose). You should also be allowed to connect to it remotely using the machine's hostname. If you cant, then check the Fedora firewall settings to allow connections on port 590x, where x=the screen number.

    If you want it to run whenever you boot up, then dont forget to add the service startup to your usual runlevel.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Aug 2006
    Posts
    3
    Many thanks for your help. All instructions followed VNC works, except:

    "service vncserver start"

    which reports: "unregonized service"

    Is there something else I must do?

    In addition, can "service vncserver start" be started from a telnet session?

    I managed to get the vncserver to run when I log on the terminal by adding vncserver to:

    applications - more preferences - sessions - start up programs

  4. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,875
    Your service scripts should be in /etc/rc.d/init.d - there should be an executable script in there called 'vncserver'.

    If there isn't, then you could try re-installing the vnc-server package using yum.

    If it is there, you could try running it directly (this is all the 'service' command does anyway) with the 'start' parameter, i.e. '/etc/rc.d/init.d/vncserver start'.

    Yes you can run it from a telnet session, but you need to be root - so I dont advise doing that; use an ssh session. If you run this as a service, you can leave your vnc session running and connect to it as needed without the need to log in seperately.
    Linux user #126863 - see http://linuxcounter.net/

  5. #5
    Just Joined!
    Join Date
    Aug 2006
    Posts
    3
    Thanks again for your help. Unfortunately, yum said it could not find any references for vncserver, and I'm not proficient enough yet to set-up a SSH environment, so I'll have to put vncserver service on hold, for the moment, until I am.

    Regards...

Posting Permissions

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