Linux - NewbieThis 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
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.
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.
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.
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:
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.
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.
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:
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.