root / README.xpra

Revision 72e3fcb93dda5b86179d7fe4a11d4ba5418f065b, 11.4 kB (checked in by njs@…, 2 weeks ago)

hopefully clarify wording in README.xpra a little more

Line 
1FAQ for xpra
2============
3
4What is xpra?
5-------------
6
7Xpra is 'screen for X' -- it allows you to run X programs, usually on
8a remote host, direct their display to your local machine, and then to
9disconnect from these programs and reconnect from the same or another
10machine, without losing any state.
11
12
13Wait, isn't that what VNC does?
14-------------------------------
15
16VNC is another system for using apps remotely.  The main difference
17between xpra and VNC is that xpra is "rootless" -- i.e., programs you
18run under it show up on your desktop as regular programs, managed by
19your regular window manager, instead of being trapped inside a box.
20It gives you "remote applications", not a "remote desktop".  (Hence
21the name -- "X Persistent Remote Applications".)
22
23Another difference is that VNC is far more portable -- you can get
24both 'servers' and 'viewers' for essentially any operating system.
25For xpra, you can only run X programs against the 'server', and the
26current codebase also assumes some Unix-isms (e.g., unix domain
27sockets).  The xpra viewer is more portable (in principle) -- the
28existing one should be able to work anywhere that GTK+ does, and it's
29only a few hundred lines of code in any case, so is easy to replace.
30
31Basically, if you want a remote desktop, use VNC; if you just want to
32run a few programs remotely, use xpra.
33
34
35What about NX?
36--------------
37
38NX is the name for a protocol, rootless X server, mass of management
39scripts, etc., produced by NoMachine Inc.  There's some very nice tech
40in NX, and in principle it can do everything that xpra does and more.
41In practice, they offer either a super-slick, complete thin client
42solution with some questionable (IMO) engineering decisions and a
43proprietary license, or, a minimally-documented code dump of GPLed
44software with a build system straight from the 1980s, an included fork
45of the old X.org monolithic (!) tree, and if you somehow get it built
46then it has all sorts of weird quirks to work around.  Xpra, by
47comparison, is <1000 source lines of code for the core, was written in
48a weekend, and just works.
49
50NX seems aimed at large enterprise thin client deployments, and I just
51want a way to run data visualization jobs that won't die when my
52wireless does -- xpra is great for the latter.
53
54
55And what about xmove?
56---------------------
57
58xmove is a tool designed to do exactly the same thing as xpra.  The
59main differences are that xmove uses a very different implementation
60strategy (it implements a "pseudo" X server, while xpra takes
61advantage of the standard X.org server), and that xmove has been
62unmaintained since ~1997.
63
64I have not personally used xmove, and X clients tend to be very
65conservative -- it's entirely possible that all modern X apps will
66still work just fine against a 10+ year old server like xmove.
67However, X *has* changed since then; for example, xmove does not
68support the Render extension, which is essentially required if you
69want anti-aliased fonts.  Between the somewhat cumbersome design and
70the lack of existing maintainers, this will almost certainly never get
71fixed; nor will any other flaws that xmove may have.  (For instance,
72xpra looks easier to set up without writing custom shell scripts.)
73
74The other major issue with xmove's design is its sensitivity to
75latency.  Usually, if you're using a tool like xmove or xpra, it's
76because you want to run an app on a remote computer.  Usually you
77don't have a local ethernet connection to that remote computer, but
78rather something with a much higher ping time.  Standard X forwarding
79becomes notoriously slow and unusable in such situations -- and xmove
80uses the same mechanisms as standard X.  Xpra, on the other hand, uses
81a protocol with no round trips, and applications forwarded by xpra
82should remain snappy and responsive over connections that make X or
83xmove crawl away to die.
84
85Still, like I said, I haven't actually used xmove, and would be
86interested to hear from those who do.
87
88
89Okay, so how do I try xpra?
90---------------------------
91
92Download the latest version from
93  http://partiwm.org/static/downloads/
94
95Make sure you have the dependencies, at least:
96  development packages for python-gtk, and all dependencies
97  Xvfb
98  pyrex (version 0.9.7 at least, check with 'pyrexc --version')
99On Debian-based OSes, I think it's:
100  # aptitude install libx11-dev libxtst-dev libxcomposite-dev \
101    libxdamage-dev python-gobject-dev python-gtk2-dev xvfb python-pyrex
102And a mailing list report suggests the following for Fedora:
103  # yum install xorg-x11-server-Xvfb Pyrex libX11-devel \
104    libXtst-devel libXcomposite-devel libXdamage-devel pygobject2-devel \
105    pygtk2-devel gtk2-devel
106(If you work out a similar line for another OS, like Gentoo or FreeBSD
107or whatever, please send it in.)
108
109Build it:
110  tar xvzf parti-all-<whatever>.tar.gz
111  cd parti-all-<whatever>
112  ./do-build
113  export PYTHONPATH=$PWD/install/lib/python:$PYTHONPATH
114Note 1: If running and displaying apps on two different machines, then
115  you'll need to do this on both of them, obviously.
116Note 2: If you're on a 64-bit Redhat-ish distro (one with multilib
117  support), then you may need to replace 'lib' with 'lib64' above.
118
119On the machine where you will run the apps (usually, a remote machine):
120  install/bin/xpra start :13
121
122On the machine where you want the apps to display (usually, your local machine):
123  install/bin/xpra attach ssh:<remote box>:13
124or if displaying on the same machine for testing, just:
125  install/bin/xpra attach :13
126
127Then on the machine where you ran 'xpra start' (usually, the remote
128machine), start some apps:
129  export DISPLAY=:13
130  emacs
131
132
133So how does it work?
134--------------------
135
136Very well, thank you.
137
138Oh, you mean... right.
139
140Okay.  So you may have heard about these fancy newfangled "compositing
141window managers".  Here's how they work.  Normally, when you run an
142app under X, the app is responsible for drawing stuff into the windows
143it owns, and then the X server combines those windows on the screen to
144produce the final desktop view that you interact with.  Compositing
145managers change this.  If you are running a compositing manager, then
146each app still decides what goes in each of its own windows, but the X
147server stops putting those windows on the screen.  Instead, the job of
148reading those images for each window and creating a display on the
149screen falls to the compositing manager.
150
151Xpra works by connecting to an ordinary X server as a compositing
152manager -- but instead of combining the window images to present on
153the screen, it takes the window images and stuffs them into a network
154connection to the xpra client, which then displays them onto the
155*remote* screen.  It also acts as a window manager for the X server it
156is running against, but it doesn't actually have any window manager
157policy built into it.  Instead, it takes all the window management
158requests from the applications, sends them over the wire to the
159client, who then issues those same requests on the real display, waits
160to see what answer your real window manager gives, and then forwards
161that answer back to the xpra server.
162
163(So note that there are actually *two* X servers here -- one on your
164remote host that your apps actually run against, and then the local
165one that you're sitting at, where the apps end up being displayed.)
166
167Now, unless you're debugging xpra's guts, you never want to actually
168see the X server that xpra is connected to, especially since it's
169generally on some far away host that doesn't have a monitor, and if it
170did the screen would just be black anyway (because we don't composite
171properly, y'see).  So 'xpra start' will silently spawn 'Xvfb', which
172is a special X server with all its video drivers ripped out, and then
173connect to it, so now that you've finished reading this section you
174can forget all about it again and just use xpra and be happy.
175
176Maybe a picture with boxes in will help:
177
178 +-----+     +--------+                                                 
179 |     |     |  your  |     +---------+                                 
180 | you | <-> |   X    | <-> |'xpra    |                                 
181 |     |     | server |     |  attach'|                                 
182 +-----+     +--------+     +---------+                                 
183                                 ^                                       
184                                 |                                       
185                              INTERNET!                                 
186                                 |                                       
187                                 v                                       
188                            +---------+                                 
189                            |'xpra    |     +------+     +-------------+
190                            |   start'| <-> |      | <-> | firefox     |
191                            +---------+     | Xvfb |     | or whatever |
192                                            |      |     +-------------+
193                                            +------+                     
194
195
196No, actually, I really did mean how *well* does it work?
197--------------------------------------------------------
198
199Oh.  Sorry.  Heh.
200
201As a first release, some lower priority features aren't included -- it
202doesn't support window icons, transient hints, shaped windows, cursor
203changing, input grabs, clipboard sharing, etc.  These are all
204straightforward to add, however, and in practice xpra seems to already
205be very usable without them.
206
207I don't know yet how well it handles different bandwidth/latency
208networks -- if you run xpra over a modem or something, let me know how
209it goes for you.  In principle, it should be dramatically less
210latency-sensitive than raw X, and might use more or less bandwidth
211depending on task, but in practice I haven't verified this.
212
213There are two main issues that are worth special warnings:
214
215First, I'm not sure yet how well the network protocol does at adapting
216to the characteristics of your network -- i.e., scaling down how much
217data it sends to avoid overloading the network and retain
218responsiveness.  In particular, if your TCP stack or your SSH client
219do aggressive buffering, then this may screw up xpar's ability to
220correctly adapt.  If this happens, you might see applications "stall
221out", i.e. stop responding.  If you wait a few seconds, the buffers
222should drain and things should return to normal.  Let me know if you
223see this happening frequently, though; if so we may need to add
224countermeasures.
225
226Secondly, the X keyboard model makes it hard to get keypresses right.
227If you have similar keymaps on both X servers, then you should be
228fine.  More complicated setups will probably not work -- e.g., if
229xpra's Xvfb is running with an English keymap, and you try to type and
230accented character that does not exist in that keymap, then it won't
231work.  This is a hard problem, in general, but improvements should be
232possible.  If you run into this, again, send an email -- extra points
233if it contains a patch :-).
234
235
236What's this 'parti' thing, and what does it have to do with xpra?
237-----------------------------------------------------------------
238
239Parti is a window manager that I'm working on.  So I wrote a bunch of
240WM code.  Then I realized that with a few tweaks, I could have xpra,
241and that would be awesome.  So I ripped out parti's WM backend code
242into a separate library, and now both parti and xpra use that library
243('wimpiggy').  Xpra is quite functional now, but Parti and wimpiggy
244are still under heavy development, so for now I'm still keeping
245everything together in one tree, to avoid version skew issues.
Note: See TracBrowser for help on using the browser.