Since I’d managed to get QEMU to compile successfully I decided to see if I could install the latest version of Debian on a virtual machine. Unfortunately I couldn’t get jessie to install directly, so I decided to start with a minimal installation of wheezy and then upgrade it later. After downloading the netinst CDROM image, you just need to create a new virtual hard disk, then boot the virtual machine from the virtual CD image.
I decided that 8GB was enough disk space for a test system so I used the following command to create a new virtual disk.
$ qemu-img create -f raw debian-wheezy-i386.img 8G
Then you need to start QEMU and boot from the netinst CDROM image. The first line of the command below tells QEMU where the virtual disk image is and to allocate 512MB RAM to the virtual machine, the second line sets up the network interface (using tap/tun), and the last line tells QEMU where the CD image is and selects it as the boot device.
$ qemu-system-i386 -hda debian-wheezy-i386.img -m 512 \ > -net nic,model=e1000 -net tap,ifname=tap0,script=no,downscript=no \ > -cdrom debian-7.5.0-i386-netinst.iso -boot d
You should then be able to install Debian as normal. When the installation is complete the system will reboot automatically from the installation CD image again. Close the virtual machine window, which will stop QEMU, and start it again using the following command.
$ qemu-system-i386 -hda debian-wheezy-i386.img -m 512 \ > -net nic,model=e1000 -net tap,ifname=tap0,script=no,downscript=no \ > -cdrom debian-7.5.0-i386-netinst.iso
Note that we don’t specify a boot device this time.
If it all worked then the system should start to boot normally and you should see grub boot menu…