Friday, 12 July 2013

Our Friendship is Over. Xdummy Replaces Xvfb

I don't even know why I did this. Well, I kind of do. When I asked GNOME to play, he bitched about Xvfb not having RANDR extensions. Petty right?

I remember something when reading the x11vnc pages, about how this Xdummy was 'better' because it supports such a thing. So I went over to take a look. From their page;
A hack to run a stock Xorg(1) or XFree86(1) X server with the "dummy" (RAM-only framebuffer) video driver such that it AVOIDS the Linux VT switching, opening device files in /dev, keyboard and mouse conflicts, and other problems associated with the normal use of "dummy".
In other words, it tries to make Xorg/XFree86 with the "dummy" device driver act more like Xvfb(1). The primary motivation for the Xdummy script is to provide a virtual X server for x11vnc but with more features than Xvfb (or Xvnc); however it could be used for other reasons (e.g. better automated testing than with Xvfb.)  One nice thing is the dummy server supports RANDR dynamic resizing while Xvfb does not.
So, for example, x11vnc+Xdummy terminal services are a little better than x11vnc+Xvfb.
To achieve this, while running the real Xserver, Xdummy intercepts system and library calls via the LD_PRELOAD method and modifies the behaviour to make it work correctly (e.g. avoid the VT stuff.) LD_PRELOAD tricks are usually "clever hacks" and so might not work in all situations or break when something changes.
It pointed out that a driver should exist in this location;
/usr/lib/xorg/modules/drivers/dummy_drv.so
Unfortunately (as it would appear my luck), this file did not exist. The file is located in the package
xf86-video-dummy
Which... did not exist for the BB in Angstrom. Time to build it. I got the tar.gz file, and extracted it out. I noticed, unlike building x11vnc where I ran ./configure and then make, that the only file that could be run was autogen.sh. So I ran it. It seems this automagically pulls together a bunch of macro files (.m4) from /usr/share/aclocal and then does some other things, and then does the ./configure and then make for you. Assuming you don't get any errors. Which of course, I did.
./configure: line 20790: syntax error near unexpected token `RANDR,'
./configure: line 20790: `XORG_DRIVER_CHECK_EXT(RANDR, randrproto)'
Poking around, I noticed that this macro should exist in a file called xorg-server.m4 located in /usr/share/aclocal that I spoke of. I didn't have this file. It comes with the xserver-xorg-dev package, which thankfully exists. I ran autogen.sh again and...! Nothing. After literally hours, I ran across some reference to autoreconf and the --force option which will force updating all files. Hmmmm, perhaps this was the issue? Worth a shot. So, I opened the autogen.sh file, and added --force to the command;
autoreconf -v --install --force || exit 1
Ran again. Boom. Everything OK, and it spat out the library file into ./src/.libs

Now I had the driver, I also needed this Xdummy application. This comes with the tar.gz file that comes with x11vnc, and resides in the ./x11vnc/misc directory. Copy this to the /usr/bin folder.

Now, I start my startx slightly differently;
startx -- `which Xdummy` :1


And she's away! Sorry Xvfb, go sit in your corner.

1 comment:

  1. are you able to adjust the Xdummy resolution with xrandr?

    ReplyDelete