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.

030
  • 5,901
  • 13
  • 68
  • 110
Lucas Kauffman
  • 16,880
  • 9
  • 58
  • 93

3 Answers3

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

Lucas Kauffman
  • 16,880
  • 9
  • 58
  • 93
  • Looks like a dirty hack indeed, I wonder why windows wouldn't just install with the virtio drivers provided during the installation – dyasny Jun 01 '12 at 07: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 02 '12 at 07: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. – Lucas Kauffman Jun 02 '12 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 02 '12 at 11:01
  • Might be a bug in Ubuntu then? – Lucas Kauffman Jun 02 '12 at 11:17
  • looks like it - definitely wouldn't be the first. I keep seeing weird behaviours of packages in ubuntu on quite a few forums I frequent, and in 99% of the cases I can't reproduce the issue on Fedora of RHEL. – dyasny Jun 02 '12 at 11:19
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 
HBruijn
  • 77,029
  • 24
  • 135
  • 201
Dave
  • 11
  • 1
-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

dyasny
  • 18,802
  • 6
  • 49
  • 64
  • 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. – Lucas Kauffman Jun 01 '12 at 10:02
  • then use the previous driver, and upgrade when the guest is up and running – dyasny Jun 01 '12 at 10:03
  • I only found the latest drivers on the fedora website – Lucas Kauffman Jun 01 '12 at 10:06
  • you mean the ISO at http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/ does not work? – dyasny Jun 01 '12 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. – Lucas Kauffman Jun 01 '12 at 10:52
  • are you talking about the greyed out "next" button and error 0x80300001 ? – dyasny Jun 01 '12 at 22:11
  • I can confirm the behavior Lucas is experiencing on Ubuntu 10.04 LTS – Filipe Spencer Jun 02 '12 at 11:15
  • well, if it works on _a_ distribution, then the drivers are just fine, and there's a problem with the distribution you are using. If you don't believe me, I can take a screencast. As I said, the only differences in the actual process are in the disk size. – dyasny Jun 02 '12 at 11:18
  • I'll add ubuntu to the question :) – Lucas Kauffman Jun 02 '12 at 11:18
  • Have you tried a larger disk size btw? Just to eliminate the doubt – dyasny Jun 02 '12 at 11:20