- Slackware64 14.0 as host OS
- Windows XP ISO / CD
Obtain the Materials
Make sure you have install QEMU. If you have not installed it yet, you can read article here.
Another thing we need is Windows XP ISO or CD for installation. Make sure you have product key for activation. This article won’t give you link to obtain any of them so you should find them by yourself. Either ISO or CD is OK, just pick one.
Preparing the Environment
First we need to set the environment before do installation.
Make Working Directory
All progress we did will be stored on a single directory. You can create any directory but for this article I assume you create it on ~/QEMU/WinXP directory. Also, save ISO file, if you do installation by ISO file, to this directory.
We need to create a raw hard disk. At minimum, 4GB disk is sufficient. In this article I use 6GB disk. You don;t need to partitioning your disk. All work will be done on an image disk. The image can be created by qemu:
qemu-img create -f raw WinXP.img 6G
On above command, we create a disk with 6GB capacity. The -f switch tell qemu to create a raw disk. The disk then stored as an image file with filename WinXP.img
First we need to boot the ISO. On our working directory, invoke following command:
qemu-system-i386 -m 512 -hda WinXP.img -cdrom winxp_n_sp2.ISO -boot d
The platform we use is i386 or generic Intel x86 CPU therefore we use qemu-system-i386 to boot. Here are the explanation of all arguments we put:
- -m 512: allocate 512 MB of RAM for virtual machine
- -hda WinXP.img: Search for WinXP.img on current directory and use it as hard disk.
- -cdrom winxp_n_sp2.ISO: Use ISO file with filename winxp_n_sp2.ISO on current directory. The name may be vary and you should adjust it with your ISO’s name. If you use installation CD, insert your CD and replace winxp_n_sp2.ISO with /dev/cdrom or whatever your CD device file node is.
- -boot d: instructs QEMU to let the virtual machine boot from the (virtual) CD-ROM drive we’ve specified using -cdrom
A window might appear and then you can see the installation CD is now booting. You can continue with usual installation procedure, it’s not different compared to when you install to actual machine. And it still ask you about product key so you better enter the correct code.
Once the installation finish, you will got you Windows XP running on QEMU. Now, whenever you want to boot Windows XP, you can at minimum invoke following command:
qemu-system-i386 -m 512 -hda WinXP.img
Now, happy hacking 😀
Here are some screenshots