Ubuntu 6.06 on Qemu (Windows Host)
Ubuntu 6.06 running on Qemu (Windows Host)

I like the idea of "Virtual Appliances" that can be ran with VMWare Player. Therefore I had some playing with VMWare Server to try building a "runtime environment" for J2EE applications. Maybe because it's still in beta, I failed setting up a working system getting several strange errors (read "bugs").
I enjoyed Qemu in my last (failed) experience of Linux conversion, so I started playing with it. If you don't know it, check out the official Qemu site: "QEMU emulates a full system (for example a PC), including a processor and various peripherials". Here you find also links to binaries for windows, but it's just an old version. On Qemu on Windows page there's a good source of information and links to updated resources. And don't forget to bookmark The QEMU forum, to get helpful hints from users.

Virtual Machines can be helpful in many ways. As developer I can immagine some scenarios:

  1. A "demo/evaluation environment" for web applications. Qemu provides a "snapshot mode" in which all disk images are considered as read only. When sectors are written, they are written in a temporary file created in `/tmp'. This sounds very good for a demo environment.
  2. A secure environment to browse internet or other stuff on untrusted machines (internet points, shared workstations, etc).
  3. A collaborative development environment (like code repository, bug tracking, wikis, etc.) that can be cloned when it's needed.
  4. A deployment environment, including only components required by an application, already installed and configured properly.

A nice feature with Qemu is that you can create disk images based on other disk images. In this case the base disk is never updated, and changed sectors are written in a file aside. For example you can have a base system containing a clean OS installation, and several "extensions" that adds more stuff (i.e. database, application server, etc.)

Latest windows port can be downloaded here: qemu-0.8.1-windows-3.zip. You may want to try some extravagant OS from Free Operating System Zoo.
Qemu is command line based, but there are also some frontends, that can help setting up the VMs. I choosed Qemu Manager.
I recommend you to install also Kqemu, that is the "Qemu accelerator": it enables the emulator to run guest code natively in the host system boosting performances noticeably. Kqemu binaries and sources can be found within downloads on Qemu site; current version is kqemu-1.3.0pre9.tar.gz. In kqemu-1.3.0pre9.tar.gz you find qemu.sys and kqemu.inf. Simply install the service via the kqemu.inf rightclicking on it and choosing "install", then use "net start kqemu" from command line or start it on the windows services panel, before starting Qemu emulation.
By default kqemu executes only application code natively, but more performance improvement can be achieved adding "-kernel-kqemu" option to the Qemu command line. Just don't use this when installing WinXp/2000 as it is known to be buggy. More info can be found on QEMU Accelerator User Documentation.

Remember that, when using a graphical environment, you should reserve a good amount of memory or you'll experiment some turtle-computing.

If you use a Linux 2.6 Kernel as guest OS, you may experience erratic clock behaviors, like continuously jumping up and down by several minutes. You could get puzzled by Tomcat log messages such as "Server startup in -16492 ms". To address this problem, you can add "clock=pit" as kernel parameter in /boot/grub/menu.lst [read more].

Thinking to use QEMU like an application server, it could be helpful to hide it. Adding those option to Qemu command line does the job: "-nographic -monitor null -serial null". The problem that could arise is that the shutdown command does not poweroff by default on many distributions, and qemu process remains running until you kill it in some way. To solve the problem, on my Ubuntu 6.06 server installation, I installed acpi and apm stuff and added the line "apm power_off=1" to /etc/modules.

The qcow format (qemu image format), supports encryption and compression. Disk images tend to grow in time. If you want to compress a qcow disk image for redistribution, you can use a command like "qemu-img convert -c linux.img -O qcow linux-compressed.img".

As you may have noticed, QEMU doesn't need installation, can be extracted from a zip and ran. It should not be difficult to package it with your VM, ready to run, keeping in mind that Qemu is LGPL, and that the Kqemu redistribution is not allowed [read terms of use]. There is also QVM86 accelerator, that is GPL2; I've not tried it yet, but I see that it's still experimental.
I just noticed that there's a packaged version of Qemu with Damn Small Linux, but surely DSL has a compatible license.


6 Responses to “Free Virtualization for Windows with Qemu”  

  1. 1 Matt Raible

    FWIW, I was able to easily setup Ubuntu 5.10 on VMWare Server (XP Host) and then upgrade it to Ubuntu 6.06. I was amazed at how easy it was.

  2. 2 luigi

    Thanks Matt, happy to see you here!
    I’ll try VMWare Server again when the final release will be ready. Qemu is probably more complex, but it’s really tiny and doesn’t need installation. It worths the try.

  3. 3 fra1027

    Ciao! Ti dispiace se scrivo in italiano?
    Ho letto il tuo post sulla virtualizzazione con molta attenzione per vedere se riuscivo a far partire la mia iso di Ubuntu 6.06 (premetto che da cd funziona) ma non parte poichè dà un erore su “User …” e qualcosa.
    Quali opzioni hai usato per far partire Ubuntu?

    Francesco

  4. 4 luigi

    “User …” e qualcosa

    …è un po’ generico…

    Io ho trovato in The QEMU forum la soluzione ad ogni problema.

  5. 5 fra1027

    Si hai ragione per il generico.. al momento non ce l’avevo davanti. :P
    Cmq volevo solo sapere la stringa che hai usato per far partire qemu.
    Grazie per il forum.. guarderò.

    Ciao, Francesco

  6. 6 fra1027

    Ciao,
    Ho guardato sul forum.. ora sembra andare bene.
    Ho trovato anche in tuo post. ;)
    Io usavo qvm86 ma con questo non funziona. Si deve usare il kqemu.

    Francesco

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



Calendar

July 2006
M T W T F S S
« Jun   Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:

Archives


Categories

Tag Cloud


Listening