|Installing IBM System i Access on Linux|
|Operating Systems - Linux / Open Source|
|Written by Thomas Snyder|
|Wednesday, 20 May 2009 02:00|
Follow these simple steps and avoid the gotchas!
On my home computer, I am using Ubuntu Linux 8.10. Being an RPG programmer, I could not do this if I did not have a 5250 emulator to use. Fortunately, there are several viable options out there. In a previous TechTip, I discussed some options for operating systems that you may be supporting. In this article, I will get more hands-on by exploring the details of installing System i Access on Linux.
Prerequisites for Installing IBM System i Access for Linux
There are several prerequisites to get your emulator to work: you must have the IBM iSeries Access family (5722-XW1) license, the host servers must be started, and TCP/IP must be running.
One thing that will prohibit your software from working on the client end is the use of certain Microsoft fonts for the application. Prior to installing the IBM 5250 software, you need to install the Microsoft fonts that System i Access uses. I'm not sure why IBM set these as the default fonts or didn't set a default font if the Microsoft fonts weren't installed. But if you do not have them installed, your IBM 5250 emulator will not work.
Installing the fonts is easy enough...once you know you need them. But it can be frustrating when you need to find out all of these little details by trial and error to get your application to work. A lot of Linux applications that have requirements such as these dump a useful error message, indicating the exact commands that need to be executed for it to work.
Installing the Microsoft Fonts
Use this command to load the required Microsoft fonts:
sudo apt-get install msttcorefonts
You can reboot, or you can flush the font cache without a reboot:
sudo fc-cache -fv
Downloading IBM 5250
You can download the IBM 5250 software at IBM's Web Site. But first, you need to register to get an IBM ID. If you do not have one, you can create one with minimal information: you do not even have to provide an official IBM serial number or anything like that.
Once you have signed in, download the RPM file. You can download the software for Intel-based Linux workstations and Power PC with 32-bit processors. The 64-bit versions are available, but they do not provide a 5250 emulator. The latest Intel-based Linux RPM for V5R4 at the time of this article is iSeriesAccess-5.4.0-1.6.i386.rpm. So I will be using this file name throughout the article. You may be using a different version, which means you would have a different file name to reflect this.
The RPM File
If you are using Red Hat on an Intel workstation, install the RPM file using the following command:
rpm -ivh iSeriesAccess-5.4.0-1.6.i386.rpm
That's all nice for Red Hat users. But what if you're using Ubuntu or Debian? Well, you can convert the RPM file into a usable deb format by using the alien command. Alien is a program that converts between different Linux packages.
There are some prerequisites that you must have installed prior to executing the alien command. Install them using the apt-get command:
sudo apt-get install libmotif3 libxaw7 libstdc++5 alien -y
Once you have all of the required software installed, you can convert and install the RPM file on your Ubuntu system as follows:
The -i option on the alien command indicates that you want to install the packages that have been converted. With Ubuntu and Debian becoming so popular, I would be happy to see IBM start to offer a Debian file that could be downloaded. But until then, use the alien command to convert and install the package for you.
Starting Up the IBM 5250 Green-Screen
In a terminal window, type this command:
You could also use the DNS name:
After executing this command, you'll get the sign-on screen (you may get the redundant gray GUI screen asking you for your user name and password before getting the sign-on screen).
Starting Multiple IBM 5250 Sessions from a Single Terminal
In a terminal window, type this command:
ibm5250 10.10.10.1 &
This command has the ampersand (&) at the end of the line, which is used in Linux to send a process to run in the background, like sending a job to batch from an interactive job. This allows your emulator to run without tying up the terminal that you called it from so that you can start up more than one session from a single terminal and then continue entering more commands.
Remapping the Keys
The first thing I wanted to do after installing the 5250 emulator was to remap the keys. And with IBM 5250, it is easy enough with a GUI keyboard screen. On the emulator session's menu bar, choose Option > Keyboard Remapping to bring up the GUI keyboard that allows you to remap the keys (Figure 1).
Figure 1: Remap your keyboard. (Click images to enlarge.)
As you can see in Figure 2, I am remapping the Escape key to perform the SystemRequest() function. The Action Help button is useful to provide explanations of what each function performs, such as the FieldExit().
Figure 2: For example, remap the Escape key.
When you are done making your changes and you've closed the screen, you will be asked whether you want to apply your changes.
Figure 3: Apply your changes.
If you "Apply and Save changes before exiting," you will be applying the changes to the session that you have open and also be saving them for future usage.
Next, you will be asked where to save the changes.
Figure 4: Decide where to save changes.
The Location of the Key Map Files
You may want to know where the actual key maps are saved so that if you create a key map that you like, you can push it to other computers. The key maps are saved into binary files in the ~/. iSeriesAccess/ibm_5250/K folder. The tilde (~) indicates the home directory location of the user that you are signed on as.
When you save the key map to be the default for all sessions, it is saved into the Default.101 file. If you somehow get your key map to a point that is beyond repair, you could rename or delete this file and have the emulator restore the key maps back to their original settings.
Choosing the option to save a named key map file creates a custom key map file in the same directory with the name that you indicated, followed by the .101 extension.
Command Line Options
There are command line options that you can use when you are using the ibm5250 command that would be specified after the IP address or DNS name. These command line options allow you to set various attributes of your sessions. Let's look at how to set the display name of the session and how to specify the usage of a named key map.
Set the Display Name
When using IBM 5250 on Linux, you need to specify the display name. If you don't, your session may get hung up when, for example, you receive a break message or try to use QShell.
To specify the display name, use the -DISPLAY_NAME option followed by the name that you wish to use:
ibm5250 10.10.10.1 -DISPLAY_NAME PGMR21Z
This example will connect to the IP address of 10.10.10.1 with the display name of PGMR21Z.
When you specify the display name with ibm5250, you must use uppercase letters. Using lowercase letters will generate an error: "Invalid Specification of -DISPLAY_NAME parameter"
Specifying a Named Key Map
If you create a customized key map that you have named, you can specify the usage of that key map with the -KEYFILE option:
ibm5250 10.10.10.1 -DISPLAY_NAME PGMR21Z -KEYFILE MCPress.101
If you create a key map named MCPress when you change your settings, you can access it by specifying it after the -KEYFILE option with the .101 extension. The extension will automatically be added when you save the file. If you do not specify a named key map, then the default key map will be used.
IBM System i Access for Linux: It's a Good Thing!
Now that you know how easy it is to install System i Access on your Linux computer, you've opened up a whole new world of possibilities! Now, go have fun!
|Last Updated on Tuesday, 26 May 2009 10:11|