QEMU/QEMU Hello World: Installing QEMU and getting it up and running

Installing QEMU
The most surefire way to get QEMU working is to build QEMU from its source. To do so, enter the following commands in a command line environment:


 * 1)   (The git link here is provided by the QEMU download page)
 * 2)   (As of writing this, the stable branch version is 2.9. Change 2.9 to the number of current stable version when you are applying these steps)
 * 3)   (Credit for steps 3,4 and 5)
 * 4)   (If you want to build QEMU only for a specific target (say, only for 32-bit x86) instead of for all targets, use   instead)
 * 1)   (Credit for steps 3,4 and 5)
 * 2)   (If you want to build QEMU only for a specific target (say, only for 32-bit x86) instead of for all targets, use   instead)
 * 1)   (If you want to build QEMU only for a specific target (say, only for 32-bit x86) instead of for all targets, use   instead)
 * 1)   (If you want to build QEMU only for a specific target (say, only for 32-bit x86) instead of for all targets, use   instead)
 * 1)   (If you want to build QEMU only for a specific target (say, only for 32-bit x86) instead of for all targets, use   instead)

NOTE: All these steps should work seamlessly on all platforms, except for the step 9 on Windows. To get step 9 working on Windows, you need MinGW or a similar solution. That is, to get this working on Windows, you need MinGW (or a similar solution).

You may find further platform specific instructions on compiling QEMU from source here.

Testing the QEMU Installation
If no error has occurred while running the commands above, QEMU is now ready. QEMU is installed in a directory named  which is a sub directory of the directory that contains your local copy of the QEMU source code repository. Your command line environment should currently be inside this  directory.

QEMU provides sample disk images to test the installation here. We will test QEMU for the first two images provided in the link.

Testing QEMU using the Linux image

 * 1) Download the Linux image which is the first image given in the link. For convenience, I am providing a copy of the link here.
 * 2) The image is provided as a bzip2 compressed archive (that is, the file you have downloaded is a bzip2 compressed archive). So, you need to decompress it before obtaining the image file, which is what we want. To learn how to decompress a bzip2 archive, you may search the web for 'decompress bzip2'.
 * 3) After decompressing, go to the 32-bit x86 target of QEMU by writing  .   is a subdirectory of the   directory.
 * 4) Run QEMU using this image. For example, if the image is in , run QEMU by typing

Testing QEMU using the FreeDOS image

 * 1) Download the FreeDOS image which is the second image given in the link. For convenience, I am providing a copy of the link here.
 * 2) Unlike the Linux image above, this image is not compressed. Hence, we can use it as is.
 * 3) Go to the 32-bit x86 target of QEMU by writing  .   is a subdirectory of the   directory.
 * 4) Run QEMU using this image. For example, if the image is in , run QEMU by typing  . Note that this time, we needed to use   option.   option inserts the disk image in the floppy drive A (that is:   drive). We need this option because the FreeDOS image is a floppy disk image, instead of a (hard) disk image. Had it been a hard disk image (like the Linux image in the previous example), we could have simply written  , just like what we did to run the Linux image.