Remote X

Created May 28, 1998
Last updated June 18, 2000
Development stage: Alpha

Summary:

  1. Set DISPLAY variable (set DISPLAY="some.host:0")
  2. Allow hosts to connect to your X server (xhost +other.host.com)
  3. Start up a font server on the server side by typing xfs &.
  4. If you need to, set the address of the font server on the client side.
  5. On a terminal (telnet, ssh, rsh) on the remote host, type in the name of the program you want to run (gimp, netscape, and xv are a few).

This page is going to help you run X programs on another computer, but display it on your X session. This is especially helpful if you have a slow machine on your LAN or want to display X applications on a Windows machine.

I've been bugged and bugged and bugged by people who cry out about the security problems with this, from problems with xhost to lack of encryption--but note that this is intended for a home network. I will try to point out what you should do if you are very concerned about security even in a home environment.

Client Side (X Server Side) Configuration

On your client side (the computer you want to display and use the program) you need something that allows the display of X programs. On a Linux/Unix machine you'll probably just need to have something like XFree86 or MetroX; any standard X server will do, as long as it displays and starts up fine on your computer. If it's a Windows machine, you need to download an X server. Two that I know of are XWin32 and MI/X. You can look for more at Tucows, under server daemons, I think.

You should allow connections from the server side so that the programs can display. If you're using Unix/Linux on the client side, that can be done by typing xhost +server.side, to allow the hostname "server.side" to connect. You'll probably need to change the hostname to whatever the hostname of your Linux box is. With ssh you can just connect to the server and type the name of the program without setting xhost or $DISPLAY. I think it works by exporting the DISPLAY variable and automatically setting xhost to allow applications to be run from the server side. If $DISPLAY isn't set on the client side, I don't think it will be exported to the server side so that applications display on your screen. Thanks to Todd Cohen for pointing this out. If anyone can provide more information on this please let me know.

If you're using XWin32 you need to set Options -> XHost to the IP address of the machine with the X applications in XUtil32. With MI/X I don't recall having to set the host but my memory isn't fresh.

Font Setup

If the fonts that came with your X server don't work or you want to use the server side fonts, then set the font server to be the hostname of the server on port 7100. In XWin32 it's in XUtil32's Fonts -> Path dialog box; click on "Add Font Server" and in place of "xfs" use the hostname or IP address of the font server. For me I had the font server point to 192.168.0.1 on port 7100. If you're using a Linux/Unix box as your client, I'm not sure but I think you can use the command line xset +fp 192.168.0.1:7100, if 192.168.0.1 is the font server. If that command works for anybody, let me know.

A font server must be running on the server side. Read on to find out how to start it up.

Let me know if you find something useful to add to the information here.

Server Side Configuration

While on the server side (the machine that has the programs that you want to run), set and export the $DISPLAY variable by typing export DISPLAY="client.side:0". You can get into the server machine using telnet, rsh, or ssh.

If you're using a shell other than "bash" on the server side, set the variable accordingly. Most standard Linux distributions now use "bash".

Fonts

To have the fonts that are on your X server be used on the client side, you should start up a program called xfs as root. That's the X font server.

To have the X font server started up everytime you boot up your system, just put the path to the xfs executable in /etc/rc.d/rc.local. On my system, xfs is in /usr/X11R6/bin/xfs, so I have the line "/usr/X11R6/bin/xfs &" in /etc/rc.d/rc.local. The ampersand ("&") makes it a background process so that it doesn't tie up the server side by running in the foreground and preventing other tasks from being done.

Running the Program

After the client and server side setup, you should be able to run any program for X. You can try programs such as "xv", "xbill", or "netscape". They should run and display on the client side.

Author's Notes

Running remote X sessions through a standard dialup connection to the Internet is very slow. It will still work, but it's just way too slow.

MI/X seems to have trouble with fonts on my brother's Windows 95 system. It is missing some fonts that are commonly used, so "xgalaga" and "gimp" (as well as other Gtk+ applications) won't run. Instead, I just use XWin32, although that takes a while to start up and is crippleware (2 hour session limit). You also can't use it on more than one machine (node) on your network at the same time.

When saving files, you have to save them on the server side.

Related Pages


Comments, questions, suggestions, complaints? Send them all to joshuago at users dot sourceforge dot net using either your e-mail client, the guestbook, or the help form.


Copyright © 1997-2000 Joshua Go (joshuago at users dot sourceforge dot net). All rights reserved. Permission to use, distribute, and copy this document is hereby granted. You may modify this document as long as credit to me is given.