This script shows how to make a fresh virtual machine, installing an operating system like Fedora or some Red Hat-derived operating system such as Red Hat Enterprise Linux or CentOS.

It's fairly easy to modify this script to install Debian derivatives too (even from a Fedora host), using debootstrap.

After running the script, you can boot the new virtual machine by doing:

qemu-kvm -m 512 -hda /tmp/vm.img