1

On my KMS host I installed a windows server 2012 guest a few months ago. The VM runs raw using IDE (HDD). I would like to improve the performance by using virtio.

I performed these actions:

  • shutdown the VM
  • edit the XML config file
  • replace the disk tag by:

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source file='/var/lib/libvirt/images/myvm.img'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    
  • save the XML config file

  • restart the VM with virt-manager
  • I have a BSOD and the vm auto reboot
  • Auto repair started, asking my keyboard language
  • two options: repair or stop the PC
  • I tried both but always BSOD after boot.

What is missing in my procedure?

  • Installing the virtio drivers prior to the interface swap. – llua Jun 7 '14 at 12:20
  • I tried to install, in windows server 2012, spice-guest-tools-0.74.exe. I suppose that the virtio driver is inside. During the installation, I have the message "unsupported window version" ! – Bertaud Jun 7 '14 at 14:16
  • the spice guest tools do not provide the virtio drivers for windows. slm seemed to have updated his answer with a link to them. you need to make sure windows has the drivers installed before switching the interface to virtio for this to work. Just how do you do that in windows? i don't know and is loosely on topic on this site. – llua Jun 11 '14 at 0:47
  • because the host is debian and I am using virt-manager. which site(s) would be more adapted for you ? – Bertaud Jun 12 '14 at 14:54
4

I had exactly the same problem. I installed Windows 7 on IDE disk, later tried to switch to VirtIO - got BSOD on boot, tried to install the drivers in recovery mode - does not work.

I solved it with a little trick. Leave your boot disk as IDE and add a dummy VirtIO disk. Add a CD-ROM with VirtIO drivers for Windows (the link is Win-64 CD ISO) and boot. Windows will start normally, detect a new hardware and install the drivers from CD automatically. Then you can shutdown and switch you boot disk to VirtIO mode and remove the dummy one.

| improve this answer | |
  • This answer works. It is not enough to install via the CD. Have to add a dummy disk in order for Windows to use the driver. Then you can shutdown and change the boot disk to VirtIO as this answer says. – Amala Mar 14 '17 at 17:06
1

The only other thing beyond changing the target line in the XML file like so:

<target dev='hda' bus='ide'/>

to

<target dev='vda' bus='virtio'/>

Is to remove all <address type .../> lines so that libvirt can regenerate them. If the VMs were Linux guests you'd need to change the drive's label inside of the guest's /etc/fstab file, replacing all /dev/sdX with /dev/vdX, so you might need to do something comparable for a Windows VM guest.

Drivers

You'll likely need to follow the directions on the KVM project's website to install the necessary VirtIO drivers for Windows, Windows VirtIO Drivers. Details are also covered in this KVM article: How to setup Windows guest VirtIO block driver on Windows Server 2003.

References

| improve this answer | |
  • I used this reference ! I don't know what I should do in windows ... – Bertaud Jun 7 '14 at 14:10
-1

Before install virtio,on windows(and sometimes on linux,but rare) you must include the virtio drivers on windows. Best thing to do is boot with ide and virtio windows recognize the new controller and ask for a driver put the driver shutdown simply change the hd position from ide to virtio Pray and reboot. For network card i'm not sure but windows can rename it with a new lan name

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.