Easy Xwindows for PCs

For the first couple of decades of Unix-style systems, Xwindows, also known as X or X11, was part of every Unix-based workstation. In HP-UX, Xwindows started life in the late 1980s with mwm (Motif Window Manager) and later in the early 1990s, porting VUE (Visual User Environment) from the recently acquired Apollo Domain/OS computer line. Later, HP adopted CDE (Common Desktop Environment) from the COSE (Common Open Software Environment) which is still part of HP-UX releases. Xwindows is a method to communicate graphical information to a display, called a display server.

When VUE or CDE is run on an HP-UX workstation , the client is running the Xwindow programs (VUECDExclock, etc) and the display server is the video card and display. But because Xwindows is a network protocol, the graphics can be sent to another computer, any computer that is running an Xwindows server program. Today, the demise of Unix-based workstations is almost complete with only Linux as the lone holdout. Unix-style servers are almost always managed with shell commands and more recently, web pages. Indeed, a web page is similar to Xwindows — the graphics and text is created by a web program, then presented to a browser which is really a display server for html code.

Starting with HP-UX 11.31, CDE is no longer started in a standard HP-UX installation. Most sysadmins manage their HP-UX systems using a terminal emulator and login using ssh or telnet. But CDE is a desktop manager and as such, takes over the entire screen. If you are using a PC running MS Windows, or even running Linux, you already have a local desktop with email and browsers already running. CDE overlays all of that so now you must switch desktops to return to your local programs. And very few improvements have been made to the toolset in CDE, so text editors, color and font managers and printing are primitive by today’s standards. Thus, CDE is now optional in the startup scripts.

But what if I need Xwindows for an Oracle installation or for Data Protector (xomni)?

No problem. These programs will run just fine without CDE. The CDE desktop is just that — a desktop with a few tools. You already have a desktop on a PC or Linux system. All that is needed is to run a Xwindow emulator on your PC (Linux has it running by default). You then connect to the HP-UX box and login normally, then assign and export the environment variable: DISPLAY with the IP address or hostname for your PC/Linux system, the display server in this case. Added to the hostname or IP address is the screen number starting from 0 (zero) and the optional workspace number as in:

export DISPLAY=1.2.3.4:0.0

for IP address 1.2.3.4 using display 0, workspace 0. Now you can run xclock and it will popup on your local desktop — no CDE required.

You can also run xterm, dtterm or hpterm. But that is not the best choice for logging into a Unix-based system. When you run xterm, etc, you are running a terminal emulator on the HP-UX system while your PC then interprets all the colors and graphics and fonts sent over the network. Typically, starting a single xterm requires hundreds of (very small) network packets just to display the first window. Additionally, fonts chosen by the Xclient may not match the fonts available in your local Xwindow emulator, with messages like: “Warning: Cannot convert…” or “Warning: Unable to load any usable…”. The font size and/or family may not be available and the resultant display may not look as expected.

This can be mitigated by configuring your Xwindow emulator to use the fonts on your HP-UX system, thus guaranteeing a match. There are two steps for using a font server:

  1. On your HP-UX system:
    1. edit /etc/rc.config.d/xfs and change RUN_X_FONT_SERVER=0 to =1
    2. Start the font server: /sbin/init.d/xfs start
  2. On your local system, configure your Xwindow emulator to use a font server. This varies a lot between Xemulators but typically, you’ll specify the hostname or IP address and sometimes the port (7000) and protocol (TCP).

Now when you start an Xclient program such as xclock or xomni, you will see the correct fonts displayed and no error messages.

Xwindow clients for MS Windows can be expensive (Attatchmate/WRQ ‘s Reflection/X, OpenText (was Hummingbird) Exceed), or part of a bigger product (Cygwin/XVMware), or freeware like Xming. By far, Xming is the smallest and simplest to use as long as you customize the startup. Download Xming from: http://sourceforge.net/projects/xming/ Once installed, you can start it using Xlaunch (no change to the first 2 windows, always check the box No Access Control on the last window), something like this:

I have tried specifying the font server in the last window but it doesn’t seem to work (hangs and can’t be stopped without using the Windows Task Manager). So I recommend using a command line approach:

  1. Create a shortcut pointing to Xming (not Xlaunch).
  2. Right-click the shortcut and select Properties
    Change the Target to:
    “C:Program FilesXmingXming.exe” :0 -clipboard -multiwindow -ac -fp tcp/atl1:7000
    where atl1 is the hostname or IP address for the font server.
    Note: if the font server does not respond (wrong hostname, xfs not running, port 7000
    blocked, etc) then Xming will hang and must be killed with Task Manager.

Now Xming will start without any user interaction.

Refer to the SourceDirect blog:

http://blog.sourcedirect.com/?p=870

to see alternatives to the archaic Xwindow interface for terminal interaction.

– See more at: http://serviceitdirect.com/blog/easy-xwindows-pcs#sthash.WpcP5N31.dpuf


Tags: