Controlling you VNC display

When you obtain an account on the CCH computer, you will be assigned a display number. Under Unix, many users can use the graphical environment, but unlike under Windows, each user can use a different virtual graphical desktop environment and use it simultaneously with other users. The different desktop environments are kept separate, which is accomplished by each user a different display number. The display number is assigned initially by the system administrator using the vncadmin command.


/usr/sbin/vncadmin {add|info|list|remove} [user]
Once logged into the CCH resource, you will need to set up a password for your account, and for the VNC server. To set up a password, just enter the command passwd at the terminal prompt:
[user@cch ~]$ passwd 
The password will not be echoed on the screen. Type it in twice, the second time for verification. Next, you need to set up a password for the VNC server. For that, use the vncpasswd command. You can reset your password anytime you like by repeating these commands. Next, start your VNC server for the first time. Once it is running, it should stay running forever, or until the machine is rebooted or the server is stopped manually, or in case you have to reset it. This is done with the vncctl command. The vncctl command is used to start, stop or restart your VNC display. It has to be run under 'sudo', and if you have been assigned a display, you can start this command. If you forget to use 'sudo' to start it, you will see an error:
/usr/bin/vncctl: must be run as a user (not root) and with a sudo prefix
Hence, use it with the sudo prefix:
sudo vncctl {status|start|restart|stop|enable|disable}
To start your VNC server for the first time, use:
sudo vncctl start
This will result in your display being started, with the following message:
vnc port for user user is :1
for ssh tunneling use numerical port 5901
Please note the display number (":1" in this case), this will be the display or port number you will need to connect. VNC ports start with "5900" for display ":0" and go up from there. Display :10 would be port 5910. Display ":0" is reserved for the console display, i.e., the monitor physically connected to the computer, and it is typically not served through VNC.

To check the status of your VNC server, use:

sudo vncctl status
To stop your VNC server, use:
sudo vncctl stop
To restart your VNC server in case it needs resetting, use:
sudo vncctl restart
Please be aware that stopping or restarting will kill all running programs in your desktop environment, and if you have anything open, you will likely loose any data that have not been saved.