Thursday, January 1, 2009

Set up vnc server on Fedora

It's been painstaking for me to set up Xvnc server on my Fedora 10 Linux server, so here I summarize the steps for future references.

1. Download and install the tightvnc-server rpm package from tightvnc web site.
2. I've got the following error now when I try to run the command "Xvnc". Unfortunately I have to download and install the font rpm package, xorg-x11-fonts-misc.
Could not open default font 'fixed'
3. Create the folder, /usr/X11R6/lib/X11/fonts.
4. Create the soft link as below,
ln -s /usr/share/X11/fonts/misc /usr/X11R6/lib/X11/fonts/misc
5. Set the vnc password with the command "vncpasswd". The maxim password length is 8!
6. Edit $HOME/.vnc/xstartup and comment all the lines. Add the desktop session that you want to start. For example,
startkde (if you want to start KDE)
gnome-session (if you want to start GNOME)
7. Start Xvnc with the command "vncserver",
- Edit /usr/bin/vncserver and add the fontPath environment variable if necessary. In our case, it's "/usr/X11R6/lib/X11/fonts". Moreover, you need to add Write permission to this file before editing it.
8. Check the firewall settings and open the 5801/5901 (5802/5902, etc.) ports, if necessary.
9. On the client, access the Xvnc server via VNC Viewer at the port 5901, or http://:5801 from the browser.

Notes:
- VNC authentication is based on a common password only. If you want to access the desktop with whichever user's session, edit xstartup in that user's home directory. For example, if you run "vncserver" from root's session, edit /root/.vnc/xstartup, run "vncserver", and then remote users will log onto root's desktop. Similarly, if you start vncserver from the user ''s session, edit xstartup at /home//.vnc accordingly.
- Run the command below to kill a vnc process

vncserver -kill :
vncserver -kill :1 (example, kill the first vncserver process at display 1 and port 5901)

No comments: