KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

Redhat 5.4 Windows Virtio Drivers Part 2: Block Drivers

In the first part of this series I showed you a preview of the latest Redhat Windows Virtio Drivers beginning with the network drivers. In this follow up post, I’ll demonstrate how to install and use the latest windows virtio block drivers. A few things to note here. First of all, I didn’t actually use the virtio block drivers from the rpm I found in my redhat subscription account as I had some issues getting that to work. Instead I built the drivers myself from the latest gpl source, the most recent change being September 6th 2009 which provided fixes to get it working for me. This is the version I’ll be writing about today and you’ll find a copy of it at the bottom of this post. Lastly, I’ll be using virt-manager 0.8.0 for this demonstration but you can use command line if you prefer.

 

 

 

1. Boot your Windows Guest with a non system virtio disk attached

So far I have not been able to get the drivers to work during an install of Windows. The only way I  could get this to work is to install the virtio block drivers after attaching a non system virtio disk. Once the virtio block drivers are installed, change your system disk to use a virtio controller and reboot. Thanks to Bill McGonigle for this hint.

First attach a virtio disk to your windows guest. It doesn’t matter how big this disk is and you will not need this disk after the drivers are installed. The only reason for using this disk is to get the virtio block drivers installed.

In Virt-manager choose a virtio disk to add.

 

Now you should have two disks attached. Your system disk and a virtio disk. In my case my system disk was used an IDE controller and is shown as "hda"

 

 

 

 

2. Install the Windows Virtio Block Drivers

Attach the cdrom image provided in this post to your windows guest and boot. When you boot your guest with the virtio block disk attached windows will prompt you on startup for a driver to install.

 Select No when the wizard asks you to search for the driver software.

Select “install from a list of specific location” .

Select the Browse button and navigate to the driver CD.

 

Select the appropriate folder for your guest architecture. My test was done with a windows 2003 32 bit guest.

Click Next to begin the install.

You will get a prompt warning about the driver not being signed. Go ahead and select “Continue Anyway”.

Your driver has now successfully been installed.

When you inspect your drivers you’ll now see the redhat virtio scsi controller listed.

 

3. Change your system disk to use a Virtio Block Controller

This last step involves rebooting your windows guest. Shut down your windows guest, detach the virtio disk you added in the previous section (unless you want to continue using it) and change your system disk to use a virtio block controller. My virt-manager guest now looked like below where my system disk is shown as “vda”.

Boot your windows guest now.

Your windows guest is now using the latest windows virtio block driver.

 

How did it go for you?

Admittedly this is a round about way for installing the virtio block drivers on windows. I had no luck getting it work on Windows XP and so far I’ve only gotten a chance to test with windows 2003 32 bit. You should be able to use the windows 2008 drivers with Vista. Give these drivers a test and comment on any issues you have.

Attached below is an ISO image containing windows virtio block drivers built using the most recent source code (Sep 6 2009).

AttachmentSize
viostor.iso1.92 MB

See Also

Comments

nlite

Have you tried this driver with nLite? It would be cool if that would work, no need for installing the driver afterwards.

Windows7 Boot

I used this procedure on W7 RC and have my F drive data disk working fine.

However, I cannot get the C drive to boot when I change its stanza on the KVM command line to "if=virtio,boot=on" - I get what appears to be an error from the BIOS.

If I boot this configuration from the install DVD and go into repair mode, W7 does see the C drive after doing its thing, but I still can't boot into it.

Any ideas?

Re: Windows7 Boot

> I used this procedure on W7 RC and have my F drive data disk working fine.

Interesting, are you using 32bit or 64bit Windows? I'm trying to get Windows 7 Professional 64bit (final edition from MSDN) to use this driver without any luck. Win7 will simply not allow the driver since it isn't signed.

Using the leaked RedHat driver, which Haydn Solomon attached to part 1 of this article, the driver installs fine, but the device is unable to start according to Windows 7. This issue is similar to the issue I had on Windows 2008 64bit a while ago, but unfortunately turning on testsigning doesn't solve the issue in Windows 7 :(

