Taking QEMU for a Spin
Have you tried QEMU? I must admit that I hadn't really tried it until recently... although I have used VMware and Parallels. Supposedly Xen and the new KVM both draw from QEMU code. What is QEMU? Obligatory quote from the QEMU wikipedia entry:
QEMU is free software written by Fabrice Bellard that implements a fast processor emulator, allowing a user to simulate a complete computer system within another one. It is similar to projects such as Bochs, VMware Workstation and PearPC, but has several features these lack, including increased speed on x86, and support for multiple architectures in-progress. By using dynamic translation it achieves a reasonable speed while being easy to port on new host CPUs.
I'm not sure why that says that QEMU is faster than VMware, because it isn't... but QEMU can emulate several different CPU families other than just x86. Read on if you want to hear about my experience installing Windows XP SP2 from an .iso file.
I run Fedora Core 5 on my work machine and as luck would have it, QEMU is available in the Fedora Core 5 Extras repository. A quick
yum install qemu and it was installed.
What OS to install
I decided to install Microsoft Windows XP Service Pack 2. Why? Because I'm already running Linux and I find it boring to install Linux within Linux unless I'm trying out a new/different distro. I also already had an .iso file of the XP install media. Don't freak out, it's ok... we are a member of the MSDNAA/ELMS system and can generate license codes at will... so I'm NOT pirating Windows here.
Creating a virtual disk image
Before I can install an OS, I need a place to install it. QEMU uses image files and creating a filesystem is as easy as:
qemu-img create -f qcow winxp.img 5G
As you can probably figure out, that will create an image with a max capacity of 5GB.
qcow is a compressed image format native to QEMU. The command above finished almost immediately and produced file named
winxp.img 21K in size. You see,
qcow does NOT have to reserve all of the space up front... no writing 5GB worth of zeros to the image file... it will GROW as space is needed.
Cool. That was pretty easy.
qemu -cdrom winxp_pro_with_sp2.iso -hda winxp.img -m 256 -boot d
That is actually readable, eh? The
-m 256 flag specifies the amount of RAM the virtual machine is to have. After issuing that command a window popped up and the BIOS screen zipped by. I would have liked to have gotten a screen capture of the BIOS screen but it went by so fast, I didn't have time. Hey, it even booted from the CD image as desired. Windows saw a 5GB hard drive... and I formatted it as NTFS for the install and that was pretty quick. The text portion of the install progressed as expected... and then the machine rebooted into the GUI phase of the install.
The Windows GUI phase continued as one would expect. I mean, how many times have I gone through this? I manage a lab full of computers at work and they are dual-boot... so I've done my share of Windows installs. Luckily for larger deployments these days I use products like Ghost and sys-prep to keep me from going crazy... but I've still done a lot of Windows installs. I mean, how do you fix a nasty problem in Windows anyway? Why everyone knows you reinstall. :)
Booting Windows for the First Time
The install took a while but once it was done, Windows restarted, and it went through configuring itself. It asked me to configure networking, which I did... and I was able to join our Windows Active Directory Domain just fine.
Now I ask you... What is the first thing you do after installing Windows? You guessed it... Windows Updates! There quite a few updates... and it took a while.
Oddly enough, by default QEMU uses private IP addresses. This virtual Windows machine had a 10.0.x.x address and had also set private addresses for the gateway and DNS. I'm not sure how it works mainly because I haven't taken the time to read the fine QEMU documentation... but strangely enough, it worked just fine on the LAN at work. I mean, how else could I have joined the AD Domain and done Windows updates?
Speed and performance
QEMU works well. It is fairly fast... which is pretty impressive given the fact that it can emulate several different processor families... and that it will run on several platforms. How fast is it? Well, it isn't as fast as VMware but it seems serviceable. While I haven't run any benchmarks... I'd have to guess that QEMU is about one half to three quarters as fast as VMware... which is actually quite good... since VMware is pretty darn fast. You have to also take into consideration that QEMU is running as a regular user process, doesn't use a kernel module... and since it isn't using a kernel module, it doesn't have to be rebuilt every time one changes kernels.
Seeing as how easy QEMU was, given all of the ingredients, to install, to create a disk image, and to install an OS, you don't have to rely on my experience alone. Install it for yourself... and let us know how it went.
For advanced users who are willing to read the documentation, there are ways to improve QEMU's preformance... but I wasn't interested in compiling a custom kernel module as it is quite usable as is.
I did have a few points during the install where Windows was supposed to reboot... and it just sat there so I hit the close [X] in the top right of the QEMU window and then started it up again. From that I conclude that, at least on my hardware, there may be times when it can't sense a software restart. Other times Windows wanted to reboot, like after updates, it worked just fine. That really is just a minor bug but something you should be aware of. I only ran into it during the install... so maybe I've seen the last of it?!?
Of course after the updates were done... the next thing to do is to install all of the wonderful free programs we are used to using... like Firefox, GIMP, OpenOffice.org, Inkscape, etc.