Operating a PC as a Unix Terminal (using MetaFrame)

Author: Jeff Ormerod


Introduction

Citrix Metaframe allow users to create a window providing an interface to a remote system or application. The host and remote systems do not need to be of the same type. They can be any mix of UNIX, PC, Macintosh or Linux. Within the window created you are in an environment identical to that which you would encounter if you logged directly onto the remote system with a dedicated terminal. When the window is selected the PC becomes, via the software, a terminal onto the remote system. By interpreting data from the keyboard and mouse then displaying the graphical results in the thin client window users can interact with the remote system. The window can be set so it is full screen and occupies the entire window, or it can be a portion of the available window area. The example below shows a thin client window to the Bolton University UNIX systems displayed in a Windows XP environment. In this case the window has been shrunk so that the Windows environment can be seen. As with any Windows "window" we could select full screen to maximise the area displayed in the window, or indeed minimise the window to work on other applications.

 


Logging On and Off UNIX Systems

Logging on occurs automatically when Citrix Metaframe is invoked. You will find displayed the UNIX system login page. When you successfully login this opens a new session for you to work in. The UNIX login screen will look like this.

At the end of a session you should close down your applications and log off. Logging off closes down the session in an orderly fashion and releases the licenses. Failure to do this can result in files being left open and applications software such as Altera and Cadence being left running. Log off by clicking the EXIT button on the UNIX Common Desktop Environment (CDE) toolbar, or alternatively by using the "logout" command on the desktop menu as shown below.

Logging On and Off

Disconnection and Reconnection of a session

Should you find that the connection between your computer and the remote system is broken for some reason, the session will become "disconnected". The status of the session and the display will be held exactly as they where when the disconnection occurred. To start working in the session again you need to reconnect to the disconnected session. To reconnect, invoke Metaframe again. Rather than the normal login screen you will be first presented with the "Connect to Existing Session" form. Observe that the previous session is now displayed as disconnected on the form. When logging on you can reconnect to a disconnected session by selecting that session and clicking on "Reconnect". Do not click on start a "New Session". As this will start a new session. If there are several disconnected sessions listed you must terminate all those except the one to which you wish to continue working in. To do this, reconnect to each session in turn and log off as detailed above. The session should then be removed from the list.

Logging On and Off

You should ensure that you only have a single citrix session at any time. Either an "active" or "disconnected" session. Whilst the Citrix server will never shutdown an "active" session users with 2 or more disconnected citrix sessions will find that they are automatically logged out of those sessions. Having more than one session uses multiple Citrix licenses and may also use multiple copies of applications software.This ties up licences unnecessarily and can cause unpredictable effects when attempting to read and write data as there may be multiple copies of design tools accessing the same data from different sessions.


Interacting with the PC Desktop

Citrix Metaframe co-exists with the PC operating system so that at any time you can call up any of the Windows utilities and applications. If any of these are open you will see their icons at the bottom of the screen. The Metaframe window can also be moved around and iconised like any of the PC windows to reveal the PC desktop. A good way of selecting anything currently active on the desktop without having to move or iconise is to use the menu or the Alt and Tab keys. Press and hold down the Alt key whilst repeatedly pressing the Tab key. This will sequence through all the active windows (including the Citrix window). Release the Alt key when you see a window you wish to select. Alternatively use the Windows key on the key board to display the "Start" menu bar and tool bar.


Shadowing a UNIX Citrix Client Session

Citrix Metaframe provides a facility for a tutor to shadow a student Metaframe session. This is particularly useful when a student requires assistance with an applications package or design. In this situation the tutor would run the shadowing software from his own machine but would be able to see and interact with the student's session. The procedure is as follows:

Tutor Actions

View the sessions currently active by typing the following in an UNIX terminal window:

This provides a list of users that are currently available for shadowing. Specifically each user will be identified by a "USERNAME", which will be the user's account name, and a unique identification number or the "ID". The status of the session will also be shown for example "active" or "disc" for disconnected. An active status indicates a session where the student is connected to the server. A disconnected status indicates that the session is currently unconnected and the student is not connected to the server. An example output from ctxqsession would be:

From this you can select the required user and note the corresponding session ID. To invoke the shadow facility you need to type the following command.

(For example for user nc3 the command required would be: ctxshadow 5212)

Terminating a shadow session

The shadow function can be terminated by simultaneously pressing the Ctrl and * keys by the tutor. ( * being located on the numeric keypad)

Student Actions

At this point the student will see the following message form displayed on screen:

