AIX/HP-UX Interoperability Guide (continued)
[Last Chapter: 13. Mail]


14. X11

14.1 AIX

AIX's version of the X Window system is called AIXwindows, a separately purchased product that includes the X Window System and Motif. It also includes a graphical user interface (GUI) called the AIXwindows Desktop. With AIX 3.2.5 you can get either AIXwindows Environment/6000 Version 1.2.4, which is based on X11R4, or Version 1.2.5, which provides support for X11R5 and binary compatibility for X11R4. The material in this chapter is based on the latter.

Files and Directory Structure

AIX puts all of its X Window files in a single directory, /usr/lpp/X11, but has links to maintain compatibility with traditional X files and directories. The major links are:

/usr/bin/X11 -> /usr/lpp/X11/bin
/usr/lib/X11 -> /usr/lpp/X11/lib/X11
/usr/include/X11 -> /usr/lpp/X11/include/X11
/usr/include/Xm -> /usr/lpp/X11/include/Xm

The following standard X commands are found in /usr/lpp/X11/bin:

X
bdftopcf
fs
mkfontdir
resize
startx
xauth
xclock
xdm
xhost
xinit
xmodmap
xpr
xrdb
xrdb
xsetroot
xterm
xwd

The command mwm is a link to /usr/lpp/X11/Motif1.1.4/bin/mwm.

The following commands in /usr/lpp/X11/bin are actually links to files in the /usr/lpp/X11/Xamples directory:

aixwm
appres
atobm
bitmap
bmtoa
demodr
demomon
editres
fsinfo
fslsfonts
fstobdf
listres
oclock
pcfsnfdir
pcftobdf
showfont
showrgb
twm
viewres
xbiff
xcalc
xclipboard
xconsole
xcrtca
xditview
xdpr
xdpyinfo
xedit
xfd
xfontsel
xkill
xload
xlogo
xlsatoms
xlsclients
xlsfonts
xmag
xman
xmh
xprop
xrefresh
xsccd
xscope
xset
xstdcmap
xwininfo
xwud

The /usr/lpp/X11/Xamples directory contains binaries compiled by IBM but are not officially supported. You can build new versions of these binaries as well as other utilities and demos, such as xev, by running the imake and make utilities. Complete instructions on doing so are found in /usr/lpp/X11/Xamples/README.

The location of the xinitrc and xserverrc files, as well as xmodmap key mappings are found in /usr/lpp/X11/defaults. The sample Xdefaults file is /usr/lpp/X11/defaults/Xdefaults.tmpl.

Starting X

The default configuration of AIX has an ASCII-type of display, called an hft, as the login terminal. You can start the X server at the shell prompt on an hft by typing xinit or startx. The older style of xinit was a script, but with X11R5 it is an executable that initializes the X server and starts a client, which by default is an aixterm. xinit looks for a startup file in the following order:

  1. The command line
  2. XINITRC variable
  3. $HOME/.xinitrc
  4. /usr/lib/X11/$LANG/xinitrc
  5. /usr/lpp/X11/defaults/xinitrc

startx is a script that sets the DISPLAY variable, starts the X server, and then starts clients. startx looks for a startup file in the following order:

  1. The command line
  2. XINITRC variable
  3. The user's .Xinit, .xinit, .Xinitrc, .xinitrc, or .xsession file

If no startup file is found, startx starts the window manager specified by the command line or indicated by the appropriate configuration file, such as .mwmrc. If no such file exists or no window manager is specified on the command line, startx starts mwm by default.

startx reads the resource file specified in the command line or, if not supplied, the resources from one of the following: .Xdefaults, .xdefaults, .Xresources, or .xresources.

Stopping X

You can stop the X server by selecting End Session from the Root Menu or by pressing the Ctrl+Alt+Backspace key combination.

aixterms

The default terminal emulator on AIX is an aixterm, which emulates a High Function Terminal (or hft, see Chapter 2 for more information on hfts). If you telnet, rlogin, or rsh to a machine that does not have aixterm terminal definitions-and HP-UX machines are among those-you can set the TERM variable to vt100, vt102, vt220, vt320, or xterm to use programs like vi properly, or you can add aixterm terminfo entries by doing the following:

  1. On the HP-UX box, cd to /tmp.
  2. ftp to the RS/6000.
  3. While in ftp change directories to /usr/share/lib/terminfo.
  4. Do a get on ibm.ti.
  5. Quit ftp.
  6. Back on the HP machine, type the following command:

    # tic ibm.ti

