By doublejoon at 2004-09-02 10:37
VNC Server Quickstart Instructions
I performed this on Red Hat Advanced Server 2.1 and Fedora Core 1 and 2. It should work on Red Hat 7.3, 8,9 and Enterprise 3.
Note: I would only recommend using VNC between hosts behind a firewalled environment. Passwords are transmitted in clear text.
If you simply must use VNC to use a GUI remotely outside of a firewall I would recommend connecting via SSHv2 to the VNC Server, then initiating VNC inside the SSH Tunnel.
On VNC Server machine with vnc-server installed
1)Type vncserver -geometry 800x600 (or whatever resolution you prefer)
2) There will be a session number displayed .This will create a .vnc directory in your home directory. (/home/yourself/.vnc)
3) Type cd /home/yourself/.vnc
4)Type ls -alc
-You should see a script called xstartup
5)Type vi xstartup or use whatever text editor you prefer
-This is where we will setup your vnc session to use your window manager of choice
-Find the section where it says twm & and replace it with your choice. I know there are more, but these seem to be the most popular ones. Don't include what I have in the parenthesis
-startkde & (used for the KDE window manager)
-exec gnome-session & (used for the Gnome window manager)
-startxfce4 & (used for the XFCE4 window manager, my favorite choice)
6)Now type vncserver -kill:1 (1 is our session number)
-This stops the VNC Server so that the xstartup script we just edited can be re-read when we restart the server
7)Type vncserver (to start the session back up)
8)Type ps ax | grep vnc (check if your session is up and running)
Let's connect to the VNC Server!
From a Linux Box with the vncviewer package installed
1)Type vncviewer hostname or IP address:1 (1 meaning whatever session number you chose)
2)Enter your Linux local account password assigned on VNC Server machine
From a Windows Box with TightVnc or RealVnc client installed
1)Start your VNC client and type the VNC Server hostname or IP address:1 (1 meaning whatever session number you chose)
From a Java Enabled Browser on any platform (not the best but it works)
1)Type http://IP address of VNC Server:580x (x will indicate session number)
ex..http://192.168.1.6:5801 ( for session 1)
ex..http://192.168.1.6:5802 ( for session 2)
1)I keep getting new session numbers every time I type vncserver. I just want session 1 running
-By default each session is still active even after disconnecting from remote vnc session. -You only type vncserver if you want to use multiple sessions
-You can kill the extra sessions by typing vncserver -kill:session number or ps ax | grep vnc to see which sessions are running, then type kill -9 ID number of the session you don't want
-If it all gets messed up you can start over with the sessions by typing rm -rf .vnc in your home directory on the VNC Server machine. Then go into your /tmp/.X11-unix directory and remove X1,X2...etc for each session number (Don't try and remove the X0 file!)
repeat steps 1-8 on the VNC server machine setup
I'm still a N00b on this Linux stuff (just 2yrs). I found this procedure fairly easy for successful VNC Server deployment. Have at it!!!