Operating System Information --> Unix (WAM and Glue) --> General Usage Topics --> Displaying X Windows Applications On Remote Systems -->

Displaying X Windows Applications On Remote Systems

When connecting to a Unix system remotely from a PC, Mac, or other Unix system, you may wish to display X Windows applications on your local computer. To do this, you need to have an X Windows display manager with an access control program on the local computer, as well as properly set up the X forwarding from the remote system to the local system. To do this, the local system needs to be running an X Windows server (display manager); the remote Unix host has the X Windows client application.

The UM Unix systems (WAM & Glue Sun and Linux hosts) and newer Mac systems (including the WAM Macs) have an X Windows server installed as part of the operating system. Some Macs and all Windows PCs do not have an X Windows manager as part of the operating system; it will have to be installed prior to successfully running remote X Windows applications. On Mac OS X, the X Windows component is a part of the extended operating system; it may need to be explicitly installed from the Xcode2 (or Xcode, for older versions of OS X) developer tools. There are several X Windows display managers available for Microsoft Windows, both free and for a cost. The one the Office of Information Technology (OIT) Help Desk currently recommends for the Windows platform is the free XLiveCD distribution (from Indiana University, based on the Cygwin environment), which can either be installed on the hard drive or run directly from the CD. Mac OS X users can use the Apple-provided X server.

When you wish to connect from a local PC/Mac/Unix host to a remote Unix system, you must do two things before applications run on the remote host can be displayed on the local host; you must allow the remote host to display windows on the local host (access control), and you must tell the remote host where to display those windows (display name).

Access Control

The simplest way to provide access control to the remote host is to use the xhost program, which maintains a list of remote hosts which are allowed to make connections to the local X server. To add a host to the access list, use the syntax:

  xhost  +remote_host

where remote_host is the hostname of the remote Unix system. You can allow multiple remote hosts display access to your local system. To remove a host from the access list, use the syntax:

  xhost  -remote_host

To list which remote hosts are in the access list, simply type xhost, which will tell you if access control is currently enabled, and if so, which hosts are allowed access to the local display.

Note: On the WAM Macs, you may need to specify the complete path to the xhost command:

  /usr/X11R6/bin/xhost  +remote_host
Local display

On the remote system, you must tell it where to display the X Windows application prior to running it. This is done by setting the DISPLAY environment variable. The syntax to do this varies depending upon which login shell you're using on the remote host:

  csh/tcsh:     setenv  DISPLAY  local_host:0
  sh/bash/ksh:  DISPLAY=local_host:0; export DISPLAY

(Note that "DISPLAY" is in all caps.) Once you've added the remote host to the access control list and correctly specified the local display, you should be able to run X applications on the remote host and have them display on the local host.

Note: You can skip the DISPLAY step above if you are using the ssh program with the "-X" option to connect to the remote host. This will automatically enable X forwarding to the local display:

  ssh  -X  remote_host

For further information, refer to the Unix online documentation:

  man  xhost
  man  ssh
How do I:
How are we doing? Comments on this page?
Office of Information Technology
Office of Information Technology Help Desk Web Site University of Maryland Web Site Office of Information Technology Web Site