This procedure will put aixterm terminfo entries into the HP's /usr/lib/terminfo/a directory.

For purposes of interoperability some people like using xterms in order to avoid procedures like the above. However, there are problems in doing so. For example, if you run the smitty command in an xterm instead of an aixterm you will not have all the normal function keys available to you. This is also true for the smit command run remotely via telnet, rlogin, or rsh. Instead, you have to use escape sequences for certain functions. Also, the tn3270 command works best in an aixterm.

Fonts

If you have X11R4 instead of R5 installed, you will find fonts in /usr/lpp/X11/lib/X11/fonts, and these fonts will be in bdf or snf format. For X11R5 the fonts are in /usr/lib/X11/fonts and are in pcf format. AIXwindows proprietary fonts are in the top level of this directory. If you want access to these fonts from an HP X server you can install them by:

  1. Copying them into the HP's /usr/lib/X11/fonts/misc directory (or any directory, though this one makes sense).
  2. Running the mkfontdir utility:

    # cd /usr/lib/X11/fonts/misc; mkfontdir

  3. Entering the following command:

    # xset fp rehash

Note: This works only if the fonts are in pcf format. Use utilities like snftobdf and bdftopcf to get older formats into pcf, then do the above.

Making the RS a Font Server

AIX's generic font server configuration file is /usr/lpp/X11/lib/X11/fs/config. If you cd to the linked directory /usr/lib/X11/fs you will find it as well. This file is simple and similar to those found on other platforms except that it stipulates port 7500 instead of 7000. Any free port will do, but just remember the correct number when you run the xset command on the font client.

To start the font server type:

# fs -config /usr/lpp/X11/lib/X11/fs/config &

To verify the font server type (assuming you're using the KornShell):

# export FONTSERVER=server_name:7500; fsinfo

or

# fsinfo -server server_name:7500

To list the font server fonts (assuming you're using the KornShell):

# export FONTSERVER=server_name:7500; fslsfonts

To get the font client to include the font server fonts in its font path:

# xset +fp tcp/server_name:7500

xdm

If you want to use X Display Manager, you can configure the system with the xdmconf utility. This utility, along with all the other xmd-related files are found in /usr/lpp/X11/lib/X11/xdm. For compatibility's sake there is a link from /usr/lib/X11/xdm to this directory.

xdmconf will configure xdm to run at bootup via the SRC if TCP/IP is set up. The SRC command to start xdm is placed at the end of /etc/rc.tcpip. If TCP/IP is not set up for your machine, then xdm will be placed in /etc/inittab for startup by init. To remove xdm configuration, type the following:

# cd /usr/lib/X11/xdm ; ./xdmconf -d

The Desktop

The graphical user interface on AIXwindows is the Desktop. It is started by default in the xinitrc file by the xdt3 command. You can start the Desktop manually by entering this command in the background:

# xdt3 &

There are three forms the AIXwindows Desktop takes: the General Desktop (for newbies), the Power Desktop (for experienced users), and the Admin Desktop (for system administrators). You can go to any of these Desktops by choosing File->Load Desktop in the Desktop menu bar.

Customizing of the Desktop can be accomplished using the Preference Editor, which is available by selecting Options and then Preferences in the Desktop menu bar. More detailed configuration of the Desktop is governed by rule files. These files determine things such as icon appearance, drop behavior, and menu behavior of the Desktop through a mechanism known as the Deskshell programming language. The system-level rule file is /usr/lpp/xdt3/$LANG/xdtsysinfo. The system-level resource file is /usr/lib/X11/app-defaults/Xdesktop3.

14.2 HP-UX

The X11 server for HP-UX 9.0x conforms to the X11R5 release of the X Window System from the X Consortium. Hewlett-Packard does not provide or support the entire core MIT distribution. Many of these programs or clients are sample implementations or perform tasks that are accomplished by other clients in Hewlett-Packard's graphical user interface, Visual User Environment (VUE). The primary differences between the core MIT distribution and the Hewlett-Packard X11 release are listed below.

A number of unsupported core MIT clients and miscellaneous utilities are provided in /usr/contrib/bin. In addition, the entire core MIT distribution, compiled for Hewlett-Packard platforms, can be obtained from HP's users group INTERWORKS for a nominal fee. See the release notes for details.

Many other utilities, window managers, games, toolkits, etc. are included as user-contributed software in the MIT distribution, or are available using anonymous ftp on the Internet. See your site administrator for details.

Files and Directory Structure

The following standard directories for X binaries and configuration files are provided:

/usr/bin/X11
/usr/lib/X11

The include files for OSF/Motif and X11 are delivered for HP-UX 9.0x in subdirectories with names specific to their release: /usr/include/Motif1.1
/usr/include/Motif1.2
/usr/include/X11R4
/usr/include/X11R5

Shared libraries are also delivered in subdirectories with names specific to their release: /usr/lib/Motif1.1
/usr/lib/Motif1.2
/usr/lib/X11R4
/usr/lib/X11R5

The Motif and X libraries ship as shared libraries in HP-UX 9.0x run-time products. HP-UX developer's products include archived libraries for X11R5 and Motif1.2. Applications that use shared libraries incorporate an absolute path to the location of the shared library. The libraries were relocated to subdirectories in /usr/lib so that applications can run on a system that uses either Motif 1.1 or Motif 1.2. The header files appear in release-specific subdirectories so that developers can use release-specific versions of Motif and X. All versions of HP-UX 9.0x contain this directory structure.

Hewlett-Packard has selected a set of the X Consortium clients to support for the HP-UX release 9.0. Some clients that were supported in earlier releases are no longer supported. This is due to current and announced future level of X Consortium support for certain clients, as well as new functionality in R5. In addition, several new clients are not supported

Six clients supported in 8.* releases are not supported for the 9.0 release. Five of these clients are supplied in the 9.0 release, but may not be supplied in the future. These clients are:
bitmapReplaced by vueicon, the VUE icon editor. If you use the unsupported 9.0 version of bitmap, note that it is substantially different from the 8.* version. See the bitmap man page for complete information.
xclipboardThis function was a sample implementation. You can use a terminal emulator and an editor to get the same functionality.
xcutselThe functionality of xcutsel is now contained in hptermhpterm.
xfdYou can display font graphics on any application by specifying -fn as a command-line option. You can display font metrics by using xlsfonts.
xrefreshThe functionality of xrefresh is now handled by the window manager.

The sixth client, bdftosnf, is not supplied with 9.0 since it has been replaced by bdftopcf.

The new clients not supported are columns, dr_vue, xdpyinfo, xprop, and vuefincalc.

The executable files and man pages for all the unsupported clients are installed in /usr/contrib/bin/X11 and /usr/contrib/man, respectively. In order to use these clients, be sure that your PATH environment variable contains /usr/contrib/bin/X11. Use env to see the current setting of your environment variables. The online man page access utility man looks in /usr/contrib/man by default, so you don't need to modify the MANPATH environment variable.

Supported Clients

bdftopcf
fs
gwind
gwindstopxload
hpterm
mkfontdir
mwm
resize
rgb
sb2xwd
stconv
stlicense
stload
stmkdirs
stmkfont
vueicon
vuelogin
X
x11start
xauth
xclock
xcmsdb
xhos
xinit
xinitcolormap
xlsfonts
xmodmap
xpr
xrdb
xseethru
Xserver
xset
xsetroot
xterm
xwcreate
xwd
xwd2sb
xwdestroy
xwininfo
xwud

Unsupported Clients

bitmap
columns
dr_vue
vuefincalc
xclipboard
xcutsel
xdpyinfo
xfd
xprop
xrefresh

Starting X

On HP systems, the X Window System is normally started via the Visual User Environment (VUE), which uses xdm (X Display Manager) technology rather than xinit to start X. When VUE is not used, the normal method of starting X is via the x11start script which is simply a "wrapper" around xinit providing environment and command line setup appropriate for HP systems.

Specifically, x11start performs the following startup tasks:

x11start encompasses the following components:

Customized client and resource files can be created by copying the default files to $HOME/.x11start and $HOME/.Xdefaults, respectively, and then customizing them. Customized files that exist (with the appropriate permissions) will be used by the x11start components in place of the default files.

Client options pass from the x11start command line to all clients in the .x11start file that have a $@ parameter. The options replace the parameter. This method is most often used to specify a display other than the usual one on which to display the client. You can, however, use the command-line option to specify a non-default parameter, such as a different background color.

The default .x11start file starts the following clients:

Server options are preceded with a double hyphen (--). If the option following the double hyphen begins with a slash (/) or a path and a slash, it starts a server other than the default server. If the option begins with a colon followed by a digit (:#), it specifies the display number (0 is the default display number). Additional options specified after the server or display refer to the specified server or display. See the XSERVER page in the reference section for more information on server options.

Examples

# x11start

This starts the default xinit server and executes the client script (either /usr/lib/X11/sys.x11start or $HOME/.x11start) without passing arguments to either.

# x11start -bg black -fn 24x36

This starts the default xinit server and executes the client script, passing it all of the arguments. If the default client script is used, -bg black -fn 24x36 is passed to both mwm and hpterm since both of their default command lines contain $@. If the default client script is used, the actual xinit command executed is xinit /usr/lib/X11/sys.x11start -bg black -fn 24x36.

# x11start -fg white -- :1

This starts the default server on display 1 and executes the client script with the arguments, -fg white. If the customized client script is used, the xinit command line is xinit $HOME/.x11start -fg white -- :1.

# x11start -- Xhp -a2 -t 5

This starts the server, Xhp with the arguments, -a2 -t 5 and then executes the client script without any arguments.

NOTE: Beginning with the next release of HP-UX, x11start and its components (xinit, sys.x11start, and sys.Xdefaults) will not be supported. Instead, startup will be via the program vuelogin, which is directly based on the X Consortium's startup mechanism, xdm. vuelogin is not tied to the VUE environment (and xdm is not) and can be used to start up a non-VUE standard X session without using xinit. The main difference between the xinit startup method and the xdm or vuelogin method is that the former starts the X server, whereas the latter operates with the X server pre-started automatically. This is consistent with X terminals.

Stopping X

After stopping all application programs, stop the window system by holding down the Ctrl and Left Shift keys, and then pressing the Reset (Pause-Break) key. This stops the display server, and with it the window system.

Fonts

A font server is shipped with Hewlett-Packard's X11R5 distribution but, by default, is not automatically started. To start the font server, execute:

# /usr/bin/X11/fs -daemon

This starts a font server in its default configuration (see below for information on modifying font server configuration). Any X server started on the same system after the font server is started will automatically gain access to the fonts provided by that font server, including the licensed scalable Intellifont and Type 1 fonts in the /usr/lib/X11/fonts/ifo.st and /usr/lib/X11/fonts/type1.st directories.

By default, a font server accepts connections from font clients (such as X servers) at TCP address 7000, and configures itself according to information in the file /usr/lib/X11/fs/config. Both of these defaults can be overridden with command-line options. See the fs(1) man page for more information.

Once you have determined your font server configuration -- one font server per machine, a centralized font server, or whatever -- and determined which machines you wish to use as font hosts, you should configure these hosts to start a server whenever they boot. You can do this by adding the appropriate commands to the /etc/rc startup file. For example, add the following definition to the function definitions at the beginning of the file:

start_fontserver()
{
     if [ -x /usr/bin/X11/fs ]
     then
          echo "starting fontserver"
          /usr/bin/X11/fs -daemon
     fi
}

You also need to add start_fontserver to the appropriate list of startup actions in the "Actions based on system type" section. As defined above, whenever the host boots, a font server starts at the default TCP address of 7000 using the default configuration file /usr/lib/X11/fs/config.

If the font server is to be run on the same machine as the X server and if the font server is started before the X server, the font server does not need to be added to the font path of the X server. However, if the font server is started after the X server is already running, or if a font server is running on a different machine than the X server, then the font server must be added to the font path of the X server as follows:

# xset +fp tcp/:7000

This adds the font server port to the front of the font path list searched by the X server. If you are adding a font server that is not running on the same machine as the X server, the xset command is extended to also specify the font server host:

# xset +fp tcp/host_name:7000

Once the font server is running and has been added to the font path of an X server, the server must rehash its fonts. This is also done with the xset client via:

# xset fp rehash

hpterms

The hpterm client emulates a Term0 terminal. The syntax of the hpterm client is as follows:

# hpterm [-options] [&]

There are too many options to cover here. Refer to the hpterm man page for all the options available.

Two different flavors of hpterm are available. The one built on X11R4 versions of Xlib, Xt, and Motif 1.1 is delivered by default. The version built on X11R5 versions of Xlib, Xt, and Motif 1.2 is delivered in /usr/bin/X11/hpterm.R5.sh.Z, which is a compressed shar file. To install this version, uncompress and unshar hpterm.R5.sh.Z. For more information on how to choose between the R4-based hpterm and the R5-based hpterm, see README.hpterm in hpterm.R5.sh.Z.

When running block mode applications, it may be necessary for hpterm to identify itself to application programs as some terminal other than "X-hpterm." Most applications understand the terminal id "2392A." Newer applications also understand the terminal id "700/92" while older applications may only understand the terminal id "2622A." To set the terminal identification string, use the -ti command line option, the termId resource, or the TermId class.

To put hpterm terminfo entries on an RS/6000:

  1. cd to /tmp
  2. Type the following command to put the hpterm terminfo entry into an ASCII file:

    # untic hpterm > hpterm.ti

  3. Put the hpterm.ti file on the RS/6000:

    ftp RS_node
    ftp> cd /tmp
    ftp> put hpterm
    .ti
    ftp> quit

  4. On the RS/6000, compile the hpterm.ti file:

    # tic /tmp/hpterm.ti

This will put the appropriate terminfo entries in /usr/share/lib/terminfo/h on the RS/6000.

HP-VUE

The HP Visual User Environment (HP VUE) is a graphical user interface that is based on the X Window system. The X Window System can be run alone, or as part of HP VUE.

HP VUE consists of six components, known as "managers":
vuelogin Validates user login
vuesession Starts and later saves the user's session
vuewm The user's workspace and window manager
vuefile Application launcher, file, and directory browser
vuestyle Interactive application resource customizer
vuehelp On-line help and man page browser

vuelogin is the first interface the user sees. It provides services similar to in init, getty, and login on character terminals: prompting for login and password, authenticating the user, and running a user's session. Specifically, vuelogin is responsible for:

A session in the VUE context is defined as the time between logging in and logging out, or the lifetime of the session manager. The session manager provides the ability to save and restore sessions. The following are characteristics of sessions stored and restored by the session manager:

The system-wide HP VUE directories are:
/usr/vue/bin HP VUEHP VUE executables
/usr/vue/config Configuration files for the login, session, and workspace manager
/usr/vue/types Built-in actions and file types
/usr/vue/app-defaults Application defaults for HP VUEHP VUE clients
/usr/vue/icons HP VUEHP VUE system-wide icons

For each user the .vueprofile file contains environmental settings and takes the place of the standard .profile or .login files. The .vue subdirectory in $HOME contains other configuration files, applications, tools, and palettes.

Configuration files comparison

Remember that VUE and X can be used at different times. A user could need Motif and regular X one day and HP VUE the next. So it is very important to keep these files separate. Notice there is no equivalent to the .Xdefaults file. Instead, the RESOURCE_MANAGER property is used. Resources are loaded into the RESOURCE_MANAGER property by the session manager at the beginning of a session. The session manager stores resources at the end of a session. System-wide resources are stored in /usr/vue/config/sys.resources. Properties can be modified during a session using the style manager, the EditResources action, or the xrdb command.

X11 VUE
.profile (or .login) .vueprofile
.Xdefaults RESOURCE_MANAGER
.x11start vuesession
.mwmrc vuewmrc

14.3 X11 Interoperability

X, like TCP/IP, NFS, NIS, DNS, and sendmail, is essentially the same on both AIX and HP-UX. Only the details differ. X has made interoperability among UNIX systems much easier in that clients can run on one platform and display on another. This is even true of clients such as SAM and SMIT, which you may find necessary to access from a box of another ilk.

Displaying to a Remote Host

Using xhost, you can add or delete a remote host's permission to access the local display server. For example, the following command allows the remote host stargate to access your local display.

# xhost +stargate

The default display on which a client is displayed is obtained from the DISPLAY environment variable of the system on which the client starts. It sets the host, display number, and screen number to which the client directs its output. This is typically display 0, screen 0. Most clients have a -display option that lets you set the host, display number, and screen on which the client will display its output. The -display option has the syntax:

-display [host:display.screen]

where:

host is the hostname of a valid system on the network.

display is the number of the display on the system on which you want the output to appear. A display can include more than one screen.

screen is the number of the screen where the output is to appear. The default is 0.

For example, executing the command:

# hpterm -display rs_node:0.1 &

starts an hpterm process on the local system and displays the window on display 0, screen 1 of the rs_node system. The window has the default size, location, and color. Conversely, you can run the following command on an RS/6000:

# aixterm -display hp_node:0 &

If you need the capabilities of these terminal emulators on machines other than the ones they were designed for, this is the way to do it. However, the HP machine will not have the proprietary IBM fonts that will give the aixterm the same appearance it has when run locally on an RS/6000. The same is true for RS/6000s displaying hpterms. This fact does not hinder the functionality of these emulators, but if you prefer for each to look exactly the same whether running locally or remotely on another platform, you must do one of two things:

There are several ways to run programs on a remote host from a command line:

If the client produces output on a display, you must specify the display and screen on which you want the output to appear.

Running Programs Using rlogin

You can use an existing terminal emulator window to log into a remote host. Once the window is acting as a terminal off the remote host, you can run clients there and direct the output to any display. For example, the following commands log into and start xload on remote host rs_node and display the output on local system hp_node.

# rlogin rs_node
# xload -display hp_node:0.0 &

Using Remote Shells to Start Programs

The benefit of using remsh or rsh instead of rlogin is that the local system starts only one process (the client) with a remote shell; with the remote login, the local system starts both the remote login and the client.

The following syntax starts a remote shell on a remote host, redirects remsh input, starts a client, and directs output to the local display.

# remsh remote -n client -display local:display.screen &

where:

remote is the remote host name.

client is the absolute path of the executable client file (remsh and rsh does not allow the PATH variable).

local is the local host name.

For example, the following command runs xload on remote host rs_node and directs output to the display of system hp_node.

# remsh rs_node -n /usr/bin/X11/xload -display hp_node:0.0 &

Going the other way:

# rsh hp_node -n /usr/bin/X11/xload -display rs_node:0.0 &

NOTE: To make these examples run flawlessly requires use of the xhost command and the appropriate .rhosts entries. For more information on executing remote commands without a password check the remsh man page on the HP and the rsh man page on the RS/6000.

Turning Your Workstation into an X Terminal

Occasionally you might want to connect to a machine of a different platform and perform administrative tasks completely within the environment of the remote machine. If you do, all you need to do is convert your local workstation into an X terminal connected to the remote machine.

To convert an HP workstation into an X terminal running off an RS/6000 called rs_node:

  1. Make sure xdm is running on the RS/6000. See the section on xdm in the RS/6000 section above for more details.
  2. Stop the X Window system on the HP by choosing a No Windows login from the login screen.
  3. Log in to the ASCII display.
  4. Type the following command:

    # X -query rs_node

  5. At this point you will see an RS/6000 xdm session running on your HP. Login as you normally do.
  6. To stop your session choose End Session from the Root Menu.
  7. To stop your X server on the HP press the Ctrl+Left Shift+Pause key combination. You will return to your HP ASCII screen. Type exit to resume your HP VUE session.

To convert an RS/6000 workstation into an X terminal running off an HP 9000 called hp_node:

  1. Make sure VUE is running on your HP.
  2. Login to your hft. If X starts up automatically, stop it by pressing Ctrl+Alt+Backspace.
  3. Type the following command:

    # X -query hp_node

  4. At this point you will seen HP VUE appear on your RS/6000. Login as you normally do.
  5. Logout as you normally do on an HP system.
  6. To stop the X server, press Ctrl+Alt+Backspace.

[Next Chapter: Appendix A]


Provide feedback to: alan_roberts@hp.com

[Table of Contents] [Outline] [Index] (Updated 09 MAR 97)
Copyright 1996 Hewlett-Packard Company. All rights reserved.