Running Unix Software in Graphical Mode by zwj23860

VIEWS: 9 PAGES: 6

									               Running Unix Software in Graphical Mode
The ITCS Statistics and Computation Service (SCS) provides machines on which you
can run various statistical, mathematical, geographical, and other scientific software
from a remote location. The SCS machines run the Unix operating system. Unix
software is often run in either command-line mode, where you are presented with a
text interface to type in commands, or batch mode, where you put the commands
you wish the software to run into a file, then instruct the software to “Just Do It”.
Many of the programs also have a graphical interface that uses windows, much like
the Windows (from Microsoft) versions. This document will show you step-by-step
how to run a Unix program in graphical mode from an ITCS Public Sites machine.


                                   The Theory
When you run Unix software on a machine other than the one at which you’re sitting,
special arrangements have to be made so you can see what’s going on. This is done
in two parts. The first part opens a session on the Unix machine into which you type
commands, such as the command to start the software in which you’re interested.
The second part starts a program on the machine at which you’re sitting that
understands the display being sent back to you from the Unix machine. Unix
machines use X Windows to communicate displays to another machine, so we need
to start an X Windows. We will use the SSH client for the first part, and we’ll use
eXceed for the second part.

                                   The Practice

Setting up the X Windows Server
Let’s set up the X Windows server first. It’s easy. We just start the program. Go to
the Start menu, then to Programs, then to Utilities, then to Terminal Services, then
to Exceed, and, finally, click the Exceed icon.




You’ll see the Hummingbird logo flash by, and when Exceed starts, the only evidence
will be a box labeled Exceed in the toolbar at the bottom of the screen, and an
Exceed toolbar which will normally go near the upper-left corner of the screen.
This box stays on top of all the windows you open from now on, and you will
probably not need anything that is on it, so it is safe to close it by clicking the box in
the upper-right corner.


Configuring SSH to Tunnel X Windows
We are going to use SSH to connect to the Unix server, but first we need to make
sure that it knows to set up a secure tunnel for the display to get back to our
machine. So, we first start SSH by going to the Start menu, then Programs, then
Internet & Email, then click on the Secure Shell Client icon.




This will start SSH. Click on the “Statistics Login” button




which will bring up the login window.




Press cancel, because we need to change the configuration before we make the
connection. In the SSH window, click on the Edit menu, then Settings.
This will open the Settings window. From the list on the left side, click on Tunneling.




You want to make sure that, on the resulting screen, the box labeled “Tunnel X
connections” is checked.




Click the OK button.
Using SSH with X Windows Software
Now we’ll log into the SCS server. Click on the “Statistics Login” button again on the
SSH toolbar, which will the bring up the connection dialog box again.




Enter your uniqname in the User Name box. Press the Connect button. Another
dialog box will pop up asking you for your password, which you should enter and
click the OK button (or press the Return key).

That should put you into a session on the SCS server, and you can now test to see if
the X Windows tunnel is working.




At the prompt, type

xclock
and a clock should appear in the upper-left corner of your screen.




To close the clock, type

Ctrl-C

in the SSH Terminal Client window, or you can click on the close button (with the ×
on it) on the clock window itself. If you click on the close button, you will get a box
telling you that this may end your X client session. This always happens because the
X Server has no way to tell the difference among windows. So, for example, this
might happen if you are running a program that opened a separate window in which
to display a graph, and you click the close button. You’ll have to judge whether it is
OK each time. It mostly will.


Background versus Foreground
Most programs, when you run them, will not get out of the way and let you type
additional commands at the prompt in the SSH Client window. This can be annoying.
To prevent this, you can run those programs in the background by putting a space
and an & character at the end of the line that contains your command. So, for
example

xclock &

will start the xclock in the background. Background jobs are assigned a job number
and a process number when they start. Suppose that the terminal output looked like
this.

bennet:pong% xclock &
[1] 23353

The job number is the number inside the brackets, and process ID is the second
number. If one of your graphical programs freezes up for some reason, you can use
one of those to stop it. For example, we started a background xclock. If we want to
end that job, we would use either

kill %1

or

kill 23353
to stop it. Suppose, instead, that it was something like Stata, or Matlab, and it
stopped responding to the mouse and the keyboard. You would be able to use the
kill command to stop the Stata or Matlab job without logging out.

For programs like Stata or Matlab that have menus (unlike our clock), you should
always try to exit your programs by using the appropriate exit menu, which is
usually under the File menu. Once you have closed all of the programs that are
using X Windows, you should return to the SSH Client window and type

logout

Exceed will be stopped automatically when you log out of the Windows machine.

Further Information
Additional information about what programs are available is at
http://www.umich.edu/~gpcc/scs/
If you have questions about the software, you can send e-mail to
scs-admins@umich.edu

								
To top