oz-install (see also: Oz) is a command line program for building operating system instances. It can automatically install a fairly wide variety of OSes, including Windows.
Using it is pretty effortless. You first need to write a small template file, which just describes the name and version of the OS you want to install and where to get the ISO from. Here is one for Fedora 14:
<description>Fedora 14 x86_64 template</description>
By default oz-install will write the destination VM to
/var/lib/libvirt/images, so you either need to check you’ve got enough free disk space under there, or else change the output path in
Using oz-install is simple, just do:
# oz-install fedora.xml
Libvirt XML was written to fedora14_x86_64Aug_30_2011-13:53:07
(oz-install requires root, but there is a feature request to remove this limitation)
oz-install writes a disk image and a libvirt XML file that you can use to immediately boot the guest:
# virsh define fedora14_x86_64Aug_30_2011-13:53:07
Domain fedora14_x86_64 defined from fedora14_x86_64Aug_30_2011-13:53:07
# virsh start fedora14_x86_64
Domain fedora14_x86_64 started
# virt-viewer fedora14_x86_64
I don’t know what root password is given to new Oz guests, but I was easily able to edit it out using guestfish.
Note that serious Oz users will want to further customize the guest using oz-customize, rather than booting it like I did. The workflow is that you use oz-install once to create the operating system template. Then you can duplicate the template, customize it (oz-customize) and deploy it. The copy-and-customize step is much quicker than installing a whole new guest from scratch each time.
Update: Chris tells me that the default root password is
ozrootpw. You can also set it in the template description file by adding a <rootpw> element.