?
Solved

VNCServer does not start automatically

Posted on 2005-03-07
14
Medium Priority
?
2,645 Views
Last Modified: 2011-09-20
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
Comment
Question by:Axter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 3
  • +1
14 Comments
 
LVL 38

Accepted Solution

by:
yuzh earned 1600 total points
ID: 13483687
Please read the instructions in "VNC-On-Bootup":

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

also:
http:Q_21303449.html
0
 
LVL 30

Author Comment

by:Axter
ID: 13483830
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
 
LVL 38

Expert Comment

by:yuzh
ID: 13484300
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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
LVL 22

Expert Comment

by:pjedmond
ID: 13484707
/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
 
LVL 30

Author Comment

by:Axter
ID: 13485135
pjedmond,
I just tried that, but i had no effect.
0
 
LVL 30

Author Comment

by:Axter
ID: 13485138
>>You need to modify the startup script to make it work.

Which startup script?
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 13485164
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
 
LVL 22

Expert Comment

by:pjedmond
ID: 13485183
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
 
LVL 30

Author Comment

by:Axter
ID: 13485465
>>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
 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 400 total points
ID: 13486230
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
 
LVL 30

Author Comment

by:Axter
ID: 13489964
Thanks,
I'll take a look at this tonight when I get home.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 13493395
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
 
LVL 30

Author Comment

by:Axter
ID: 13524276
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
 
LVL 1

Expert Comment

by:ajos1
ID: 14856097
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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question