You are welcome to check out the build documentation for next major Whonix version (9) (https://www.whonix.org/wiki/Dev/Build_Documentation/9_full) (which is still in development!). It will be possible to choose between different build targets –virtualbox, –qcow2 (most likely if you’re interested in KVM) and –bare-metal using the whonix_build script.
Check out the script, which is responsible for converting the raw image to a .qcow2 image: https://github.com/Whonix/Whonix/blob/master/build-steps.d/2400_convert-img-to-qcow2
For better performance, we are now using “-o preallocation=metadata” for better performance (as per this blog post: http://www.ilsistemista.net/index.php/virtualization/11-kvm-io-slowness-on-rhel-6.html) and “-o cluster_size=2M” as per qemu-img’s man page. The latter increased the sparse size from 2,5 GB to 2,9 GB (as per test: https://www.whonix.org/wiki/Dev/KVM#Set_cluster_size_512_-_2MB_for_better_performance.3F) but this is a compromise we can make for better performance. This space would most likely be used anyway when the image gets booted.
The build process for building, signing, compressing and uploading .qcow2 images has been streamlined to make maintenance of additional .qcow2 images less time consuming and therefore more maintainable. This is done in the https://github.com/Whonix/whonix-developer-meta-files/blob/master/release/compress_qcow2 script which gets run by release automation script https://github.com/Whonix/whonix-developer-meta-files/blob/master/release/new_release as a standard step.
The bad news is, using Whonix with KVM will likely be more difficult than using Whonix with VirtualBox, because neither KVM nor virt-manager have a feature for importing prepackaged appliances. VirtualBox’s .ova appliance import feature makes redistributing virtual machines so much simpler, because it keeps care of storing all VM settings and image compression during transfer.
Compression of .qcow2 images unfortunately is necessary, otherwise transfer using rsync (uploading) or download using a browser would take very long. (Also as per https://unix.stackexchange.com/questions/120091/how-can-i-speed-up-operations-on-sparse-files-with-tar-gzip-rsync.) This means an extra step for users, they need to uncompressed the tar.gz we’re providing.
If you are interested to see Whonix in KVM, please consider joining our development efforts!