root / README.xpra

Revision 29009acfbe56cac3e922b6c936e5dfdc8623fdf3, 10.8 kB (checked in by njs@…, 7 months ago)

update dependencies in README files

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
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
102(If you work out a similar line for another OS, like Fedora or FreeBSD
103or whatever, please send it in.)
104
105Build it:
106  tar xvzf parti-all-<whatever>.tar.gz
107  cd parti-all-<whatever>
108  ./do-build
109  export PYTHONPATH=$PWD/install/lib/python:$PYTHONPATH
110(If running and displaying apps on two different machines, then you'll
111need to do this on both of them, obviously.)
112
113On the machine where you will run the apps:
114  install/bin/xpra start :13
115
116On the machine where you want the apps to display:
117  install/bin/xpra attach ssh:<remote box>:13
118or if displaying on the same machine for testing, just:
119  install/bin/xpra attach :13
120
121Start some apps:
122  export DISPLAY=:13
123  emacs
124
125
126So how does it work?
127--------------------
128
129Very well, thank you.
130
131Oh, you mean... right.
132
133Okay.  So you may have heard about these fancy newfangled "compositing
134window managers".  Here's how they work.  Normally, when you run an
135app under X, the app is responsible for drawing stuff into the windows
136it owns, and then the X server combines those windows on the screen to
137produce the final desktop view that you interact with.  Compositing
138managers change this.  If you are running a compositing manager, then
139each app still decides what goes in each of its own windows, but the X
140server stops putting those windows on the screen.  Instead, the job of
141reading those images for each window and creating a display on the
142screen falls to the compositing manager.
143
144Xpra works by connecting to an ordinary X server as a compositing
145manager -- but instead of combining the window images to present on
146the screen, it takes the window images and stuffs them into a network
147connection to the xpra client, which then displays them onto the
148*remote* screen.  It also acts as a window manager for the X server it
149is running against, but it doesn't actually have any window manager
150policy built into it.  Instead, it takes all the window management
151requests from the applications, sends them over the wire to the
152client, who then issues those same requests on the real display, waits
153to see what answer your real window manager gives, and then forwards
154that answer back to the xpra server.
155
156(So note that there are actually *two* X servers here -- one on your
157remote host that your apps actually run against, and then the local
158one that you're sitting at, where the apps end up being displayed.)
159
160Now, unless you're debugging xpra's guts, you never want to actually
161see the X server that xpra is connected to, especially since it's
162generally on some far away host that doesn't have a monitor, and if it
163did the screen would just be black anyway (because we don't composite
164properly, y'see).  So 'xpra start' will silently spawn 'Xvfb', which
165is a special X server with all its video drivers ripped out, and then
166connect to it, so now that you've finished reading this section you
167can forget all about it again and just use xpra and be happy.
168
169Maybe a picture with boxes in will help:
170
171 +-----+     +--------+                                                 
172 |     |     |  your  |     +---------+                                 
173 | you | <-> |   X    | <-> |'xpra    |                                 
174 |     |     | server |     |  attach'|                                 
175 +-----+     +--------+     +---------+                                 
176                                 ^                                       
177                                 |                                       
178                              INTERNET!                                 
179                                 |                                       
180                                 v                                       
181                            +---------+                                 
182                            |'xpra    |     +------+     +-------------+
183                            |   start'| <-> |      | <-> | firefox     |
184                            +---------+     | Xvfb |     | or whatever |
185                                            |      |     +-------------+
186                                            +------+                     
187
188
189No, actually, I really did mean how *well* does it work?
190--------------------------------------------------------
191
192Oh.  Sorry.  Heh.
193
194As a first release, some lower priority features aren't included -- it
195doesn't support window icons, transient hints, shaped windows, cursor
196changing, input grabs, clipboard sharing, etc.  These are all
197straightforward to add, however, and in practice xpra seems to already
198be very usable without them.
199
200I don't know yet how well it handles different bandwidth/latency
201networks -- if you run xpra over a modem or something, let me know how
202it goes for you.  In principle, it should be dramatically less
203latency-sensitive than raw X, and might use more or less bandwidth
204depending on task, but in practice I haven't verified this.
205
206There are two main issues that are worth special warnings:
207
208First, I'm not sure yet how well the network protocol does at adapting
209to the characteristics of your network -- i.e., scaling down how much
210data it sends to avoid overloading the network and retain
211responsiveness.  In particular, if your TCP stack or your SSH client
212do aggressive buffering, then this may screw up xpar's ability to
213correctly adapt.  If this happens, you might see applications "stall
214out", i.e. stop responding.  If you wait a few seconds, the buffers
215should drain and things should return to normal.  Let me know if you
216see this happening frequently, though; if so we may need to add
217countermeasures.
218
219Secondly, the X keyboard model makes it hard to get keypresses right.
220If you have similar keymaps on both X servers, then you should be
221fine.  More complicated setups will probably not work -- e.g., if
222xpra's Xvfb is running with an English keymap, and you try to type and
223accented character that does not exist in that keymap, then it won't
224work.  This is a hard problem, in general, but improvements should be
225possible.  If you run into this, again, send an email -- extra points
226if it contains a patch :-).
227
228
229What's this 'parti' thing, and what does it have to do with xpra?
230-----------------------------------------------------------------
231
232Parti is a window manager that I'm working on.  So I wrote a bunch of
233WM code.  Then I realized that with a few tweaks, I could have xpra,
234and that would be awesome.  So I ripped out parti's WM backend code
235into a separate library, and now both parti and xpra use that library
236('wimpiggy').  Xpra is quite functional now, but Parti and wimpiggy
237are still under heavy development, so for now I'm still keeping
238everything together in one tree, to avoid version skew issues.
Note: See TracBrowser for help on using the browser.