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
menuconfig phase you should enable framebuffer
UML-specific options/Graphics support/Support for frame
buffer devices). Then, in the
support/Console display driver support menu disable
text console, enable
Framebuffer Console support,
Select compiled-in fonts and select a suitable font,
VGA 8x16 font. Back in the
options menu enable
Shared Memory Framebuffer driver.
To enable the shared memory
framebuffer device add the option
to the UML kernel command line. For example,
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: http://libvncserver.sourceforge.net/.
Once you've built the clients you can run them as:
uml_xtfb --umid <name>or
uml_vncfb --umid <name>
<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:
As an alternative to starting the client programs by hand you can also
use a UML kernel command line option of the form
<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!