(Windows 2008 post: http://www.linux-kvm.com/content/latest-release-windows-virtio-network-d...)

Re: Windows 7

There's a windows 7 development environment for building the driver which I haven't tried yet. I will try building the drivers for Windows 7 and test to see if it works. Kenni have you tried the drivers attached in this post with windows 2008 yet?

Re: Windows 7

I did a quick test on Windows 2008 64 bit:
"Windows found driver software for your device but encountered an error while attempting to install it."

"Windows cannot load the device driver for this hardware. The driver may be corrupted or missing (Code 39)"

No luck...

Re: win 2008

What version of kvm are you running? I'm going to test windows 2008 myself and post a comment. I'm running Fedora Rawhide Virtualization Repository which is latest version.

Re: win 2008

I'm running kvm88 with kernel 2.6.30.6 (stock modules from kernel).

I've just tested viostor.iso and virtio-setup-200908.iso during the installation of Win2008. No matching drivers for the virtio controller were found on viostor.iso, but the driver was found when using virtio-setup-200908.iso. However, after loading the driver, no harddisks becomes available on the list, so it still doesn't work.

In the Proxmox thread, a Proxmox developer confirms that the drivers installs fine on two win2008 64bit (r2?) machines...hmm. Perhaps it's a local problem on my system, caused by the "stable-and-not-bleeding-edge" kvm/virtio kernel drivers.

I'm looking forward to hear your test results...

Re: win 2008

OK as far as installing drivers during install, I'll have to modify the driver setup for the disk. I just did a quick test with windows 7 using 2008 drivers but it didn't work. So I'm going to do the following test.

1. Compile drivers for windows 7 and test with windows 7.

2. Do a test with windows 2008 64 bit using procedure above. I'll have to do an install of 2008 first so that will take a few minutes.

3. Customize an install disk for 2008 and test installing drivers during install.

I'll provide some updates soon.

Re: Got windows 2008 Working...

with a little workaround. It's not pretty but it works. The problem is the driver certification. You can temporarily disable this check ONLY for the current session by using the F8 advanced boot options. To use this keep pressing F8 as soon as you boot your guest and you'll see the options as shown below.

Select "Disable Driver Signature Enforcement" and follow procedure described in this post. I haven't tried but it should work with Windows 7 and Vista as well.

No windows xp version?

No windows xp version? 32/64

NetKVM

Thanks! I have tested it under 2003R2 x64 and it works fine.

Haydn, please can you build netkvm drivers from git?

For WinXp 64 you can try to

For WinXp 64 you can try to use W2K3 64 driver. Never did it by myself, but it should to be fine. After all it must be the same storage stack.
WinXp 32 has no storport port driver inside, so you need to build a scsiport version of viostor driver by yourself.

Friday, September 18, 2009 -

Friday, September 18, 2009 - 15:39 Kenni
> Interesting, are you using 32bit or 64bit Windows?

Host is 2.6.31 + qemu-kvm-0.10.6 on amd64 host (64-bit)
Guest is W7 RC1 Build 7100 64-bit

I am using the Aug31 leaked driver from Haydn.

Re: Windows 7 working..

Martyg,

I tested successfully with windows 7. When using the procedure in this post windows 7 does not automatically prompt you to install a driver when you attach the non system virtio disk (step 2). Instead you have to go into device manager, right click on the default scsi controller driver and update. Next specify where to find driver and navigate to the windows 2008 driver for your architecture on the iso image. Do all this in a session using the F8 boot option so that the driver will install. Also once the driver is installed there's no need to use the F8 boot option for subsequent boots.

I tested successfully with Windows 7 Professional 32 bit. Try this and see if it works for you too.

Re: Re: Windows 7 working..

The F8 key also did the trick on Windows 2008 64bit :) But unlike your test with Win7 32bit, I have to confirm with F8 on every restart to make the system boot.

I'll test with Windows 7 Professional 64bit in a few minutes...

Windows 7 Pro 64bit (and possibly Vista 64bit)

Wow, getting Win7 64bit (final edition, build 7600) to work is a bitch...using F8 will let you install the driver and access the VirtIO drive, but the next time you reboot and forgets to press F8, it'll "repair" your computer and uninstall the drivers since they're unsigned.

I finally got it to work permanently by signing the driver with a test certificate, putting Windows into testsigning mode and installing the driver.

(Hint: Microsoft has disabled the "DISABLE_INTEGRITY_CHECKS" option, which in earlier versions of Vista64 (and Win7 64 RC?) would allow installation of unsigned drivers)

I did the following:
1. Copy the Win2008 driver folder from the CD onto the HDD
2. Download DSEO 1.3b ("Driver Signature Enforcement Overrider 1.3b") - You DON'T have to turn off UAC!
3. Start DSEO and select to sign viostor.sys which you just copied to the HDD
4. Uninstall DSEO :)
5. Start up cmd as administrator
6. Turn on testsigning by entering: bcdedit -set TESTSIGNING ON
7. Restart computer
8. Install driver as described in the article above

Haydn, if you can add a test certificate to the driver on the iso, people will only have to turn on testsigning to get it working :)

Re: Windows 7 Pro 64 bit

Kenny,

For some reason I didn't have the issue on subsequent boots for my Windows 7 Pro.... probably something specific to version. I'll work on the testsigning to make the process a bit easier.

