Openstack: Making a windows 2008 R2 image with virtio support

driverskvm-virtualizationopenstackwindows-server-2008

When installing windows 2008 R2 in kvm on a virtio disk, it seems there is no support for drivers. Even after installing the drivers I wasn't able to install windows to the image. This because windows doesn't see the image as bootable. So how to make a windows server 2008 R2 that supports virtio and can be added to Glance?

Edit 1: added images
So here are some images of my problem. It is not the 0x80300001 error, as proof I added an image that shows that the windows iso is loaded in the CD-ROM.
Overview

No disk present, so time to install the driver

Select driver

Install driver

enter image description here

enter image description here

Edit 2: The behavior seems only to be experienced on Ubuntu. Dyasny confirmed it to work on Fedora.

Best Answer

The solution I used to circumvent this problem is:

First of all we will need to create an image to install the virtual machine into. Microsoft says 10 GB is the minimum, but I used 15 GB. Remember that this is not the final size of your virtual machine,once it is introduced into Nova Compute. Create a raw image called windows.virtio:

kvm-img create -f raw windows.virtio 15G

Now open virt-manager and create a new virtual machine:

  • Name your machine
  • Use ISO image and select your Windows 2008 R2 image
  • Select windows and windows 2008 in the dropdown menus
  • 2048 MB of memory
  • 2 cpu's
  • Configure network so you have internet

Now boot the machine and just install the image, the disk is set to IDE at the moment, but that's not really a problem.

  • After installing let it restart, after the restart shut it down again
  • Create a temporary image
  • kvm-img create -f raw dirtyhack.virtio 1G
  • Add hardware with virt-manager:
    • Disk drivers
      • Storage
      • File disk image (select dirtyhack.virtio)
      • set Device Type to Virtio
      • Mount the ISO with the driver you got from fedora projects in the CDrom station
    • Network card
      • Add a new network card to some interface (doesn't really matter what it connects to)
      • When selecting the card, change the hypervisor default to virtio
    • Boot the server again
    • In windows open the device manager
      • Press start
      • Type device manager
      • In device manager select the iSCSI driver
      • Install driver and browse to the CDrom and go into wlh>amd64
      • Click ok and the driver will be installed
      • Do the same for the network card, I had to use the drivers in the Windows 7 folder since windows couldn't detect the ones from the Wnet folder
    • Shut down the machine
    • Remove all hard drives from the machine in virt-manager
    • Add hardware, storage and add your original windows.virtio, but make sure you set the Device Type to virtio
  • Boot the machine

Congratulations, your machine has now the Virtio drivers.

I also posted this on my blog