Starting a vncserver instance automatically at startup
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Gentoo, Redhat 9, SuSE 9.0, 9.2, Win XP
Posts: 149
Rep:
Starting a vncserver instance automatically at startup
I am having immense problems automating a simple scrip to start an instance of vncserver at when my machine starts up. Any clues of where to put the script file would be great.
On your RH (and I guess your SuSE also) you can set vncserver service to start by running serviceconf (in GUI) or chkconfig at CLI. Syntax for chkconfig is:
Distribution: Gentoo, Redhat 9, SuSE 9.0, 9.2, Win XP
Posts: 149
Original Poster
Rep:
Well, this is actually not the problem. The service starts fine when the machine boots up. I need to start a VNC session eg ServerName:1 automatically. Any ideas on this would be helpful.
Distribution: Gentoo, Redhat 9, SuSE 9.0, 9.2, Win XP
Posts: 149
Original Poster
Rep:
Nope. This is not it. I am sure I should be able to run a simple start up script. I tried one from /etc/rc.d/script but obviously there is something fundamental that I do not yet understand.
Go to /etc/. (Hopefully) you'll find a folder rc.d and in it rc1.d-rc6.d. Just
put a script in the appropiate* folder, which contains something like
/wherever/it/is/stored/vncserver - don't forget to chmod +755 or whatever
it.
Name of the script can be derived from the other files in the folder, they're
usually something like S<twodigits><processname>, eg. S27vncserver.
Instead of a script you may also use a symlink, example
ln -snf /wherever/it/is/stored/vncserver /etc/rc.d/rc3.d/S27vncserver
BTW as which user did you install VNC? If you installed it as another
user than root, you'll probably run into the problem that the system will
try to execute the script/link in /etc/rc.d/... as root, but vncserver will
not find its config files in /root/.vnc.
*numbers refer to the runlevel. Not sure if the system goes through all
the folders, but if you enter >runlevel< at the console (after booting) and it comes back with 3, you should be fine with putting it into rc3.d.
you could also put in some script lines in /etc/rc.d/rc.local (for RH, anyways. don't know about suse). rc.local executes after all the other startup scripts execute. It is good for simple stuff.... like a one liner to start up a vnc instance.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.