I've been using the windows 2003 32 bit guest with the block device it seems to be running fine so far.. no issues. As far as performance, it definitely "feels" better ( haven't done any performance tests yet). Doing things like pulling up the file explorer, copying files etc seems much faster.

Re: Windows 7 Pro 64 bit

Yep, I can confirm this behaviour - Windows 7 Pro 32bit doesn't care about unsigned drivers at all, it's only the 64bit version causing problems.

For comparison, I downloaded Windows 7 Pro 32bit (build 7600 - final) from MSDN. After a clean install I just pointed it to the i386 win2008 drivers, and it worked right away. I didn't even have to click F8 at boottime to be able to install the drivers :)

Re: windows 7 pro

OK, that confirms what I'm seeing. I also got a clean copy from the msdn site as well but only tested pro 32 bit. I'll continue to see what I can do with the signing of the drivers.

Re: NetKVM for S

S,

Not much as changed with the latest NetKVM drivers except one change for checking of the IO port range. Nevertheless I'll go ahead and build the latest drivers and post it.

I successful to installed

I successful to installed virtio block driver on xp 64bit use win2003/64. ;-)
(tried on 32bit winxp too, but can not install)

but after i add change the second harddrive from ide to virtio. i can not boot up the system, it always display the blue screen :-(

I've built a win xp version

I've built a win xp version from source code,it works fine.you can try it by build the source code.

Re: built xp version

Coolper,

Did you build 32 bit or 64 bit?

Yes, use win2003/x86_64

Yes, use win2003/x86_64 version on windows xp x86_64 work too.
but when i add more than one virtio hard drive, the system can not boot, it always show blue screen.

i can only use one virtio hard drive. i use it on C:\Drive(system drive), it work.

Another question (OT)
i want speed up my system will ramdisk.
i add the second hard drive then config $TMP $TEMP to this hard drive, and mount this hard drive with snapshot=on option, then when xp write something to this drive, kvm will use /tmp/ramdom.file to store it, if i mount /tmp as ramdisk (on host), will it speed up the guest system?

simple question:
when run kvm with -snapshot option, all file is write to /tmp/ramdom.file, if on host /tmp is mount with ramdisk.
will it speed up kvm guset system?

Performance?

And what about performance?

Hello, Can you post them

Hello,
Can you post them some where if possible?
Thanks

Post what?

Post what?

Windows XP block drivers

I asked windows XP block driver in binary form may be hosted somewhere on the net...

Re: Windows XP block drivers

Gennie,

Haven't been able to get the xp 32 bit drivers to work but 64 XP bit will work with 2003 drivers.

Working on an updated driver disk with testsigned drivers to avoid jumping through hoops to get them installed.

RE: Performance

On my two identical servers: the former has Debian 5 installed as host OS and the Windows 2008 SP2 as guest with this virtio driver and the latter has the same Windows 2008 as host. Iozone benchmark results from Windows 2008 (guest and host) show nearly identical performance.

Can you also test the Windows

Can you also test the Windows 2008 as guest with ide hard drive?

Performance with Windows 2008 IDE HDD

Unfortunately, I already can't compare ide and virtio performance on server with Debian 5 host.
On my another server with Fedora 11 host OS the iozone benchmark shows that random read and random write on virtio have the similar performance as ide hard.
But what is dispiriting that windows test is ten times as low as fedora host test.

binaries released from KVM team

just today:

http://www.linux-kvm.org/page/WindowsGuestDrivers/Download_Drivers

I tested on win2008r2 (by pressing f8 to disable the driver signing issue). looks ok in the first run.

64-Bt Signing

> 2. Download DSEO 1.3b ("Driver Signature Enforcement Overrider 1.3b") - You DON'T have to turn off UAC!
> 3. Start DSEO and select to sign viostor.sys which you just copied to the HDD

Kenni, these pointers helped me a bunch.
Thanks for posting these.

Boot-Start Driver (was: Windows7 Boot)

I have an existing W7 x64 install where I am trying to migrate the C drive from IDE to virtio without reinstalling the OS.

The auxiliary drive (F:)on this system is already migrated to virtio, so the drivers are installed in the guest OS.

However, I cannot migrate the C-drive the same way. The OS refuses to see the device at boot. I can boot from CD into repair mode and see the drive after loading the drivers.

Is there a way to tag the virtio drivers to load as part of the boot process, or do I hve to do a full reinstall on C:?

Works with 32-bit XP

I had no problems getting the SCSI drivers to work with 32-bit Windows XP. The performance difference is not obvious.

Re: works with 32-bit xp

Raf,

Apparently the drivers were optimized for w2k3 and w2k8. What you're seeing is consistent with other users. See link to mailing list discussion below.

http://www.mail-archive.com/kvm@vger.kernel.org/msg22813.html

Win2k3

Hello,

i tried the procedure above on 2003 32bit guest. All is fine until i have to reboot. Then System says that it cant boot of the drive and there is a hardware error. Ideas?

Does it work in windows 2000

Does it work in windows 2000 ?

Re: does it work with windows 2000

Unfortunately it doesn't. The virtio block drivers are based on the windows storport mini drivers which only run on 2003 and later releases of windows. See the following link for more info

http://msdn.microsoft.com/en-us/library/ms803198.aspx

Re: win2k3

Hety,

What version of kvm are you running?

Sorry for my English. My W2k

Sorry for my English.
My W2k SP4 rollup 1 works with XP drivers. I'm not sure that's work's very well (I see 4 drives in guest Device Manager and two SCSI Controllers), but in this time I not have problem. System is a copy (drive copy by SelfImage 1.21) my real server.
kvm-85 from lenny backports, Debian lenny, AMD64.

Window XP 32 bits - IT WORKS

Hello,

Thank you for this interesting and useful guide.

I succeeded in installing the disk virtio driver following almost the same procedure as described in the article, but using command line instead of the graphical interface. Here is how I did:

1.Install a KVM virtual machine with Win XP and "normal" drivers

2.Download both network and disk drivers from here into the virtual machine. Decompress drivers in a temporary folder. Shutdown the Windows XP virtual machine.
3.define a second hard disk as a virtio disk
qemu-kvm \

-m 2048 \

-smp 2 \

-localtime \

-name "Windows XP" \

-drive file=~/WinXP.raw,index=0 \
-drive file=~/drived.raw,if=virtio,index=1 \

-boot c \
-net nic,model=virtio \

-net tap,ifname=$netdev,script=no,downscript=no \

-soundhw es1370 \

-usb \

-sdl \
Reboot the virtual machine and install the new disk driver. Normally Windows will auto-detect the new hardware and you just need to point it to the location where you saved the driver.
4.After the driver installation, shutdown the Windows XP virtual machine again, and modify the command line as follows
qemu-kvm \

-m 2048 \

-smp 2 \

-localtime \

-name "Windows XP" \

-drive file=~/WinXP.raw,if=virtio,boot=on \
-net nic,model=virtio \

-net tap,ifname=$netdev,script=no,downscript=no \

-soundhw es1370 \

-usb \

-sdl \
Of course the if=virtio defines the virtualised interface for the disk, but it is important to precise boot=on otherwise the machine will not boot (at least in my case)

Now if the graphical interface is able to generate the boot=on option, it should also work with the graphical GUI.

In terms of performance, I did no measurements, but it does not feel like there is an improvement. Maybe is it due to the fact the XP is 32 bits and that my physical host is 64 bits (Fedora 11)

Regards,

Windows 2008 standard 64bit

I got amd64/viostor.sys to load and the controller appears as functional in the Device Manager, however when trying to initialize a 2TB volume gives me an "incorrect fuction" error. Doesnt matter of I choose MBR or GPT disk, I cannot use the disk.

The viostor.sys driver, even though its from the AMD64 folder is placed by Windows into the /system32/drivers folder. Dont know if this matters.

Removing the virtio controller and installing the volume using the IDE device works perfectly.

I dont think these redhat virtio drivers are ready for primetime...

Thank you!

I did everything, but my Windows 7 x64 guest would not boot. The bios says it couldn't boot from any device. This comment solved my problem:

"it is important to precise boot=on otherwise the machine will not boot (at least in my case)"

So, I changed my drive line to:

-drive file=/dev/raidvg/win7c,cache=none,if=virtio,boot=on

and now it works.

Concerned...

I used the PerformanceTest benchmarking suite on a Windows guest using the IDE driver and then the virtio driver. The virtio driver was actually a little slower. Average Disk Mark score was 264.

Maybe of more concern was that it was a lot slower than the virtual box tests. Average Disk Mark score was 961.

Are there 64bit signed

Are there 64bit signed drivers?

sda?

Is there a way to get sda working on window 2008 as this necessary to bundle images for eucalyptus, vda would not work.

And moreover when i set the device to scsi the drive does not get detected during the partition, step of installation.

Just the Red Hat version worked

The driver virtio-win from Red Hat worked like a charm for me.

I've got no luck with this driver here.

Obs.: the steps to install were the same for both drivers.

Thanks anyway.

Re: Just the Red Hat version worked

Daniel,

What windows guest did you try the drivers from this post on?

Post new comment

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.