Shared memory framebuffer for User Mode Linux

This patch to the Linux kernel implements a shared memory framebuffer for User Mode Linux:


Apply the patch and build the kernel in the usual way:

   tar xfj linux-2.6.29.tar.bz2
   cd linux-2.6.29
   patch -p1 <linux-2.6.29-shm-fb.patch
   make defconfig ARCH=um
   make menuconfig ARCH=um
   make linux ARCH=um

During the menuconfig phase you should enable framebuffer devices (UML-specific options/Graphics support/Support for frame buffer devices). Then, in the UML-specific options/Graphics support/Console display driver support menu disable VGA text console, enable Framebuffer Console support, enable Select compiled-in fonts and select a suitable font, for example, VGA 8x16 font. Back in the UML-specific options menu enable Shared Memory Framebuffer driver.

To enable the shared memory framebuffer device add the option shmfb=widthxheightxdepth to the UML kernel command line. For example, shmfb=800x600x4. The width and height can have any reasonable values. The depth can currently only be 2 or 4 bytes per pixel.

When the kernel boots it will use the framebuffer device as its console, but you won't be able to see anything! To make the framebuffer console visible you need a separate client application to run on the host. Two clients are provided, a simple Xt-based window and a VNC server:


To build the VNC server client you'll need libvncserver. If this isn't in your distro's package repository you can get it from the project's Sourceforge page:

Once you've built the clients you can run them as:

   uml_xtfb --umid <name>
   uml_vncfb --umid <name>

where <name> is the name of your UML instance. If you've run the VNC client you still won't be able to see anything! You now need to run a VNC viewer:

   vncviewer localhost:0

As an alternative to starting the client programs by hand you can also use a UML kernel command line option of the form shmfb_client=<path_to_client>, where <path_to_client> is, as you might expect, the path to the client you'd like to use.

There are a few problems with the client programs:

(Adjusting the mouse acceleration in the console mouse server (gpmd) or X server (set m, or your desktop manager's GUI equivalent) helps with some of the mouse issues.)

The kernel patch is based on the X11 framebuffer driver by Gerd Knorr. Without Gerd's work I wouldn't have been able to achieve anything. Thanks!

Ron Yorston
23rd November 2008 (updated 28th March 2009)