Stuff for QEMU


QEMU is an Open Source "machine emulator and virtualizer", similar in concept to more well-known projects like VMWare or Bochs. QEMU works remarkably well, performs remarkably well, and is easy to use (orders of magnitude easier to use than Bochs). This page contains some stuff which QEMU users may (or may not) find useful...

Screenshot:

Here's a screenshot of qemu running DamnSmallLinux and two different installations of Debian (one with X11 and one without):

(Hmmm... it seems the clocks are wrong in the debian installations...)

Precompiled QEMU for 32-bit x86:

The most vexing problem with qemu is that it cannot be compiled with gcc 4.x. Building it on *nix machines requires gcc 3.x, which has been long out of date. To simplify life for those who do not have gcc 3.x installed, here you can grab a precompiled binary. The package was built on a Kubuntu 7.04 box and "should" work on any Debian 4.0 derivative (Ubuntu, Edubuntu, etc.). It may or may not work on other Linuxes (Linuxis?). Unfortunately, the statically-linked qemu build would not build on my machine, so this binary requires some other shared libraries to be installed (libSDL, libdl, libdirectfb, libfusion, libdirect, libasound, and a few standard (or very common) system libraries).

To install, simply unpack the tarball from your root directory. That will install the package under /opt/qemu, so as to not interfere with a system-installed package (typically qemu 0.8.x).

qemu-0.9.0-debian4-x86_32-opt-qemu.tar.bz2 (4404214 bytes, last modified 2007.Jun.25)

Empty image files:

The qemu-img tool makes creating new "image files" (container files for qemu installations) trivial. My minor complaint with that tool is, however, that the created files are "sparse" (at least on filesystems which support this). That means that if you create a 2GB image file, it it doesn't actually take up 2GB of space (only the "used" parts of the file take up space) (again only on filesystems which support this). While admittedly a useful feature, it is also deceptive, in my opinion, because with it you can pack 500 files, each 4GB, on a 10GB hard drive, which is philosophically evil. So... here are a couple non-sparse image files which can be decompressed and used as qemu containers:
Filename Size (bytes) Date (Y.M.D)
1GB-empty.raw.bz2 785 2007.06.25
2GB-empty.raw.bz2 1522 2007.06.25
3GB-empty.raw.bz2 2289 2007.06.25
4GB-empty.raw.bz2 3023 2007.06.25
ACHTUNG: while the above files are TINY, when decompressed them they become HUGE. Due to the magic of bzip2, files filled with the same pattern over and over (in this case zeroes) can be compressed to a small fraction of a percent of their original size. Compare that with gzip, which can compress, at the very best, down to 0.1% of the original file size, whereas bzip2 can compress these images to approximately 0.0000007 percent of their original size!

These files can also be used as Linux swap files, by the way.

A tip for creating non-sparse image files with qemu-img: create a raw-format image as normal:

qemu-img create -f raw myimage.raw 500M

That will create a sparse file which doesn't really take up 500MB. To force it to be non-sparse, simply gzip it and then ungzip it.

OS images:

Below is a list of OS images i have prepared for QEMU. Note that most of them are "skeleton" images. That is, they are installed but probably not configured to do anything special. To use these images, simply decompress them (using the bzip2 or, for Windows platforms, 7-zip) and then run:

qemu [options] imagefile.raw

Before downloading: be aware that most of these files are huge - more than a gigabyte compressed and possibly up to 3-4GB uncompressed.
  • Damn Small Linux-N, the slightly bigger brother of Damn Small Linux:
    DamnSmallLinux-N-1GB-qemu.raw.bz2 (176488624 bytes, last modified 2007.Jun.25)
    That's version "01RC4" of DSL-N and is ever so slightly modified to remove the default X11 background/desktop image and to remove the system CPU/memory/network monitor (which i find annoying in an embedded/qemu context because it's relatively resource intensive itself).
  • Debian GNU/Linux 4.0 base installation:
    Debian4-Base-qemu.raw.bz2 (1090198318 bytes, last modified 2007.Jun.25)
  • Debian GNU/Linux 4.0 base+X11 installation:
    Debian4-BasePlusX11-qemu.raw.bz2 (1102427821 bytes, last modified 2007.Jun.25)
    (Achtung: in both of these Debian images i removed the hwclock-related startup scripts because they segfault when running under qemu.)
  • FreeBSD 6.2 base image:
    FreeBSD-6.2-qemu.raw.bz2 (365089675 bytes, last modified 2007.Jun.25)
    (Every time i try to install *BSD i just get frustrated with it, so i haven't actually used this image. Just getting it installed took four attempts.)
  • FreeDOS 1.0 with almost everything installed (but no sources):
    FreeDOS-1.0-qemu.raw.bz2 (86073257 bytes, last modified 2007.Jun.25)
  • i thought installing Minix would be fun, but the thing is terribly slow so i haven't toyed with it at all:
    Minix-3.1.3-qemu.raw.bz2 (10226267 bytes, last modified 2007.Jun.25)
    That's a base Minix 3.1.3 install without any additional packages. i couldn't get networking working and the installation of additional packages took really, really long so i didn't install any useful apps (i cancelled the install of the Bash package (only 400kb) after 10 minutes of waiting on it).
  • Antix is a nice-looking distro based on Mepis. According to reviews, Antix runs really well on older hardware (128MB RAM, or even 64MB+128MB swap) but has a questionable distribution license which seems to be in direct conflict with the GNU GPL. Here's version 6.5rc5:
    antix-6.5rc5.qemu.bz2 (423119007 bytes, last modified 2007.Jun.29)
    Preinstalled users: root (password=root) and qemu (password=qemu)
You can find a huge number of images at the FreeOS Zoo, including many images of "legacy" systems, like older versions of Suse and Debian.