The student needs to select "OK" to allow shadowing or "Cancel" to prevent it. When a session is being shadowed both users have control of the applications software via their respective keyboards and mice and both will see the same display. Other applications software (e.g. Netscape) and operating system utilities (e.g. File Manager) can be used as normal during shadowing sessions. Opening up a Text Editor (see the later section on the UNIX Common Desktop Environment) provides a convenient two way communication mechanism should a voice link be unavailable. Both users are able to see and type messages into the Text Editor as in a normal chat facility. For the more sophisticated user there are a number of other alternatives available.

 


Transferring Files

Unfortunately the webmail client ( Microsoft Exchange) is not compatible with any of the existing UNIX web browsers. Thus to transfer files between your home system and the UNIX system requires using gandalf as an intermediate system. The process is described in detail at the following location: http://www.ami.ac.uk/students/itconfig/pc_as_pc_terminal.asp#transferringUNIX


Printing Unix text and graphics information via your PC at home

Although it would be useful to be able to print direct from a Unix package, the only practical way to do this requires the remote printer to have postscript capability.  As an alternative we recommend using the two methods described below.  They are quite straightforward and, used together, achieve the same result. Those who wish to experiment with postscript printing from UNIX are catered for in the later sections.

Transferring and Printing Text Files between the systems using "Cut and Paste"

If required complete files can be transferred to the PC for printing using the webmail tools as described in "Transferring Files". However there is a more direct method that can be used for text files between the PC and UNIX and indeed between UNIX and the PC. It fits in with the normal PC techniques in that it uses the cut and paste operations. The Metaframe window can interact with the PC "clipboard"and supports the <Ctrl>C and <Ctrl>V cut and past operations. The procedures are identical to the normal cut and paste operations carried out in a Windows environment. For example:

To copy a text entry go from Unix to PC

  Highlight the text in the Unix text editor by:

You can also paste text from the PC to a UNIX text editor ( e.g. nedit, textedit, dtpad) by reversing the procedure. Using <Ctrl>C in the PC window and <Ctrl>V or the paste command in the UNIX text editor. Using this method you can transfer programs, for example VHDL files, and textual information between the systems.

Acquiring Graphics and Screen shots from UNIX applications

There are many occasions when visual copies of circuits, simulation results etc. are required from within the UNIX applications software for assignment reports and reference purposes.  There are two main ways of transferring images from UNIX systems to the PC environment.

Using Print Screen to capture the entire screen

This allows you to take a screen dump of the entire PC display and import this into an image editor, word processor, html document etc. The procedure is as follows:

  1. Adjust the size of the applications window whose contents you wish to copy to the size you require it to be in the document.
  2. Move this window to the top left hand corner of the Citrix Metaframe window.
  3. Move the entire Citrix Metaframe window to the bottom right of the screen so that only the required applications window is showing
  4. Hold down the Alt key and press the Print Scrn key. This will copy the applications window to the PC desktop clipboard
  5. Select the required destination document, hold down the Ctrl key and press the v key.This will paste the contents of the clipboard into the document. You may need to edit or crop the document to display the elements you are require.

 


Acquiring, selecting and transferring graphics between the UNIX and Windows environments using ctxgrab

This documentation is intended for use when running a UNIX environment through a Citrix ICA Client on a Windows platform.

As has been described previously the basic cut and paste functions between the UNIX and Windows environments are sufficient to accommodate the transfer of text based information. However It is also possible to cut and paste graphical information between the UNIX Citrix ICA Client and Windows clipboard. To do this you must use the Citrix tools ctxgrab. This allow the selection of a window or area of a window to be captured. "ctxgrab" is the basic tool with the "ctxcapture" tool providing additional facilities. Those additional facilities do not add to the design flow for capturing images in this situation. Apart from the ability to be selective about the window or area "grabbed" it does work at a higher resolution than the windows print screen. When capturing images with fine or complex detail this can be advantageous.

Preparation

In all cases it is recommended that you make the size of the window or section of the window you are extracting as large as possible before capture. This is due to the nature of the capture operation which operates on a "dots per cm" basis. Shrinking an image after capture will result in a sharper image and improve the result. Whilst expanding smaller images will result in a grainy or irregular image. Experimentation will enable you to determine the required size for the image you are transferring.

For example, the images on the left was created from a small image and expanded. Whilst that on the right was created from a larger image that was shrunk. The difference in quality can be clearly seen in this example.

Using ctxgrab

"ctxgrab" is a simple interface that allows you to capture and paste images from the UNIX Citrix ICA client into programs in the Windows environment. It provides the ability to select as an image either a window or regions. The resultant images can then be pasted directly into a compatible Windows programs such as Word, Excel or paintpad.

