Introducing virt-install
virt-install
is an interactive command-line tool that can be used to set up the guest and then start the installation process.
Execute the virt-install
command as root to begin. There are many options available with virt-install
that can be passed as arguments to configure the installation to meet your virtual machine creation requirements. virt-install
is a scripting-friendly command. It can be easily embedded in scripts to automate virtual machine creation.
Installing a Windows 7 Guest using the virt-install command
Before starting the operating system installation using the virt-install
command, it is necessary to have a virtual disk created. To create a virtual disk, use the qemu-img
command:
- Create a virtual disk of the desired size. Here for example, we will create a 20 GB disk with the
raw
disk format:qemu-img create -f raw -o size=10G /var/lib/libvirt/qemu/win7.img
- Then start
virt-install
by running the following command:virt-install \ --name Win7 \ --ram 1024...