|
Project: Linux Articles
Guide to X-terminal setup
By Mayank Sarup <mayank@freeos.com>
Posted: ( 2000-10-25 08:03:09 EST by )
X-Terminals are a great way to revive your old machine or make your
diskless workstation that much more productive. StarOffice 5.2 may not run
on your 486, but you can run it off another machine and export the display
to your monitor.
The dusty old machine lying in the corner can be revived with Linux. But when it comes to more memory hungry apps like Netscape and StarOffice then you're at a loss. If however, you have a Linux machine on your network with bigger hardware then you're in luck. Make that the X client and designate the low end machine as the X server. The X-terminal concept is essentially like telneting into a machine and then running some application there. All the working is done on the machine that you are connecting to but the display is shown on your machine. That just gives you access to console mode text applications, whereas an X-Terminal setup will give you access to the entire range of GUI applications. All applications will be run on the server but the display will be exported to your computer. The machine that you setup as the X terminal just serves as a display. This setup works very well with diskless workstations and older computers. First a little theory for you. The X server is the software that handles all the interactions between the GUI and your hardware. Windows equivalent would be the graphics card driver. But X is a lot more than than. Here it becomes a server that your clients connect to. Clients would be the various GUI applications like GNOME, KDE etc communicating through network protocols. This architecture allows a lot of flexibility. The clients can be run on any machine but the display can be routed to another machine. For remote logins via X you need to enable xdm on the server. Xdm is the X Display Manager which manages the login and authentication of users. Think of it as the old text login screen with a nicer GUI layout. Good feature is that not only does it authenticate users locally, it also provides a login screen to any client that will connect to it. Find the xdm-config file. This should be in /usr/X11R6/lib/X11/xdm (SuSE) or in /etc/X11/xdm (Red Hat, Mandrake). Open xdm-config. At the bottom of the file is look for a line that says DisplayManager.requestPort: 0 This line needs to be commented out ( Put a '#' in front of it ) if you want to allow external X clients to be able to connect to the server. Edit the Xaccess file. Uncomment out the line with a '*' if it exists. If not then add a line at the top which contains only a '*'. This will allow hosts to connect directly to the server. There are several ways in which a client may connect to the server. 1. By directly specifying the host to connect to ( Direct query ). 2. Broadcast a request over the network which is taken up by the first server to respond. 3. Make a indirect query where the client connects to a specific server which in turn provides it with a list of servers that offer X logins. The client selects the server to connect to from the list and then connects to that server. Direct queries are fine over a small network. Next edit the Xservers file. There should be a line that looks like :0 local /usr/X11R6/bin/X :0 vt07. (SuSE) :0 local /usr/X11R6/bin/X (Red Hat) This line defines the virtual terminal that xdm will start on by default. Comment this line out if you need the services of xdm but do not want it to take up a terminal at startup. That's it. If xdm is running then restart it with killall -HUP xdm. Now for the client. The first thing to do is to setup the local X server. Make sure that your video card is supported by and able to run X. Use xf86config or the X setup tool that your distribution provides to set it up. Red Hat has Xconfigurator and SuSE has Sax. After X is setup, all that a client will need to run X -query xserver. e.g. - X -query foobar or X -query 192.168.0.12 What's given above is a direct query where I have specified the server that I want to connect to. For broadcast queries use: X -broadcast The first server running xdm that responds will be the one you connect to. For indirect queries: X -indirect foobar On connecting to foobar, it will provide me with a list of willing hosts on the network. Select the one you want to connect to and login there. Replace xserver with the hostname or IP address of the server that you will be connecting to. You will be prompted with a login box. Just login to the server with a login/password pair that is valid on the server and you will be given access. Now you can run any applications that you want on the server. Only the display will be exported to you. If everything is working then you might want to ensure that xdm is started on the server at every boot. In most distributions you can just modify /etc/inittab to start xdm at boot. Open /etc/inittab and go down till you see a line like the one below id:2:initdefault: Change the '2' entry here to the runlevel where xdm will be started. This would be 5 in the case of Red Hat and 3 for SuSE. As an alternative you can just start xdm from your startup scripts. If you are using an alternative config file or your file is in some location other than the default then you might want to use the parameter -config to point xdm to your file. xdm -config /etc/xdm.config If the xdm screen looks a little plain, then you can instead choose to run kdm. No other configuration is required. You should however take a look at kdmrc. This will be in /opt/kde/share/config for SuSE and in /usr/share/config/ for Red Hat. You can customize fonts, background wallpaper and a host of other settings. The defaults should work fine. I haven't tried gdm but I expect it to be a drop in replacement for xdm. If someone out there has tried it then please tell me. Quick X-Terminal If you just want to run a few applications off the server then you can still do that and with a minimum of effort. Start X and open xterm or rxvt or your favourite terminal emulator for X. In the terminal type the following. xhost +192.168.0.12 This will add the above address to the access control list. This will be the IP or hostname of the machine on which you will be running the application. This is needed to allow that machine to communicate with your X server. You can also type 'xhost +' to disable all access control and allow anyone to connect to your X server. Now telnet into the machine you specified above. telnet 192.168.0.12 Type the following on it. export DISPLAY=192.168.0.13:0 This will set the environment variable DISPLAY to point to your machine. Replace this with your own IP address. The ':0' part is the screen that any client application should connect to. You only need to specify something else here if you're running multiple X sessions on your machine. Just start the application. I've selected a suitably hoggy application. netscape This will start Netscape on the machine that you are connected to but display everything on your monitor. Do not close the terminal that you used to connect to that machine or you will break the connection and shut down all the applications that you're running off the other machine.
Other articles by Mayank Sarup
Current Rating: [ 7.44 / 10 ]
Number of Times Rated: [ 68 ]
|