Start the ctxgrab tool by typing the following in a UNIX terminal

This will invoke and display the ctxgrab tool.

here are two distinct modes of operation with ctxgrab. It will either take an image copy of a window, or of an area in a window. Which is selected depends on which mouse buttons are used.

Window selection mode

This will automatically take an image of the entire window. In this case the window frame would be one of the window frames within the Citrix ICA Client and not the Citrix window i.e. a Cadence schematic or symbol window. Note that this is a snapshot of the entire screen area within the bounds of the window. If other windows overlay the selected window the portion of the window overlaying the selected window will be contained within the screen shot.

To use this mode:

This will copy the entire window frame onto the Windows clipboard.

This is an example of the issues caused by windows overlaying the selected window.

Area selection mode

This will select the area inside a rectangle drawn using the mouse cursor whilst holding button one down. This can be used to select areas or items of interest within windows. Normally this is useful for schematic, layout or simulation screens.

To use this mode:

Using the captured image in windows

Now you have the selected information and it has been transferred to the clipboard it can be pasted into any appropriate programs in the windows environment. The image is available on the standard Windows clipboard and can be inserted using the paste functions into any appropriate application.

Post Processing the image in the Windows Environment

If you have selected a Cadence schematic, symbol or waveform plot they will have a black background. Whilst not critical you may want to remove this. There are a number of methods to facilitate the removal or apparent removal of the background colour. The following are the two most direct routes available within the Windows environment. Dependent on the image processing tools available users may have other routes available to them.

Removing the black background from a picture using Microsoft Word

The assumption is that you have pasted or otherwise inserted the image into a Microsoft Word document. You can use the option "set the transparent colour" to remove the black background. This is the "wand" icon on the picture tool bar. Select the icon and then click on the black background in the image. The examples below show a picture of a resistor both before and after the background has been made transparent by this method.

Removing the black background with Microsoft paint

In Microsoft paint you can change the colour black to white using the area fill command. The software will treat each isolated section as a separate area. So may need to select each black area individually. On large or complicated images this can be time consuming. The example below shows a resistor with the background changed from black to white using this method.

 


Other Methods of Acquiring Images in the UNIX Environment

In addition to the capabilities detailed in the "print screen" and Citrix capture tools sections there are a number of other methods for capturing images in the UNIX environment. A degree of UNIX experience beyond that required to utilise the "ctxgrab" utility is required. In all cases the operations result in the generation of image files. These need to be transferred to the Windows environment either directly in a compatible format, or via the ctxgrab functions. For this reason a detailed description of the functions will not be incorporated in this guide.

The UNIX xwd command

This is a command allows users to take a snap shot of any UNIX window. The resultant image is stored in a Sun raster file. Normally you would use the "image viewer", "xv" or "gimp" tools to translate this to a Windows compatible format for example gif , bmp or tif. For more information on the command itself type the following at a UNIX prompt:

A basic use of the xwd command would be:

When invoked the mouse prompt will change to a cross hair. Clicking on a window would then invoke the capture routine and generate the file image1 in the "/tmp" directory. You could then use the image viewer, xv or gimp to process the image.

The Cadence Camera Options

On the Cadence CIW window under the menu path "Tools -> Camera" are the capture options. These allow the capture of images in either Sun raster or postscript format. The Sun raster file can be processed by the xv or gimp tools. The postscript file can be processed to PDF using the UNIX command "ps2pdf", or viewed directly using the ghostview tools. The camera option can be used to capture windows immediately or after a specified delay. The delay option allows you to display the menus and forms within a window before the image is stored. The image can be captured and transferred to the Windows environment after manipulation if desired.

The image viewer snap shot option

The standard UNIX image viewer "sdtimage" provides a snap shot option that allows the capture of screen, window or selected area. The captured image can then saved in a Windows compatible format such as gif, tiff or jpg. The image can be captured and transferred to the Windows environment after manipulation if desired.

The xv grab option

The xv tool has a "grab" option. With this you can acquire an image from a window and import it directly into the xv tool. The capture image can then be saved in a Windows compatible format such as gif, tiff, bmp or jpg. The image could then be captured and transferred to the Windows environment after manipulation if desired.

 


Plotting to a printer on the Windows environment from the Citrix ICA client UNIX Cadence tools

This details the methods and support available to provide the ability to print directly from the UNIX Citrix ICA client environment to a local or networked printer available in the Windows environment. In particular it covers printing for the UNIX Cadence tools to the Windows environment. It is recommended that students use the Citrix "ctxgrab" facility to transfer graphical information between the UNIX and Windows environments and print directly from the Windows environment. Whilst the Citrix Metaframe client does support printing between the two environments the process is not straight forward and is not suitable for inexperienced UNIX users.

