Installing virtual machines with virt-builder ============================================= Main reference: http://libguestfs.org/virt-builder.1.html. The man page of `virt-builder` has ton of details. Fedora ------ Raw ~~~ Prepare a Fedora 28 guest with Raw format: $ virt-builder fedora-28 To import the above image into libvirt: $ virt-install --name f28vm --ram 2048 \ --disk path=./fedora-28.img,format=raw \ --nographics --import --os-variant fedora27 QCOW2 ~~~~~ Create a Fedora 21 guest: $ virt-builder fedora-28 -o f28vm --format qcow2 --size 10G [OR] Prepare Fedora 21 and update to latest available packages: $ virt-builder fedora-28 -o f28vm --format qcow2 \ --update --selinux-relabel --size 30G [OR] To create a Fedora Rawhide VM, by specifying a root password: $ virt-builder fedora-28 -o rawhide.qcow2 \ --format qcow2 \ --root-password password:123456 \ --update --selinux-relabel --size 40G\ --install "fedora-repos-rawhide yum-utils" Import the any of the above QCOW2 guest to get access to a serial console: $ virt-install --name f28vm --ram 2048 \ --disk path=/home/kashyap/fedora-28.qcow2,format=qcow2 \ --nographics --import --os-variant fedora27 [Use libvirt's `virsh` to manipulate your virtual machines.] Debian ------ By default, Fedora has serial console enabled, to create a Debian guest and have it a enable virtual console (for debugging later): $ virt-builder debian-7 \ --edit '/etc/inittab: s,^#([1-9].*respawn.*/sbin/getty.*),$1,' To view the relevant notes for a Debian install: $ virt-builder --notes debian-8