Advertisment

Run X Apps Remotely

author-image
PCQ Bureau
New Update

Imagine a Linux machine with a large-capacity hard disk, oodles of RAM and a fast processor. What if X (graphical) applications installed on such a powerful machine could be shared and worked upon by users sitting on different machines on the network. Let the IP address of this Linux machine on your private network be 192.168.1.1.

Advertisment

Set up server



First, you must run Telnet for users to log in remotely to this machine and run X applications. Issue the command ‘ntsysv’ and from the list of services select ‘telnet’. Restart the Linux machine. Log in as root on this machine and create accounts for users (using ‘useradd’ and ‘passwd‘commands) who will use the graphical applications installed on this machine.

The logic

When graphical X applications like Gimp,

StarOffice, or xmms run on a Linux machine they look for the location of a running X server to emit their graphical display. By default, the X server is assumed to be running on the same machine. However, by changing an environment variable named DISPLAY you can tell X applications to use an X server running on a different machine

User machines



On a user machine (for example, with IP 192.168.1.10), start the X server using the ‘startx’ command. In a terminal window within X issue:

Advertisment

xhost +192.168.1.1

(Syntax: xhost +)



The above command authorizes graphical applications launched on 192.168.1.1 to use the X server running on this machine for display. Now telnet to 192.168.1.1.

In the terminal window issue:






telnet 192.168.1.1











Login as a user previously setup and issue the following command.

Advertisment

export DISPLAY=192.168.1.10:0



(Syntax: export DISPLAY= :0)

Append this command in a file named .bash_profile (note the dot prefix) in your home directory (/home/) on 192.168.1.1. Start any X application, say Gimp, as:

gimp & (Syntax: &)






This will display the Gimp graphics editor on the X server running on the user’s machine. However, all the files which you open, save, or modify will be on the host machine.

X apps on Windows



What if the user machine is running Windows? Then you need an X server for Windows. On this month’s CD, you will find Xmanager in /usr/Utilities. After installing, start Xmanager from Start>Programs>Xmanager 1.3.9>Xmanager. Xmanager minimizes to the taskbar. Right click on it and select File>Configure. Click on ‘XDM’ tab and select the option ‘Do not use XDM (Passive)’. Click on Security tab, check the option ‘Enable Access Control’ and then click on the ‘Configure’ button. In the ‘New Host’ text field enter 192.168.1.1 and click on ‘Add’. This step corresponds to using ‘xhost’ command on Linux. Telnet to 192.168.1.1. The subsequent steps remain the same as for Linux.

Advertisment