Using X-Windows at CCBB

Introduction

X-Windows or X is the UNIX graphical user interface.  While it is not as "pretty" looking as Mac, and Windows it does have features that are powerful one of which is the separation between where an application is running, and where it is displaying.  The server that is running the application is known as the X-windows client, and the location where the windows of the application are being display is known as the X-server.  There is nothing that says that the server, and client have to be the same piece of hardware which gives you the ability to access remote applications from your desktop.

There are two approaches to running an X application.  First, you can run X-server software on your computer.   In fact, if you are logged into a desktop or laptop running Linux, you will already be using X and running an X-server.   PC and Mac users can download X-server's though.   With an X-server, you can use ssh to connect to the remote system, and then run X capable applications which will display their windows on your computer.   The problem will be that if you disconnect from the remote system, then the X application will also be terminated.  The second approach is to use Virtual Network Computing or VNC.   With a VNC connection you get the full Linux desktop environment, and you can also disconnect from a session and reconnect later.

Please follow all instructions for doing setting these instructions so as to ensure that your network traffic is properly secured.

X-Server Approach

VNC

To use VNC, you will need a VNC client downloaded onto your local computer. Start by logging into the remote system using ssh (these instructions assume the host is named host.ccbb.utexas.edu). Run the command,

vncserver --localhost

this ensures that the VNC connection will not be available out to the Internet. The first time that you do this, you'll be be prompted for a password, or you can run vncpasswd to set it. Please pick a strong password that is different from your real EID password, and from the password that you use for the system. The system will respond like this:

New 'host:1 (user)' desktop is host:1

Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/host:1.log

Before logging in, you will want to open the file mentioned above (xstartup) in an editor. At the top you will see the lines

 # unset SESSION_MANAGER
 # exec /etc/X11/xinit/xinitrc

which you will want to make active by removing the #. If you do not do this, you'll be placed into a very dumbed down X windows manager called twm. This is very low bandwidth which might be good in some cases, but can be painful to use. Unless you know what you are doing don't change anything else in the xstartup file.

Now you are ready to log in to the remote system again. This time you will want to use a local SSH tunnel from port 5901 on your local computer to port 5900 + N where N is the desktop number mentioned above (5901 in this example case). If you are using a GUI ssh client, you'll need to look in the various options for how to do this. If you are using Terminal.app on a Mac, or if you are a Linux user you can just type

ssh -L 5901:host:M user@host.ccbb.utexas.edu

replacing M by the number that you calculated above (5900 + N). Once this is done you can use your VNC client software to connect to the host localhost:5901 which will then connect you, via the ssh tunnel you just created, to VNC server running on the remote software. When you are done you can close your VNC client, and log out of the above ssh connection to shut down the tunnel. This leaves your VNC server session running so that you can connect later, and resume work. If you are done using VNC then you should stop your server so that you free up resources for others to use. This can be done with the command

vncserver -kill :N

Again N is the number of the desktop.