VNC allows you to open a graphical session with a remote computer. The session offers the complete display of a login session, as if you were physically sitting in front of the computer. VNC uses efficient compression techniques to send graphics over the network. These two facets of VNC make it more functional, and more efficient than running remote X Windows applications. You can read more about VNC at www.realvnc.com .
In a Windows cmd window type:
ssh -l <userid> melodic.ucdavis.edu
where <userid> is your login ID.
ps ax | grep Xvnc | grep <userid>
melodic> runvnc
5909
The number that appears (in this case 5909) is the port number that your instance of the VNC server will be using. Your display number is 5909-5000, i.e. 9.
vncserver -geometry 1200x800 -depth 16 :xx
where xx is the display number. Geometry defines the size of the VNC window (in pixels) and can be set to whatever you want. Depth defines the number of bits used to represent color.
ssh -l <userid> -L 59xx:melodic:59xx melodic.ucdavis.edu
where <userid> is your login ID, and xx is your display number, in this case 09. This step established port forwarding.
Click on the VNC client icon on the desktop, and connect to localhost:x, where x is your display number. If it is less than 10, then it is just a single digit, i.e. 9 instead of 09. Enter your password for your VNC sessions and you should be all set. If you are using Chicken of the VNC on a Mac, then only type localhost into the host field and x (your display number) into the display field.
vncviewer <hostname> via=<hostname> :xx
Shared=1
to the command if you want to
share access to the same VNC session with other computers.runvnc -kill :xx
where xx is your display number.
ps ax | grep Xvnc
The command 'ps' will generate a list of processes you are running. The '|' sign will "pipe" the output of the ps command to the 'grep' command which will search for and display those lines containing the expression "Xvnc". On those lines, you will see Xvnc followed by :x, where x is your display number. Xvnc is the unix process that runs the VNC server session. Now that you have the display number you can either kill your Xvnc session or connect to it from your VNC client.
You can further narrow the list of Xvnc process to show only yours by typing
ps ax | grep Xvnc | grep <userid>
where <userid> is your login ID.