Process for building new Windows images that will work optimally with the VTA:

Requirements
Use the following values for the image sizes
  • Windows 10/2016 - 16GB

  • Windows 7/8/2012 R2 - 24GB

Steps

  1. Install Windows using kvm

kvm -m {{ memory in MB}} \
    -smp {{ number of cores to allocate}} \
    -drive file=path/to/raw/disk,if=virtio,format=raw \
    -drive file=path/to/virtio/iso,media=cdrom,index=2 \
    -drive file=/path/to/installation/iso,media=cdrom,index=1 \
    -net nic,model=virtio \
    -net user \
    -show-cursor \
    -boot d
  1. Install the VirtIO viostor and netkvm drivers during Windows installation

  2. Set a random user password

  3. Install the vmmouse driver. You can do this by going to device manager (if you have a gui) and installing it over the default Microsoft mouse driver. If you don’t have a gui, you can use pnputil.

  4. Perform all Windows updates (this will take some time)

When rebooting the system, use a form of the command below to start the system.

kvm -m {{ memory in MB}} \
    -smp {{ number of cores to allocate}} \
    -drive file=path/to/raw/disk,if=virtio,format=raw \
    -net nic,model=virtio \
    -net user \
    -show-cursor \
    -boot c
  1. Clean up all remnants of Windows updates by deleting old packages (use either Windows disk cleaner or Dism.exe /online /Cleanup-Image /StartComponentCleanu AND Dism.exe /online /Cleanup-Image /StartComponentCleanup /resetbase)

  2. Shrink partition down to minimum size + 512M using aomei disk partition standard (https://www.disk-partition.com/download-home.html)

  3. Uninstall aomei after resize and remove all remnants of utility.

  4. Take note of the final partition size in Windows

  5. Install cloudbase-init, selecting com1 as the serial port during installation and leaving all other options as default. At end, select the box that says run sysprep and then check the box below that says shutdown when complete.

  6. When the image is shut down, make a copy of it. use qemu-img resize to shrink the raw disk image to the size of the Windows partition, rounded up to the nearest G. For Windows 10 and 2016, this should be about 9GB. For Windows 7/8/2012, this will be around 16GB.