Now let’s create hard disk image file with RAW format as it allows better performance.

kvm-img create -f raw ws-2012.img 40G

And start the VM

sudo kvm \
  -m 2048 \
  -drive file=ws-2012.img,if=virtio \
  -cdrom ws-2012.iso \
  -drive file=virtio-win.iso,index=3,media=cdrom \
  -boot d \
  -net user \
  -net nic,model=virtio \
  -redir tcp:3389::3389 \
  -nographic \
  -usbdevice tablet \
  -vnc :10

The terminal window where you issues this command will be locked while kvm is running, so you may need to have second terminal opened.

Open VNC viewer and connect to the <your server address>:10. 10 is the number of our VNC screen (it corresponds to the port 5910), as we used it earlier when started virtual instance. After a small delay a Windows Setup window should appear.

Choose your language, time zone and keyboard layout, then click Next, and on the next screen click Install Now.

Select required installation type (Windows Server 2012 Standard Edition (Server with a GUI)).

Accept the EULA, and then select type of installation Custom: Install Windows only (advanced).

Now we should select the drive to install Windows on. By default Windows won’t see any drives as there are no appropriate drivers.

Click Load driver, then Browse, and expand the CDROM drive (drive E:), following the path WIN8/AMD64. Click OK.

Setup will scan this folder and should find two drivers (for Ethernet and SCSI devices):

Red Hat VirtIO Ethernet Adapter (E:\WIN8\AMD64\NETKVM.INF)
Red Hat VirtIO SCSI controller (E:\WIN8\AMD64\VIOSTOR.INF)

Select both and click Next.

The Drive 0 Unallocated Space record now should appear. Ensure that it is selected and click Next.

When installation complete, provide new password for Administrator (I use P@ssw0rd by default, as it fit password requirements.)