Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have been learning about how the client and server interact and I read that the X window system,
"uses a client/server model in which clients provide data and
services to servers, and servers supply display and interaction
capabilities to clients"
I am a little confused as to how a server can supply display capabilities to a client considering that the client is the machine who is communicating with the display device (eg. monitor, tv, etc.)
I am a little confused as to how a server can supply display capabilities to a client considering that the client is the machine who is communicating with the display device (eg. monitor, tv, etc.)
Not an expert but it looks like you've overlooked that X is the other way round to normal server-client things.
The *server* is connected to the display. It has to run the display. So the local computer, if it's the one connected to the display, has the server on it, and typically a client as well - if it needs to use the display. And the remote computers just have X clients on them.
Incidentally a very downmarket computer indeed is often all that is necessary to be the server. Perhaps even an old 486.
Lets say you have two towers and one monitor and they are all connected.
One tower runs the server, and one the client.
Which of the two towers would be connected to the Monitor?
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
Quote:
Originally Posted by Martian Gnome
SO X-Clients don't have a display then?
Lets say you have two towers and one monitor and they are all connected.
One tower runs the server, and one the client.
Which of the two towers would be connected to the Monitor?
X is actually a server that does displaying for the local host and for remote workstations. say like you want to get a display from a windows box, you could setup X to send remote screen and when you putty in you would get a desktop instead of the terminal.
As for which one of the two tower would be connected to the monitor it doesn't matter as both are running the X-server.
Lets say you have two towers and one monitor and they are all connected.
One tower runs the server, and one the client.
Which of the two towers would be connected to the Monitor?
Don't take my word I've forgotten most of this stuff.
Tower1 has the X server program on it. Tower2 has the X client on it as you say.
Tower1 has to be connected to the single monitor for X to work. You can only display anything in X on the monitor using tower2, tower1 cannot put anything on the monitor using X.
If it was needed to use tower1 to put stuff on the monitor using X tower1 would need the X client program installed as well as the X server.
In a single computer set up for example there will be the X client *and* the X server installed on the computer.
Last edited by lugoteehalt; 06-07-2010 at 06:38 PM.
The server is at your terminal. The client is the program you are running. This program may be running on the same computer or on a remote host. At one time, before PCs, there would be a mini or main frame Unix computer that would run the applications. The users used X terminals. These terminals run the X server. In this classic setup, you would log into an x session (xdmcp login) on a remote computer and run the desktop environment on that remote machine.
The DISPLAY variable in a program's environment determines which terminal it is displayed on (and the mouse and keyboard input comes from). If you use "ssh -X" you can run programs on different remote computers and have them displayed on your local display (X terminal).
Suppose you have a computer that you use as a media server (called media for example). You can be at your laptop and start mplayer remotely and have it play on your plasma tv's input by entering:
ssh -X mplayer -fs -display :0.0 <videofile>
Without the -display :0.0, ssh would use :10.0 which is a proxy for your laptops display. In this default case, the media server wouldn't need to be running the Xorg server but the laptop would. The programs installed on the server would probably have Xorg libraries as dependencies. You may need it installed, but it doesn't need to be started if the display is remote to the server (e.g. your laptop).
The display used could even be located at a third computer. Most distro's make this more difficult today for security reasons. xauth cookies need to be passed to give access to the display. PAM's ssh configuration does this for you in the background. However in the last 6 months, using "ssh -X" isn't as easy when launching KDE and Gnome programs, because these programs may now use dbus for interprocess communications. I have added this to my ~/.bashrc file allow remote programs to work:
Code:
test -s ~/.alias && . ~/.alias || true
if [[ -n "$DISPLAY" ]] && [[ -n "$SSH_CLIENT" ]] && [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]] ; then
## if not found, launch a new one
eval $(dbus-launch --exit-with-session)
export DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
On some distro's this may be done in the background for you by PAM. I'm using a 6 mo old distro with newer KDE backported programs, which may be why this is necessary for me.
Just one last thing, since the client is the program being ran, then the server would be running possibly hundreds of clients at a time(1 for an email app, another for web page app, another for a gaming app, etc.).
It may be better to say that the X server could be receiving messages from hundreds of clients at a time.
The messages are sent over the network, which will be localhost if the program and client are on the same machine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.