LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-30-2007, 10:06 AM   #1
Seawolf1
LQ Newbie
 
Registered: Jan 2007
Location: State College, PA
Posts: 6

Rep: Reputation: 0
starting vnc at boot


I have vnc working only when I login as root. The file xstartup is located in the /root/.vnc directory. I have changed the /etc/re.local script with a call to run the xstartup, but it still does not start at boot. Any ideas would be greatly appreciated.
 
Old 01-30-2007, 10:23 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,474

Rep: Reputation: 189Reputation: 189
I believe X has to be up and running before you can start VNC. That's why your rc.local edit did not work; X starts after rc.local runs. Please post the distro you are using and the DE(kde, gnome, etc). The way X is started varies from distro to distro and different DEs have different built in mechanisms for autostarting apps when they are started.
 
Old 01-30-2007, 10:59 AM   #3
Seawolf1
LQ Newbie
 
Registered: Jan 2007
Location: State College, PA
Posts: 6

Original Poster
Rep: Reputation: 0
I'm running Redhat kernel 2.6.9-42.0.3.ELsmp
 
Old 01-30-2007, 12:08 PM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,474

Rep: Reputation: 189Reputation: 189
Looks more complicated than I initially thought. However, I found this for starting vnc on boot in CentOS which is a direct knockoff of RHEL and fedora:

http://forums.whirlpool.net.au/forum...fm/492488.html

http://www.g-loaded.eu/2005/11/10/co...ver-in-fedora/

The fedora howto looks especially good and should get you going. You will want to get rid of the xstartup edit in rc.local and reboot as this can apparently screw things up.
 
Old 01-30-2007, 02:16 PM   #5
Seawolf1
LQ Newbie
 
Registered: Jan 2007
Location: State College, PA
Posts: 6

Original Poster
Rep: Reputation: 0
Prior to your reply, I found my rc.local to point to /etc/vnc/xstartup. Seeing I did not wish to edit this file for fear of causing other problems, I created the /vnc directory and copied in the xstartup file. Lo and behold, now the system will not boot. It stops at HAL daemon and hangs. The only idea I have it to boot to the cd and fix. For some odd reason, I don't think this was the root cause.
 
Old 01-30-2007, 11:52 PM   #6
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,474

Rep: Reputation: 189Reputation: 189
I am having some difficulty following what you are trying to say. It is not clear from your post exactly what you did but it is clear you can no longer boot up. I would suggest getting a livecd and using that to reverse whatever you did to cause the problem. A nice one that's easy to use and not such a big download is slax:

http://www.slax.org/

There are many others, and they are generally easier to use than the install cd's rescue mode.
 
Old 01-31-2007, 01:54 AM   #7
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
You don't need X running on the server running VNC. Each user should run vncpasswd and should then customise their ~/.vnc/xstartup file. Here's mine:
Code:
$ cat .vnc/xstartup
#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 110x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
/usr/X11R6/bin/fluxbox &
To start the VNC server at boot, create a script in the directory where your other startup scripts live and call it from /etc/rc.d/init.d/local (or whatever Redhat calls the local startup script). For example (modify for your script's location):
Code:
if [ -x /etc/rc.d/rc.vncserver ]; then
  . /etc/rc.d/rc.vncserver start
fi
The /etc/rc.d/rc.vncserver script I use to start the VNC server is:
Code:
#!/bin/sh
#
# description: Starts and stops vncserver.

unset VNCSERVERARGS
VNCSERVERS="1:steve 2:oracle"
VNCSERVERARGS[1]="-geometry 1280x960"
VNCSERVERARGS[2]="-geometry 1280x960"

start() {
  echo -n $"Starting VNC server: "
  ulimit -S -c 0 >/dev/null 2>&1

  if [ ! -d /tmp/.X11-unix ]
  then
    mkdir -m 1777 /tmp/.X11-unix || :
  fi
  for display in ${VNCSERVERS}
  do
    echo -n "${display} "
    unset BASH_ENV ENV
    DISP="${display%%:*}"
    export USER="${display##*:}"
    export VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
    su - ${USER} -c "cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}"
  done
}

stop() {
  echo -n $"Shutting down VNC server: "
  for display in ${VNCSERVERS}
  do
    echo -n "${display} "
    unset BASH_ENV ENV
    export USER="${display##*:}"
    su ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
  done
  echo "Done."
}

# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart|reload)
    stop
    sleep 3
    start
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart}"
    exit 1
esac
Hope that helps...
 
Old 01-31-2007, 05:38 AM   #8
Seawolf1
LQ Newbie
 
Registered: Jan 2007
Location: State College, PA
Posts: 6

Original Poster
Rep: Reputation: 0
Thank you very much. In working with the server, there was a problem at the hardware level and I lost the boot drive. After correcting this at the scsi level, the server is having difficulty finding the boot partition, so I'm at the point of replacing the drive in question and reloading.

I will use your recommendations to load vnc. I greatly appreciate all of your replies for sure.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting VNC remotely dubya Linux - Networking 3 03-29-2006 01:52 PM
starting up vnc in mandrake nanjil Linux - Newbie 1 07-10-2005 10:32 AM
Starting VNC from Startup Ruler2112 Slackware 6 05-03-2005 04:40 PM
starting x in vnc maybbach Linux - Software 1 04-25-2005 09:56 PM
Starting X and a little VNC th3_d0c Linux - Software 1 08-19-2004 12:50 AM


All times are GMT -5. The time now is 10:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration