BIRCH

BIRCH

Using a Unix desktop remotely from a Mac


This tutorial assumes that you already have set up your Unix account to use vncserver.
See Setting up your Unix account to run vncserver.

1. Start a VNC session on the remote Unix server

Click on Finder:


Open Applications:


Find the Utitlities folder and open it:

Find Terminal and double click on it:


This will bring up a Terminal window:


In the terminal window, type the following:

ssh -l userid ccu.umanitoba.ca


If this is the first time logging in, you will receive a message that looks like the following:
The authenticity of host 'antares.cc.umanitoba.ca (130.179.16.26)' can't be established.
RSA key fingerprint is 79:f7:ca:14:31:43:1b:d6:3c:ca:77:5d:bc:07:e6:d4.
Are you sure you want to continue connecting (yes/no)?
Answer the message with "yes" (no quotes).

The terminal will ask you for your password, enter your password.

If you get a response from SSH that looks like:
Terminal type?
TERM =
type "xterm" and press the return key.


You should now be logged in.  If you are unsure for any reason, you can always check by typing:
echo $SSH_CLIENT
if this returns a blank line, you are not logged in, otherwise, you are logged in.

Now that you are logged in, type:
vncserver

You should receive a response that looks like the following:

New 'merak:3 (alvare)' desktop is merak:3

Starting applications specified in /home/u9/alvare/.vnc/xstartup
Log file is /home/u9/alvare/.vnc/merak:3.log


NOTE: the "merak:3" will be different for your VNC session.  "merak" refers to the hostname, it is short for "merak.cc.umanitoba.ca".  "3" refers to your desktop number.  Your hostname and number can be different each time you run VNC!  It is very important to remember your hostname and number each time you use VNC!

2. Set up port forwarding for a secure session

Go back to your terminal window, and type:
exit

Now type:
ssh  -L PORT:FULLHOST:PORT  FULLHOST  -l userid

In the above, replace PORT with 5900 + desktop number (e.g. if your desktop number was "3", as in the above example, your port is "5903"), and replace FULLHOST with your full hostname including ".cc.umanitoba.ca" (e.g. if your hostname above was "merak", as in the above example, your full hostname is "merak.cc.umanitoba.ca")

NOTE: The 5900 is always constant; however, the desktop number (in this case, 3) is randomly generated and will change each time!  The desktop number is obtained from the end of step 1 (i.e. when you ran "vncserver"

3. Installing Chicken of the VNC

If you already have installed Chicken of the VNC, you may skip this step!

Open the Chicken of the VNC website: http://sourceforge.net/projects/cotvnc/


Click the download button in the picutre above

Save the file, then go to your downloads (or desktop if using OS X 10.4 or older) and find the file cotvnc-20b4.dmg

Double click this file to "mount" the disk image:

You should now see a window that looks like the following:


Copy or move "Chicken of the VNC" into your Applications folder:


4. Connect to your VNC session using Chicken of the VNC

Find Chicken of the VNC in Applications and double click on it


If this is your first time, you may see a window similar to this window

Click the open button on this window.

Now you are in Chicken of the VNC, you should see a window that looks like the following:


Click the "+" button in the lower left hand corner, this will create a new server session entry:


Fill out the fields as such:
Host: localhost
Display: display_number
Password: vnc_password

Where display number is the display number vncserver gave us before, and vnc_password is our VNC server password.  This is the password you should have created the first time you ever ran "vncserver", and it asked you for a password.  If ever you forget your password, you can use vncpasswd to change your password.  If you want to run vncpasswd, you must run this on the remote host (via. Terminal SSH)


In our above example, we would fill out the window to look like this:



Click "Connect"



and voila!  You are now working on your CCU desktop remotely, using VNC!

MISSING LAUNCH BAR?

if your screen looks like this:




just hold down the "Control", "Alt", and "Command" keys, and press the "~" key

you should now see a message box that looks like the following



Click "Fullscreen", then hold down the Control, Alt, and Command keys, and press the "~" key again
 
TIP: if you have to use the "Control"-"Alt"-"Command"-"~" method, it may be a good idea to write this down, or make a file on your UNIX desktop.  The reason being to avoid the risk of getting stuck in Fullscreen mode.

You can log out and log back into your VNC session as often as you wish.

If you kill your vncviewer or your Terminal SSH session, the vncserver session is still running on the server.  For example, you could be in the lab working on a file in a vnc session, and decide to go home. You can kill your vncviewer  in the lab, and when you get home, login to the vncserver just as you did at the lab. The desktop in the vncviewer window will be precisely as you left it, with all programs open where they were, and the cursor in the same place as it was when you killed vncviewer.

The one thing to remember is to kill your vncserver session when you're done with it. It's easy to forget that you already have a session running, and start another session. Many programs, such as Firefox and mail programs, can encounter problems if you have multiple instances of those programs running simultaneously.

4a. Only, if you are unable to connect using step 4

If for some reason you are unable to connect, you may wish to try using your full remote hostname (e.g. merak.cc.umanitoba.ca) instead of localhost above; however, this is less secure than using localhost.


5. Terminate your VNC session when done

Although VNC is fairly secure, it's asking for trouble to be logged in, in any fashion, when you're not doing anything. When you're done,  kill the VNC session.

Example:  vncserver -kill :1

On BIRCH systems, you can also use the shortcut

vnckill  :1

Remember, if you launched  vncserver on mira, you must log into mira to kill the job. You can't kill it on merak, toliman, etc.

DO NOT LEAVE VNCSERVER RUNNING WHEN YOU AREN'T USING IT!

Aside from being a security hole, having numerous vncserver jobs running can sometimes confuse desktop systems such as GNOME, and can sometimes lead to corruption of configuration files.



Please send suggestions of comments regarding this page to psgendb@cc.umanitoba.ca