Updated on 2022-11-03 GMT+08:00

Creating a VM and Installing an OS (Windows)

This section uses Windows Server 2012 R2 as an example to describe how to create a Windows VM. The procedure is also applicable to other Windows OSs. The screenshots in the following steps are for reference only.

  1. Log in to the host, upload the ISO file generated in Generating a New ISO File to it, and start virt-manager.
    [root@localhost Desktop]# virt-manager
    [root@localhost Desktop]# 
  2. Click Create a new virtual machine. In the New VM dialog box, select Local install media (ISO image or CDROM) and click Forward.
  3. Select the ISO image stored on the host, and select its OS type and version. In this example, the OS type and version are automatically detected by the system.

  4. Configure the VM memory and CPU.
    • Memory (RAM): 4096 MiB
    • CPUs: 4
  5. Configure the VM storage by specifying the disk image size. (The image cannot be too large.)

  6. Click Manage and select a storage path, for example, /var/lib/libvirt/images.

    Click to create a storage volume. Set Name (suffix .img is recommended so that the image can be compressed if it is large) and select raw (recommended) for Format.

    Click Finish. In the displayed storage volume list, select the created storage volume and click Choose Volume.

  7. Enter a name for the VM and select Customize configuration before install.

  8. In the navigation pane on the left, choose NIC. In the right pane, select e1000 for Device model, and click Apply.

  9. Click Begin Installation. virt-manager creates the VM as you configured.
  10. Install Windows on the VM.

    Configure the language, time zone, currency, and other settings by referring to Installing a Windows OS and the VMTools Driver. Activate the OS using the Windows Server 2012 R2 product key.