The first day I met Ven. Ilgo (my Linux guru), the venerable thero showed me a magic trick (it was that surprising for me at the time) with his Linux-installed laptop by booting âWindows XPâ within a window of his Debian Linux installation. Although we could see it in a window, âWindows XPâ seemed to act as if it were the only OS running at that moment. He had even installed Firefox and a Python interpreter.
âFirst, I used this to make my machine useful to another monk who refused to work with Linux because he was a great fan of MS Word macros. But now I use QEMU to check how well my Python scripts work in Windows,â said Ven. Ilgo.
After a few minutes in âWindows,â we were shutting down WinXP. Guess what? Windows crashed!
âThis is a joke! I canât believe how people use this in their day-to-day life,â said Ven. Ilgo.
âMaybe itâs because of the emulation?â I replied.
âOh no. Itâs true that QEMU might be slower than a normal Windows installation, but not when KQEMU is installed with 1GB of RAM. At least itâs fast enough not to crash,â said the venerable thero. (KQEMU is a driver that allows the QEMU PC emulator to run much faster when emulating a PC.)
âWhat if we just close this window without shutting down Windows?â I asked.
âThen Windows will assume itâs a power loss and run âthe famous disk scan!ââ
That was enough for me that day, but it wasnât enough for me later. So, I started using QEMU after getting a good tutorial from Ven. Ilgo. I always wanted to write a post about this but couldnât do it earlier because of my lack of free time. Here it is now!
(Important: This is not a QEMU man page. This is just a simple intro to QEMU.)
(Disclaimer: IâM NOT GUILTY IF YOU GET BUSTED OR KICKED OUT OF âLKLUGâ FOR USING âWindowsâ WITH THIS EMULATOR.) 
First, we need to install QEMU:
apt-get install qemu
Once QEMU is installed, try typing qemu to check whether itâs up and running.
I assume you guys (or gals) are going to emulate Windows. Normally, Windows will need 2GB of disk space, so letâs create an image file that will act as an HDD during the emulation:
qemu-img create win.img 2048mb
Yes! You can change the name or file size as you like.
Next, create an ISO image of a CD containing Windows XP. You can do this by selecting the âCopy to Disk Imageâ option, which appears after right-clicking the CD icon. Name the file âwinXP.iso.â
Now, to boot your emulated PC from the CD, type:
qemu -hda win.img -cdrom /path/to/winXP.iso -boot d
Make sure to replace /path/to/winXP.iso with the correct path to your ISO file.
A window resembling a normal BIOS will open. From there, proceed as you normally would during a Windows setup.
After installing, youâll need to boot from the HDD. Type:
qemu -hda win.img -cdrom /path/to/ANY.iso -boot c
If you want to install software or drivers in Windows, simply create an ISO image containing the software and replace /path/to/ANY.iso with the correct path and name of the ISO image.
For further information, check the QEMU manual (man qemu). You can also use a SAMBA server to transfer files between Linux and Windows, though Iâm not sure if it supports Windows XP.
Oh! For those of you wondering… Yes! you can use QEMU to emulate another Linux distro too. After all, why emulate just to be a fool?
C.J.
Digg this post!