• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2651
  • Last Modified:

VNCServer does not start automatically

I want the VNCServer to run automatically when the computer boots up.
My box is a Linux Fedora 2 OS.

I have VNCSERVER selected in Service Configuration window, but it still doesn't run when I bootup.

I have to first logon, and then start it up on the commmand line.

How can I set it up so that it starts before logging on?
0
Axter
Asked:
Axter
  • 6
  • 4
  • 3
  • +1
2 Solutions
 
yuzhCommented:
Please read the instructions in "VNC-On-Bootup":

http://wiki.colinux.org/cgi-bin/VNC-On-Bootup

also:
http:Q_21303449.html
0
 
AxterAuthor Commented:
I got it working on bootup for a single instance, however I was trying to set it up so that I can launch three different sessions.

I modified config file to the following:
VNCSERVERS="1:axter"
VNCSERVERARGS[1]="-geometry 1280x1024"
VNCSERVERS="2:root"
VNCSERVERARGS[2]="-geometry 800x600"
VNCSERVERS="3:axter"
VNCSERVERARGS[3]="-geometry 1280x1024"

However, only the last session works (3:axter).

How can I get three sessions setup?
0
 
yuzhCommented:
The problem is the ENV var VNCSERVERS has the same name, 3:axter is overwritten the
previous 2 instance.

You need to modify the startup script to make it work.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
pjedmondCommented:
/etc/rc.d/local

is run automatically on  my RH system, I just stick the following commands in:

vncserver :1 -name axter -geometry 1280x1024
vncserver :2 -name root -geometry 800x600

This will run as root - for running as other users use sudo or su command in the commans line.

HTH:)
0
 
AxterAuthor Commented:
pjedmond,
I just tried that, but i had no effect.
0
 
AxterAuthor Commented:
>>You need to modify the startup script to make it work.

Which startup script?
0
 
pjedmondCommented:
Is /etc/rc.d/local actually being run at startup?

If you want an easy way to check - just add:

touch /home/myhome/touched.file

to the script

ls -al will then tell you when the file was created (obviously the file wont exist if the script wasnt run.
0
 
pjedmondCommented:
Does running the command in a terminal window:

vncserver :2 -name root -geometry 800x600

run as root actually start up a vncserver process.

If it does then the vncserver bit works and we need to concentrate on how you are getting it to run. If it doesn't then we need to look at the command lines you are using for vncserver, or your apporach to using su/sudo to get the instances running as the correct users.

HTH:)
0
 
AxterAuthor Commented:
>>touch /home/myhome/touched.file

That command does not create the file, so /etc/rc.d/local must not get called on Fedora.

The /etc/rc.d/local  file didn't even exist until I created.

>>vncserver :2 -name root -geometry 800x600
The above command works with no problem when I run it from the command line.


0
 
pjedmondCommented:
If it didn't exist, then it is possibly called /etc/rc.d/rc.local on your system.

Mine looks like this:

--------------------------------------X8--------------------------
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
                                                                                                #<------------Add the vncserver stuff here.

--------------------------------------X8--------------------------


HTH:)
0
 
AxterAuthor Commented:
Thanks,
I'll take a look at this tonight when I get home.
0
 
yuzhCommented:
Just in case you still have problem with VNC start up, you can use the following script:

#!/bin/sh
#
# Startup/Stop script for vncservers for some users.
#
case "$1" in

'start')
   /bin/su - axter -c "/path-to/vncserver :1 -name axter -geometry 1280x1024"
  /path-to/vncserver :2 -name root -geometry 800x600
   /bin/su - axter -c "/path-to/vncserver :1 -name axter -geometry 1280x1024"
  # 1st and 3rd running as user axter, end run as root, if you want to run then
  # as root just make it looks like 2nd line
   ;;
'stop')
   /bin/su - axter -c "/path-to/vncserver -kill :1"
   /path-to/vncserver -kill :2
   /bin/su - axter -c "/path-to/vncserver -kill :3"
   ;;

*)
   echo "Usage: /etc/init.d/rc.vnc { start | stop }"
   ;;

esac
exit
# End of the script

Please remember to replace /path-to with the REAL path, type in:
which vncserver
to find out.

Save the script in /etc/rc3.d and name it S99myvnc (It is important to start with a Uppercase
"S" for the filename, you can change mynvc to whatever you like)

then set the file permmsions:
chmod 750 /etc/rc3.d/S99myvnc

To test it login as root:
/etc/rc3.d/S99myvnc start

To stop all the vnc
/etc/rc3.d/S99myvnc  stop

you can also reboot the box, and they should come out.

0
 
AxterAuthor Commented:
Thank you both for the help.

I decided to leave it with just the single instance, since trying to setup the additional instances was taking up too much of my time.
0
 
ajos1Commented:
The reason why it does not auto start.... is that you have to set the passwords... after that point it will autostart after reboot.  (Well it did for me).
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 6
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now