VNCServer Startup Config

Home » CentOS » VNCServer Startup Config
CentOS 5 Comments

hi all,

I’ve inherited a server with CentOS 6.4

the VNC Server starts up with the OS and its screen resolution is set to
800×600.

I found that I can set the resolution by specifying the -geometry switch, but I can’t find where the call to start the VNCserver is set in order to change it.

I know that it’s not in /etc/xinetd.d (the only file there is rsync)

here are the contents of ~/.vnc/xstartup

#!/bin/sh

[ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n export LANG
export SYSFONT
vncconfig -iconic &
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = ‘Linux’ ]; then
case “$WINDOWMANAGER” in
*gnome*)
if [ -e /etc/SuSE-release ]; then
PATH=$PATH:/opt/gnome/bin
export PATH
fi
;;
esac fi if [ -x /etc/X11/xinit/xinitrc ]; then
exec /etc/X11/xinit/xinitrc fi if [ -f /etc/X11/xinit/xinitrc ]; then
exec sh /etc/X11/xinit/xinitrc fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
twm &

any thoughts? TIA

5 thoughts on - VNCServer Startup Config

  • Could it be started via an init.d script? That’s how we do ours…

    Thanks!
    Miranda

  • No worries, we all have to start somewhere.

    With CentOS 6.4, your init.d files should be located in /etc/init.d, which is a link to /etc/rc.d which contains all the hardlinks created by the chkconfig system. There might be a call in /etc/rc.local to run a vncserver if the person who set up the system did not have a dedicated init.d script.

    In our case, we have a server that starts a dozen VNC servers when it boots and so it made more sense to set up a proper init.d script that uses the “service VNC_setup start|stop” syntax.

    I suggest, if you are planning to set up a proper init.d script, that you take a look at the man pages for init, chkconfig, and service. They should give you enough information to become reasonably familiar with how the system works and will also point you at some helpful additional reading. Also, use one of the simpler init.d scripts as a template and make modifications to point your new script at the appropriate VNC
    binaries, with whatever arguments you need.

    Thanks!
    Miranda

  • Look in /etc/sysconfig for VNCservers. That file contains VNC server startup definitions. Once you have modified /etc/sysconfig/vncservers you can start and stop your VNC server(s) using ]# service VNCserver start.

    To make it start automatically upon reboot, run ]# chkconfig VNCserver on.

    Emmett

  • thank you for all the info. the VNCServer starts with a CRON job on that machine. seems a little unorthodox but it works for now. I’ll probably change it once I figure out what’s what on that server.

    thanks,

    Igal