Since I use VNC intensively, I needed to automaticly start VNC session when the Linux machine comes up, a lot of posts in the internet explains how to hack gdm, init.d services, rc.local, etc.. but it seems that VNC developers already thought about this and here is the simplest way:
1. Edit /etc/sysconfig/vncserver and include the line VNCSERVERS="sessionnumber:myusername"
VNCSERVERARGS="-geometry 1016x710 -nolisten tcp -nohttpd"
2. Enable vncserver on runlevel system services, run: chkconfig vncserver on
That's it, you can try to reboot your machine and check how VNC session is automatically up!
o If you're having troubles to launch a graphical (kde/gnome) vnc session, you need to change your ~/.vnc/xstartup file, here is mine:
# Uncomment the following two lines for normal desktop:
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 1024x768 -ls -title "$VNCDESKTOP Ali Ayoub Desktop" &
o Copy & Paste troubleshooting:
Copy and paste feature may be problematic in VNC, a work around that worth checking is to run manually: vncconfig -iconic &
I tried to add this line to xstartup but it doesn't seem to solve the problem, I had to run it manually after the VNC session is open, and only then copy and paste between VNC session (Linux) and Windows work!