How to Qemu

The simple option to go for when one wants to run an OS inside another existing one is go for VirtualBox. It is available under both Windows and Linux and has a nice GUI. Since I found difficulty in getting it up and running in my Debian lenny and thought of trying out Qemu. This from their official site says what it does:

QEMU is a generic and open source machine emulator and virtualizer.

When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performance.

When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests.

I have to run Debian Squeeze above by Debian Lenny


1. Install Qemu. It is available in repositories

2. Make a virtual hard disk

# qemu-img create /media/store/debian 4G

This command creates an image named debian of 4G size in the location /media/store

3. Mount and Boot the new Debian Squeeze iso.

# qemu -hda /media/store/debian -cdrom /media/Store/Debian_6.0.0_i386_1.iso -m 192 -boot d

The -boot option tells to boot the iso and use /media/store/debian as hard disk.

4. Now you can install the new Debian with new virtual hard disk. After installation when rebooting Qemu will give error. Close the application and invoke Qemu again with virtual hard disk only to use the new installed Debian.

# qemu /media/store/debian