Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

UNIX/LINUX HELP This assignment checks to see if you can run an X server and use it to connect to Unix machines on the CS

UNIX/LINUX HELP

This assignment checks to see if you can run an X server and use it to connect to Unix machines on the CS network.

Obviously, you will need to be working at a machine on which an X server or X2Go client package has been installed.

Important: Do not use remote desktop to the Virtual PC lab and run X from there. You are getting all of the disadvantages of X and of the remote desktop protocol combined, and few of the benefits. You need to install an X server on your local PC or on a flash drive. The only circumstance in which you should run X on the Virtual PC lab is if you do not have permission to install software on your local PC nor to launch programs on it from a flashdrive.

The whole point to teaching you how to use X is to set you up so that, in your future courses, when you need to use graphics-mode Linux tools, you can do so without suffering from poor graphics quality and slow speed. Running X from a machine that you are already running remotely under a different protocol wont do that for you.

Start the X server (or X2Go client) on your local machine, and open an xterm (an X client) on one of the CS Dept Linux machines.

(Exactly how you do this will depend upon what X server package you are using and how it has been set up.)

Once you have an xterm running, open a second one by typing the command

xterm -bg black -fg grey -geometry 80x16 & 

(The change of colors will help keep track of which xterm is which.)

Notice that you can enter additional commands (e.g., ls) into either xterm window at this time.

In the second xterm (the black background), give the following command:

xterm -bg Wheat -fg Navy -sl 1000 -sb -geometry 80x32 

(Note that you may be able to copy and paste this command from this web page into your xterm by selecting the above text with your mouse, doing a copy (^c, or however your browser defines it), then in the xterm either clicking the middle mouse button (or wheel) if you have one or clicking both mouse buttons if you have a two-button mouse. Shift-Insert works on some PC-based servers. If none of these work, check your X server documentation for ways to enable this behavior.

Notice that, while you can enter commands in the new xterm (wheat background), you cannot enter anything in the black one. Thats because we omitted the & in the command this time. Consequently, the wheat-background xterm command is running in the foreground of the black-background xterm, and the black-background xterm is waiting for that command to finish before it prompts you for another.

Its a common mistake to leave off the &, running something in the foreground that we wanted in the background, and thereby losing access to a perfectly good xterm. This mistake is, however, easily fixed.

Go back to the black-background xterm. Type Ctrl-Z. This temporarily suspends the current command in that xterm (the wheat xterm). Then give the command

bg 

which moves the current job (the wheat xterm) to background status. Now both xterms (as well as the original white one) will be working.

Go to the wheat xterm. Do a few ls -l or other commands until text begins to scroll off the top of the xterm window. Notice that you now have a scroll bar on the left that you can use to view the previous text. Right-clicking on this takes you backwards. Left-clicking moves you forward. The distance you move is proportional to how far down the bar you are (near the top of the bar, each click may move you only one line; near the bottom, a single click may take you all the way to the beginning or end of the scroll).

Go to the original (white-background) xterm. Again, do a few ls -l or other commands until text begins to scroll off the top of the xterm window. Then hold down the control key and right click within the xterm. A menu should pop up that offers a variety of options for manipulating your xterm. This may include the ability to activate the scroll bar. (Note: I sometimes find that only a uselessly small portion of the menu shows. I dont know a workaround for that.) Holding doown the control key and left-clicking may produce a separate window.

If you find a set of xterm options that you really like, you can make those your defaults by setting the appropriate resources in your .Xdefaults file (see your textbook for discussion of this). If you have multiple sets of options that you like, you can create an alias for them by adding a line like the following to your ~/.cshrc file:

alias darkxterm xterm -bg black -fg grey -geometry 80x24 -sl 1000 -sb & 

On subsequent logins, you will then be able to issue the command darkxterm rather than typing out all those options each time.

From any of your three xterms, issue the following command:

emacs ~cs252/Assignments/compileAsst/guess.cpp & 

Compare this to how emacs looked in an ordinary telnet window. You should notice a few differences. You now have a functioning menu bar at the top and a scroll bar on the left. If your ~/.emacs file has been set up for it, you should see the various elements of the C++ code rendered in color. (You might want to do a C-x 1 to get rid of the Welcome to GNU Emacs window.)

You can now move the cursor to a particular location just by clicking there, and (again, depending upon the options set in your ~/.emacs file) you may be able to select text regions by dragging the mouse over them.

In short, most of the conveniences you associate with any windows-based editor are provided by emacs when you invoke it in a graphics-mode context.

While all three xterms and the emacs window are still active, give the command

~cs252/bin/xlaunchAsst & 

in any of the xterm windows to complete the assignment. If you were successful, your access code will pop up in a separate window. If you were not, look in the xterm where you issued the command for an explanation.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions