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:
- 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.
- A secure environment to browse internet or other stuff on untrusted machines (internet points, shared workstations, etc).
- A collaborative development environment (like code repository, bug tracking, wikis, etc.) that can be cloned when it's needed.
- 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".
I just noticed that there's a packaged version of Qemu with Damn Small Linux, but surely DSL has a compatible license.
|« Jun||Aug »|
- Android (3)
- Apple (30)
- Books (7)
- Eclipse (14)
- Errors (5)
- Firefox (7)
- Git (3)
- Hardware (18)
- Horror Code (8)
- Internet (21)
- Java (106)
- Life, universe and everything (45)
- Lifehacks (26)
- Linux (53)
- Opinions (26)
- OSX (11)
- OWNER API (3)
- Python (1)
- Software (35)
- Speeches and Conferences (8)
- Unix (5)
- Web (23)
- Windows (19)
Android apple architecture Bash bsd configuration CSS Development Düsseldorf framework free Git Google Hardware hdr How-To howto Java Karmic library Linux lion MacBook maven opensource Open Source Opinion os x OSX owner owner api patterns Pitfalls Practices properties Software TDD Testing tip tonemapped Tricks Ubuntu unix video Web