Why only postscript?

The only compatible print option from the Cadence tools and a number of the other UNIX design tools is postscript. If you have access to a local, networked or virtual printer capable of accepting postscript then you can print directly to this by configuring the UNIX environment correctly. A virtual printer would be one capable of accepting postscript and translating it to another format. The most common virtual printers are those used to generate PDF files. If you do not have a compatible print environment then an alternative route utilising the ghostview tool suite is detailed in this document.

UNIX Configuration

To configure the UNIX environment for printing from Windows you need to run the following command:

You need to run this command to initialise the environment, when you use a different computer or install additional printers in the Windows environment. The command has two functions.

From the UNIX environment it is impossible to determine which printers are postscript compatible. Aliases and Cadence plotting options for all the available printers will be defined. The user will need to select the appropriate alias or plotting option.

Unix Print Aliases

A number of print aliases will be defined. These contain the correct syntax to utilise the additional printers. Tests on printing from other tools have been carried out using xemacs, nedit, textedit and Netscape. There appear to be issues when non postscript print information is sent to a printer by this route. The printers utilised for this evaluation was an HP4000 networked printer. It is capable of accepting both postscript and non postscript data. In normal UNIX operation there would be no issues with the sending of non postscript data to this printer. Whilst we were successful in printing from Netscape the results from the other programs was incorrect. The text prints indicate there is an issue with the carriage return and line feed translations when using this route. To list the available print aliases type the following UNIX command:

This will display all the currently available printer aliases. These are not printer queues but are only aliases for the command required to submit a file to the relevant Windows printer. In order to encapsulate them for use as aliases additional brackets and quotes have been required. To use them without calling the alias, as may be required for some tools, you need to remove the additional formatting. For example the alias:

Cadence cdsplotinit

The Cadence ".cdsplotinit" file, which contains the additional printer information, will be created in the users ${HOME} area. The information will be configured so that when printing from inside Cadence postscript2 information will be passed to all these printers. The software is unable to determine the capabilities of a printer in the Windows environment and a generic option is used to maximise compatibility.

Plotting Inside Cadence

When using the plot options you can access the "Plot Options" menu on the lower right hand side of the plot window. This displays the plot options form. On this form you use the cyclic field "Plotter Name" to select the required printer queue. Once this is done you can use the plot options as normal.

Plot Options Form

Printing from UNIX without a postscript printer environment in Windows

It is recommended that users investigate the Citrix "ctxgrab" facilities as the preferred route for transferring graphical information from the UNIX to the Windows environment.

There are a number of steps required to provide the ability to plot postscript files from the UNIX Citrix ICA client environment through a Windows platform without any specific postscript capability. The steps required are:

Installing a postscript printer

Use the add printer options available in your Windows environment. The printer should be defined as local and be capable of accepting postscript input. Recommended types would be the Hewlett Packard 4000/5000 or 6000 series. Give the printer an easily recognisable name. Do not make this the default printer.

Configuring the Printer options to "print to file"

Open the new printer icon and edit the preferences. In addition to the normal configurations for paper size and quality you need to set the following option:

Installing ghostscript and ghostview

In order to view and print postscript files on a PC you will need to download and install the following packages.

The ghostscript tool package provides procedures to interpret the postscript files. The ghostview tools provide a graphical interface to the ghostscript tool. Both tools are available for Windows installation. They are available at the following location:

Download the latest version of the packages and install them. You will need administrator privileges to do so. Once this is done files with a "ps" or "ps2" extension will be recognised by the Windows explorer and passed to ghostview for viewing. Alternatively you can open the ghostview tool and select the file you wish to examine using the ghostview menu options.

Updating the UNIX environment

You now need to configure the UNIX environment to recognise the new printer that has been installed. You do this by running the following command.

This will generate a new cdsplotinit file in your home area. When you invoke Cadence this will be read by the tools.

Generating a post script file from UNIX

In the Cadence environment select the postscript printer you have installed. When you start to print the Windows environment will display a prompt allowing you to select the name and location of the file to be generated. It is recommended that you use a ".ps" or ".ps2" extension.

Opening and printing the file

Once the printing is complete you can open the file either directly using the ghostview file open or you can use the Windows explorer tool. Once the postscript file has been opened in ghostview you can cut, paste examine, modify and print the resultant image to your local printer.

 


Updated 11.10.05 RA 18.10.05 NC 20.07.06 NC