Chapter 9. Installing a Fully-virtualized Windows Guest
Chapter 9. Installing a Fully-virtualized Windows Guest This chapter describes how to create a fully-virtualized Windows guest using the command-line ( virt-install ), launch the operating system's installer inside the guest, and access the installer through virt-viewer . To install a Windows operating system on the guest, use the virt-viewer tool. This tool allows you to display the graphical console of a virtual machine (using the SPICE or VNC protocol). In doing so, virt-viewer allows you to install a fully-virtualized guest's operating system with that operating system's installer . Installing a Windows operating system involves two major steps: Creating the guest virtual machine, using either virt-install or virt-manager . Installing the Windows operating system on the guest virtual machine, using virt-viewer . Refer to Chapter 6, Guest Virtual Machine Installation Overview for details about creating a guest virtual machine with virt-install or virt-manager . Note that this chapter does not describe how to install a Windows operating system on a fully-virtualized guest. Rather, it only covers how to create the guest and launch the installer within the guest. For information on how to install a Windows operating system, refer to the relevant Microsoft installation documentation. 9.1. Using virt-install to Create a Guest The virt-install command allows you to create a fully-virtualized guest from a terminal, without the need for a GUI. Important Before creating the guest, consider first if the guest needs to use KVM Windows paravirtualized drivers. If it does, keep in mind that you can do so during or after installing the Windows operating system on the guest. For more information about paravirtualized drivers, refer to Chapter 10, KVM Paravirtualized (virtio) Drivers . For instructions on how to install KVM paravirtualized drivers, refer to Section 10.1, "Installing the KVM Windows virtio Drivers" . It is possible to create a fully-virtualized guest with only a single command. To do so, run the following program (replace the values accordingly): The path-to-disk must be a device (e.g. /dev/sda3 ) or image file ( /var/lib/libvirt/images/ name .img ). It must also have enough free space to support the disk-size . Important All image files are stored in /var/lib/libvirt/images/ by default. Other directory locations for file-based images are possible, but may require SELinux configuration. If you run SELinux in enforcing mode, refer to the Red Hat Enterprise Linux 6 Virtualization Administration Guide for more information on SELinux. You can also run virt-install interactively. To do so, use the --prompt command, as in: Once the fully-virtualized guest is created, virt-viewer will launch the guest and run the operating system's installer. Refer to the relevant Microsoft installation documentation for instructions on how to install the operating system.
virt-install --name= guest-name --os-type= windows --network network=default --disk path= path-to-disk ,size= disk-size --cdrom= path-to-install-disk --graphics spice --ram=1024 virt-install --prompt