Jump to content

HowTo: Making X-Terminals


qeldroma
 Share

Recommended Posts

Though i was asked for that, here's a small tutorial. Point for me is to make it EASY to understand.

I only explain the export of the visual, not sound, neither files.

 

1. Overview

What you see on your monitor is a transported picture. It is NOT a direct picture from your OS, but a picture from a "picture" server, the X-Server.

Difficult here is to understand the concept:

The X-Server servs the possibility to show something on a monitor (in fact, it's not desperate to do that on a monitor, if you program a needlepad, there you go ;)).

Therefor it listens to a display-port, where everyone could "post" something to show it. Normally your local OS is posting to the X-server on your machine, but this is not compulsory.

 

Try the following:

1. Go to the console and type "X :1 &".

2. Go back to the console and type "X :2 &".

3. And last but not least, "X :3 &".

 

This will start three X-Server on visual console number one to three. The first one is 0). The consoles are beginning on <ctrl><alt>-F7 to F10 on Mandrake.

 

Now we'll start some apps:

1. Type "export DISPLAY=0:1". After that "xvidtune &"

2. Type "export DISPLAY=0:2". After that "wmaker &"

3. Type "export DISPLAY=0:3". After that "kde &"

 

If you switch now between console F8, F9 and F10, you will see that you've started xvidtune, WindowMaker and kde at the same time on one machine, that's what it is, just a server ;)

 

You could change the resolutions and colordepths per console, so it's easy to imagine, that it' possible to put in some additional gracas and connect several monitors, one showing the script, second showing the output and third for surfing, etc....

 

The DISPLAY-variable defines, which X-Server to contact for the apps. The leading 0 means "localhost". So if you want to export the visual of an ap to machine 111.222.333.444, you just type "export

DISPLAY=111.222.333.444:0". Needless to say, that there must be a running X-Server on that machine.

 

And that's all you have to know to UNDERSTAND the way, x-terminals work.

 

2. HowTo setup

Be sure to be on the console without an X-Server running.

 

2.1 Font-Server

First of all, you must define the Font-Server for the X-session, that you are starting.

Normally, you've got an xfs-Server started on every machine, you've got. But why? The needed fonts are all the same, so you can reduce the resources to only ONE xfs. Important is now, that he SHOUTS out, where he is.

If you look into your /etc/init.d/xfs script, you will find the line, that starts the server.

daemon --check xfs xfs -port -1 -daemon -droppriv -user xfs

You just have to change the port, because -1 is localhost. Normally, port 7100 is used for that. Be sure to change it in the "restart"-section, too.

After you started the xfs-Server ("service xfs start"), everyone in the local subnet could find him on the specified port.

But where do the clients know this from?

Remember your XF86Config file: The first (well, one of the first 20 ;)) line describes the "FontPath". This is the variable for the xfs-Server.

 

Instead of "unix/:-1" write "1.2.3.4:7100", if the xfs server is on IP 1.2.3.4 on port 7100. Do that on all clients (you knew, did you :twisted: ).

 

2.2 login-manager

The second part is making a login-manager remote. There you go with three possibilities: kdm,gdm and xdm . Each of them works, so choose, what you like.

Theese are servers, too. But Servers for login. Why?

Think of really HUGE terminal-nets. What would happen, if the server fails? Nobody could logg in :shock:

To prevent this, there's a special protocoll XDMCP, which controls the communication between the servers and clients, while logging in.

The way it works is quiete simple:

Every login server "shouts" in the net, that he's ready for login, and the client takes the first, or shows a list of available servers for login.

 

2.3 make the client connect to the server

There are different ways. If you got only ONE server, you can take the IP of the server and integrate it in the X-startup script.

 

--------------------- pre LM9 ------------------------

/etc/inittab starts the X-Server. There is a line, which defines what to do at last in runlevel 5:

# Run xdm in runlevel 5

# xdm is now a separate service

x:5:respawn:/usr/bin/gdm -nodaemon

Insert "/etc/X11/X -query 1.2.3.4" instead of "/usr/bin/gdm".

 

--------------------- LM9 ------------------------

You've got to copy the "dm" script to "dm.old" and make a new one:

#! /bin/bash

X -query 1.2.3.4

 

If you got more than one XDMCP-Server, you type "-broadcast" instead of "-query hostname".

 

There are a lot of finetuning elements concerning the login-managers, just rtfm ;)

 

Some links:

http://tldp.org/HOWTO/mini/Remote-X-Apps.html

http://tldp.org/HOWTO/mini/XDM-Xterm/index.html

http://tldp.org/HOWTO/XDMCP-HOWTO/index.html

http://tldp.org/HOWTO/XFree86-HOWTO/index.html

 

 

Have fun :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...