[winswitch] using the dummy driver instead of Xvfb: get the goodies!
Antoine Martin
antoine at nagafix.co.uk
Fri Apr 8 16:24:14 BST 2011
Hi,
I've just added support for running Xpra against Xorg with the dummy
driver rather than using Xvfb. You can find the (beta) source here:
http://winswitch.org/src/xpra-0.0.7.19-rc1.tar.bz2
The main benefit is that we don't need to reserve a very large screen
and hope for the best, we can resize the screen as needed.
When a client connection is accepted, the server will find the best
resolution suitable for this particular client and re-size the dummy screen.
Obviously, if the server is running against Xvfb (which does not support
XRandr) the old behaviour still applies.
We also get a proper, supported Xorg server (Xvfb being unmaintained),
with the ability to load extensions: GL, etc.
Unfortunately... there are some constraints:
* The current version of the dummy driver upstream has some ridiculously
low limits (2048x2048). I have sent a patch which increases it to
(32767x32767), then we have to wait for distributors to pick it up... In
the meantime I have built some "fixed" RPMs for Fedora (13,14,15 and
rawhide) which you can find here:
http://winswitch.org/dists/rpm/Fedora/
* The Xorg server does not allow the user to specify the config file to
use or the log file location when not running as root... which would
make it pretty useless for using with xpra .. if it wasn't for Xdummy.
Xdummy uses LD_PRELOAD tricks to fool the Xorg process and allow us to
bypass these restrictions. Ideally, we can work something out with
upstream Xorg to lift these restriction somehow (they may be appropriate
when running against real hardware - but they are counter productive
when using dummy)
In order to use this, you will need Xdummy, which you can find here:
http://www.karlrunge.com/x11vnc/Xdummy
Caveats... xpra passes arguments that aren't valid for a regular Xorg
server. There is also the fact that Xdummy is an all-in-one shell script
with embedded C code.
So, I've extracted the useful bits and made a wrapper script which takes
care of trimming the arguments. You can find it all here:
https://winswitch.org/trac/browser/contrib-src/Xdummy
The instructions in the README file are for winswitch (svn version).
To use it with plain xpra just use:
xpra --xvfb=/usr/local/bin/Xdummy-xpra start :500
You will also need an Xorg dummy config file, you can use winswitch's:
https://winswitch.org/trac/browser/trunk/skel/share/winswitch/xorg-xdummy-xpra.conf
Other goodies worth thinking about: the nvidia propriatary driver
apparently supports a "display none" mode which means that it can be
used with a single xpra session to provide GPU acceleration.
Could be interesting to those with powerful workstation/desktops who
want to display 3D applications to a remote screen.
This should also work with VNC (when using vnc.so against a real server)
and with the new GStreamer screen streaming I've added to winswitch.
Ideally, the code could just create new modes as required rather than
finding the nearest match. After all, dummy can use almost any
dimensions as long as enough memory is allocated.
As for the memory, it may be possible to get the dummy to allocate
memory on demand rather than using the fixed value from the config file.
Although the unused memory can be swapped out, freeing it would be much
efficient/cleaner.
Finally, if the client resizes its screen whilst a session is connected,
the server won't know about it. This will need to be added (not
particularly hard - just needs doing)
Comments and feedback welcome.
Cheers
Antoine
More information about the shifter-users
mailing list