2

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.

3 Answers 3

7

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

6
  • Looks like a dirty hack indeed, I wonder why windows wouldn't just install with the virtio drivers provided during the installation
    – dyasny
    Jun 1, 2012 at 7:28
  • Just checked your complaint about the latest virtio-win drivers not working. It is wrong - windows 2008r2 sp1 installs just fine with those drivers provided from that ISO
    – dyasny
    Jun 2, 2012 at 7:14
  • I got the latest Windows 2008 R2 ISO from Dreamspark, if you want I'll make a screencast. For me it didn't work. Jun 2, 2012 at 10:17
  • strange, really. The only differences are that I used a 40Gb sparse disk and Fedora 17, and it works. The steps I've taken are exactly the same
    – dyasny
    Jun 2, 2012 at 11:01
  • Might be a bug in Ubuntu then? Jun 2, 2012 at 11:17
1

For anyone who gets here, you don't need to perform the hack suggested, just specify the virtio drivers as a cdrom.

In qemu-system-x86, use these options.

sudo qemu-syste-x86 -m 1024 -drive file=/path/to/file/windows_2012_r2.ISO,index=2,media=cdrom \
  -drive file=win2012.raw,if=virtio,index=0, -boot d -net nic,model=virtio \
  -net user,hostfwd=tcp::3389-:3389 -nographic -vnc :0 \
  -drive file=/path/to/file/virtio-win-0.1-81.iso,index=3,media=cdrom 
-1

Openstack provides documentation on what you're trying to achieve here: http://docs.openstack.org/diablo/openstack-compute/starter/content/Creating_a_Windows_Image-d1e1594.html

The trick is to provide the virtio-win-x.x.x.vfd floppy image during setup, for windows to get the drivers from

10
  • Actually with the latest driver that's not an option anymore, the image is way bigger than a regular floppy and windows cant see it. And even when you manage to get the drivers working, windows will not allow you to install to that virtio disk. Windows will see the image as unbootable. Jun 1, 2012 at 10:02
  • then use the previous driver, and upgrade when the guest is up and running
    – dyasny
    Jun 1, 2012 at 10:03
  • I only found the latest drivers on the fedora website Jun 1, 2012 at 10:06
  • you mean the ISO at alt.fedoraproject.org/pub/alt/virtio-win/latest/images does not work?
    – dyasny
    Jun 1, 2012 at 10:15
  • yes that's the latest iso and no it doesn't, kvm will not allow you to install windows on a virtio disk EVEN with those drivers. It will state the disk is not bootable and therefor windows is unable to install to it. Jun 1, 2012 at 10:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .