Paravirtualized Block Drivers for Windows: Difference between revisions

From Proxmox VE
Jump to navigation Jump to search
(→‎Setup Steps: mention bringing additional disks online after switch)
 
(21 intermediate revisions by 5 users not shown)
Line 1: Line 1:
==Introduction==
= Introduction =
In order to improve disk performance, special paravirtualized block drivers can be installed in Windows guests: to use them, you have to obtain those drivers and then install them on the VM guest os.
In order to improve disk performance, special paravirtualized block drivers can be installed in Windows guests.
You have to download and install those drivers in the VM, as Windows does not provide them by default.


See [[Windows_VirtIO_Drivers]] to get info about
{{note|Proxmox recommends using SCSI with ''VirtIO SCSI single'' as ''SCSI Controller Type'' for VM disks, to have the most features and best performance.
* downloading VirtIO drivers
VirtIO block may get deprecated in the future.|reminder}}
* changelog and guest OS compatibility
* other kind of guest devices supported


==Download==
== Download ==
Download the latest drivers (ISO) as suggested by the page [[Windows_VirtIO_Drivers]] to your desktop.


Then upload the ISO to your Proxmox VE server:  
You can download the latest stable Windows VirtIO drivers from: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
* logon to the Proxmox VE web interface
Older Windows Versions may sometimes need older VirtIO drivers. See [[Windows VirtIO Drivers]] for more info about the change log, guest OS compatibility and other useful VirtIO guest devices.
* select a ISO-enabled storage (see [[Storage_Model#Storage_type_Content]])
* switch to "content" tab
* just use the "upload" button on the menu bar.  


==Installation==
Upload the ISO through the Proxmox VE WebUI:An existing Windows installation
Select a Storage which allows ISO images in the Proxmox VE WebUI and switch to ''ISO Temples'' tab where you can use the "''Upload''" button or the "''Download from URL''" on the menu bar.


===Choose the right driver===
= Installation =


* Follow the link: [[Windows_VirtIO_Drivers#Choose_the_right_driver]]
== Setup On Running Windows ==


===Installation strategies===
To switch an existing Windows installation to use the VirtIO-SCSI drivers and boot from them, it needs to see a disk requiring the driver before. This can be done by adding a small temporary disk.


The target is to make Windows install virtio drivers for all of its disks. There could be more strategies to accomplish this task:
Installing the drivers and switching the boot disk to VirtIO SCSI right away (without a dummy disk) will result in a blue screen, claiming an "INACCESSIBLE BOOT DEVICE". In such a situation, you can revert your changes to get Windows to boot again.


====Adding a temporary drive====
=== Setup Steps ===
see (http://www.linux-kvm.com/content/redhat-54-windows-virtio-drivers-part-2-block-drivers)


* tested guest OSs:
* Prerequisite: An installed running Windows OS and the [[#Download|VirtIO driver ISO]]
** windows 2003 r2 32 bit guest
* insert the VirtIO ISO into the VMs CDROM Drive.
** windows 2000 server sp4
* add a small disk (1GB) with Bus Type SCSI (with ''Options -> SCSI Controller Typ: VirtIO'') or VirtIO Block to the VM.
* The disk should get hot plugged. If not, you need to reboot the VM.
* Window should detect the new disk.
** If the drivers are not yet installed, it will be shown as a new unknown device and ask for drivers. If it doesn't, open the Device Manager, there should be an unknown device
** Right-click this entry and select "Update Driver Software"
** Select No when the wizard asks you to search for the driver software (online)
** Select "Install from a list of specific location"
** Use the Browse button and navigate to the driver CDROM
** Usually, selecting the CDROM's top directory (e.g. ''D:'') is enough on newer Windows versions.
** If that doesn't work, select the appropriate folder for your guest version/architecture manually (use ''vioscsi'' for SCSI and ''vioblk'' for VirtIO)
** Click Next to begin the installation. You may get a warning about the driver not being signed on older Windows Versions, select "Continue Anyway".
** Finish the driver installation


The base Windows OS in your guest VM knows nothing about virtio drivers, and for this reason you can't simply stop the VM, change the disk to virtio and reboot. You have to force Windows to install virtio drivers for a virtio disk (provided by PVE), how? Adding a temporary, small, virtio disk to the VM, then booting Windows and make it recognize a new disk, and ask you the drivers (which, at that moment, it doesn't know of).
Once the drivers are installed, wait until the disk shows up in the "Disk Management" utility.


* Prerequisite: the Base Windows OS should be already running (IDE drives, usually)
('''Legacy Note''': Windows 2000 may report each disk 8 times in disk management, just install and use the first of each 8-tuple. In "My computer" you should see each disk only once.)
* Shut down the VM and, from PVE:
** add a small virtio disk to the VM through PVE web interface (say, 1GB)
** add the ISO just downloaded as a CD device through PVE web interface
** Make shure that the primary boot device is still the old (IDE) boot disk, not the new virtio disk, through PVE web interface.
* Boot the VM and log in as a local administrator
* Window should detect the new disk has a new unknown device and ask you for its drivers:
** 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 version/architecture.
* Click Next to begin the install.You will get a prompt warning about the driver not being signed. Go ahead and select “Continue Anyway”.
* Finish then driver installation


You should now be able to enter "disk management", from windows, and initalize and format the temporary virtio disk (this is really not necessary but it will prove you that the driver is installed and running)
Windows now has the VirtIO SCSI/Block driver installed, and we need to re-attach the VM disks as SCSI or VirtIO block.
* Shut down the VM
* ''Detach'' and ''Remove'' the dummy disk. After the Detach operation, it will show up as <code>unusedX</code> disk. Removing it right away is recommended to remove uncertainties in the next steps.
* ''Detach'' the disk you want to use as Virtio SCSI/Block.
* reattach them by double-clicking the unused disk entry (or use the Edit button). Select ''SCSI'' for VirtIO SCSI or ''VirtIO block''.
* '''Important''': Adapt the ''Boot Order'' under the VM's ''Option'' tab. Make sure that the primary boot device is still the old boot disk.
* You can now start the VM again, it should use the new disk controller.
* If the VM does not boot, you can detach and re-attach the disk as IDE or SATA to redo the procedure with the dummy disk. Don't forget to adapt the boot order!


('''Note''': doing this on windows 2000 could show a strange, but apparently safe, behaviour: in the "disk management" control panel, you may see something like 8 times the drives you actually have!!! In fact, if you add 1 virtio drive, it shows 8 drives, but it's actually the same, repeated. You can in fact "sign" just the first, and then see that all "duplicated" drives are signed as well. However, the drives seems to behave and perform very well indeed. I signed, created partition, formatted, just  on the first one, with no side effects, up to now. In "My computer" you will see just 1 disk, anyway.)
After you are done, you can:
 
* remove the temporary VirtIO disk if you haven't already done this and don't need it anymore
Now, Windows system has the virtio driver installed, and we need to convert all of its previous (IDE) system disks to virtio.
* Shut down the VM and, from PVE and:
** remove (from the vm, not from disk) all the (IDE) disk it had previously (as desired, these "removed" drives will still be listed as "unused disks" under the "Hardware" tab), and
** re-add them, in the same order, as virtio disks (do this by clicking the "Edit" button for each of the "unused" disks that were previously "IDE" disks)
** Make shure that the primary boot device is still the old (IDE) boot disk, through PVE web interface.
* Boot again the VM and log in as a local administrator
* Window should detect it has new unknown devices and ask you for the drivers
** You should have the option to use again the ISO mounted in the CD drive
** You should also be able to tell windows to use "current" drivers, it now already has.
** You don't need to initialize/format these drives, of course :-)
 
After finishing, through PVE web interface, you can:
* remove the first, temporary, virtio disk (if you don't need that more space on Windows)
* remove the ISO mounted as CD device
* remove the ISO mounted as CD device


====During windows installation====
*Notice: it is always recommended installing Windows with a standard block device (usually IDE) first and only then switching to virtio (after installation). In that case you can always switch to standard block device if virtio somehow fails even if you are not able to logon to a system.


You can add the block drivers during install by manually adding a virtual floppy drive (vfd) to the system for the initial install as follows (thanks to meto & user100 in the forum).
{{note|If you switch multiple disks to VirtIO drivers, you might have to bring them ''Online'' in the Disk Management utility on the first boot after the switch by right-clicking on the disk.}}


First you need the virtio drivers from RedHat that can be found here: http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/
== Setup During Windows Installation ==
If you are doing VIRTIO for network (recommended), grab the ISO file as well as the vfd file.


Copy the vfd file onto the PM Host server or somewhere where it can be access from the PM Host server.
Download the VirtIO drivers as described above.


When you create the VM, set the drive type to virtio and complete the rest of the settings.
Set the drive type to SCSI (preferred) or VirtIO and the Network also to VirtIO for improved performance.
Add a second IDE CDROM drive, in the first mount the Windows installer ISO and in the second the VirtIO driver ISO.


Start the system from the PROXMOX interface, but don't bother with the VNC console at this stage.
Start the VM and the Installation process. When you arrive at the Disk/Partition selection, you won't see a Disk because the driver isn't loaded.
Click on the ''Load Driver'' button and then ''Browse''. In the file browser, select the second CDROM drive with the VirtIO drivers and navigate to the ''vioscsi/WINVERSION/amd64'' (or x86 if you have a 32 bit system) and click ''OK''. A RedHat driver should show up in the ''Driver Installer'' click next to install them. Repeat the process for other VirtIO driver (e.g. network, qxl, ...).


In an ssh session to the PM Host server (for your Win KVM), find the KVM process you just started by filtering on your VMID
The Disks should now show up, and you can continue with the installation process as usual.


  # ps ax | grep kvm | grep <VMID>


You need to copy the line from the output for your VM beginning from "/usr/bin/kvm". Make sure you grab the whole line except the process ID, etc.
=== Old VFD Method ===


Stop your VM from the PROXMOX interface
'''Note''': This is kept for legacy reasons, newer Windows versions (XP and newer) should use the above menthod.


In your ssh session paste the copied line then add the floppy drive option : -fda /where/you/put/the/file/virtio-win-<version>.vfd
You can add the block drivers during install by manually adding a virtual floppy drive (vfd) and a second IDE CDROM Drive (for network VirtIO) to the VM for the initial install (thanks to meto & user100 in the forum).


As an example this restarts a ''created'' KVM on my system with the floppy installed
Download the VirtIO drivers as described above, upload VFD (for disks) and the ISO (for network) to PVE.


  # /usr/bin/kvm -monitor unix:/var/run/qemu-server/1086.mon,server,nowait -vnc unix:/var/run/qemu-server/1086.vnc,password -pidfile /var/run/qemu-server/1086.pid
Use:
    -daemonize -usbdevice tablet -name Win2K3_Base -smp sockets=1,cores=1 -nodefaults -boot menu=on -vga cirrus -tdf -localtime -rtc-td-hack -k en-us
qm set <VMID> -args '-fda /where/you/put/the/file/virtio-win-<VERSION>.vfd'
    -drive file=/mnt/pve/ISO/WIN_2K3_SP2.iso,if=ide,index=2,media=cdrom -drive file=/var/lib/vz/images/1086/vm-1086-disk-1.qcow2,if=virtio,index=0,boot=on
to add the VFD as virtual floppy to the VM.
    -m 512 -netdev type=tap,id=vlan0d0,ifname=vmtab1086i0d0,script=/var/lib/qemu-server/bridge-vlan -device virtio-net-pci,mac=2A:D2:74:78:2E:E1,netdev=vlan0d0
      ''-fda /mnt/pve/ISO/virtio-win-1.1.16.vfd''


Once you enter your command the KVM will start & you will see the system "running" in the PROXMOX interface. Now open the console. The standard boot sequence for a new KVM seems to be HDD - Floppy - CD, you can change this but it's just as easy to reboot using the Ctrl-Alt-Del button in the console, use F12 to bring up a boot selection window & boot from CD.
Now start the VM and open the console. The standard boot sequence for a new KVM seems to be HDD - Floppy - CD, you can change this but it's just as easy to reboot using the Ctrl-Alt-Del button in the console, use F12 to bring up a boot selection window & boot from CD.


Once windows starts to load, press F6 to get it to look for extra drivers to load. It will automatically load the floppy & away you go.
Once windows starts to load, press F6 to get it to look for extra drivers to load. It will automatically load the floppy & away you go.


Note that the virtio drivers aren't windows logo signed so you need to tell the system to continue to load the drivers.  
Note that older VirtIO drivers aren't signed by Windows, so you need to tell the system to continue to load the drivers on a warning.  


More information on floppy drives can be found here : http://www.linux-kvm.com/content/block-driver-updates-install-drivers-during-windows-installation
More information on floppy drives can be found here : http://www.linux-kvm.com/content/block-driver-updates-install-drivers-during-windows-installation
Line 111: Line 94:
And in the forum here : http://forum.proxmox.com/threads/3711-Floppy-support-hack
And in the forum here : http://forum.proxmox.com/threads/3711-Floppy-support-hack


==See also==
= See also =
* [[Windows_VirtIO_Drivers]]
* [[Windows VirtIO Drivers]]
* [[Paravirtualized Network Drivers for Windows]]
* [[Paravirtualized Network Drivers for Windows]]
* [[Dynamic_Memory_Management|Dynamic_Memory_Management]]
* [[Dynamic Memory Management]]


[[Category: HOWTO]]
[[Category: HOWTO]]
[[Category: Qemu/KVM]]

Latest revision as of 11:36, 22 March 2024

Introduction

In order to improve disk performance, special paravirtualized block drivers can be installed in Windows guests. You have to download and install those drivers in the VM, as Windows does not provide them by default.

Yellowpin.svg Note: Proxmox recommends using SCSI with VirtIO SCSI single as SCSI Controller Type for VM disks, to have the most features and best performance.

VirtIO block may get deprecated in the future.

Download

You can download the latest stable Windows VirtIO drivers from: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso Older Windows Versions may sometimes need older VirtIO drivers. See Windows VirtIO Drivers for more info about the change log, guest OS compatibility and other useful VirtIO guest devices.

Upload the ISO through the Proxmox VE WebUI:An existing Windows installation Select a Storage which allows ISO images in the Proxmox VE WebUI and switch to ISO Temples tab where you can use the "Upload" button or the "Download from URL" on the menu bar.

Installation

Setup On Running Windows

To switch an existing Windows installation to use the VirtIO-SCSI drivers and boot from them, it needs to see a disk requiring the driver before. This can be done by adding a small temporary disk.

Installing the drivers and switching the boot disk to VirtIO SCSI right away (without a dummy disk) will result in a blue screen, claiming an "INACCESSIBLE BOOT DEVICE". In such a situation, you can revert your changes to get Windows to boot again.

Setup Steps

  • Prerequisite: An installed running Windows OS and the VirtIO driver ISO
  • insert the VirtIO ISO into the VMs CDROM Drive.
  • add a small disk (1GB) with Bus Type SCSI (with Options -> SCSI Controller Typ: VirtIO) or VirtIO Block to the VM.
  • The disk should get hot plugged. If not, you need to reboot the VM.
  • Window should detect the new disk.
    • If the drivers are not yet installed, it will be shown as a new unknown device and ask for drivers. If it doesn't, open the Device Manager, there should be an unknown device
    • Right-click this entry and select "Update Driver Software"
    • Select No when the wizard asks you to search for the driver software (online)
    • Select "Install from a list of specific location"
    • Use the Browse button and navigate to the driver CDROM
    • Usually, selecting the CDROM's top directory (e.g. D:) is enough on newer Windows versions.
    • If that doesn't work, select the appropriate folder for your guest version/architecture manually (use vioscsi for SCSI and vioblk for VirtIO)
    • Click Next to begin the installation. You may get a warning about the driver not being signed on older Windows Versions, select "Continue Anyway".
    • Finish the driver installation

Once the drivers are installed, wait until the disk shows up in the "Disk Management" utility.

(Legacy Note: Windows 2000 may report each disk 8 times in disk management, just install and use the first of each 8-tuple. In "My computer" you should see each disk only once.)

Windows now has the VirtIO SCSI/Block driver installed, and we need to re-attach the VM disks as SCSI or VirtIO block.

  • Shut down the VM
  • Detach and Remove the dummy disk. After the Detach operation, it will show up as unusedX disk. Removing it right away is recommended to remove uncertainties in the next steps.
  • Detach the disk you want to use as Virtio SCSI/Block.
  • reattach them by double-clicking the unused disk entry (or use the Edit button). Select SCSI for VirtIO SCSI or VirtIO block.
  • Important: Adapt the Boot Order under the VM's Option tab. Make sure that the primary boot device is still the old boot disk.
  • You can now start the VM again, it should use the new disk controller.
  • If the VM does not boot, you can detach and re-attach the disk as IDE or SATA to redo the procedure with the dummy disk. Don't forget to adapt the boot order!

After you are done, you can:

  • remove the temporary VirtIO disk if you haven't already done this and don't need it anymore
  • remove the ISO mounted as CD device


Yellowpin.svg Note: If you switch multiple disks to VirtIO drivers, you might have to bring them Online in the Disk Management utility on the first boot after the switch by right-clicking on the disk.

Setup During Windows Installation

Download the VirtIO drivers as described above.

Set the drive type to SCSI (preferred) or VirtIO and the Network also to VirtIO for improved performance. Add a second IDE CDROM drive, in the first mount the Windows installer ISO and in the second the VirtIO driver ISO.

Start the VM and the Installation process. When you arrive at the Disk/Partition selection, you won't see a Disk because the driver isn't loaded. Click on the Load Driver button and then Browse. In the file browser, select the second CDROM drive with the VirtIO drivers and navigate to the vioscsi/WINVERSION/amd64 (or x86 if you have a 32 bit system) and click OK. A RedHat driver should show up in the Driver Installer click next to install them. Repeat the process for other VirtIO driver (e.g. network, qxl, ...).

The Disks should now show up, and you can continue with the installation process as usual.


Old VFD Method

Note: This is kept for legacy reasons, newer Windows versions (XP and newer) should use the above menthod.

You can add the block drivers during install by manually adding a virtual floppy drive (vfd) and a second IDE CDROM Drive (for network VirtIO) to the VM for the initial install (thanks to meto & user100 in the forum).

Download the VirtIO drivers as described above, upload VFD (for disks) and the ISO (for network) to PVE.

Use:

qm set <VMID> -args '-fda /where/you/put/the/file/virtio-win-<VERSION>.vfd'

to add the VFD as virtual floppy to the VM.

Now start the VM and open the console. The standard boot sequence for a new KVM seems to be HDD - Floppy - CD, you can change this but it's just as easy to reboot using the Ctrl-Alt-Del button in the console, use F12 to bring up a boot selection window & boot from CD.

Once windows starts to load, press F6 to get it to look for extra drivers to load. It will automatically load the floppy & away you go.

Note that older VirtIO drivers aren't signed by Windows, so you need to tell the system to continue to load the drivers on a warning.

More information on floppy drives can be found here : http://www.linux-kvm.com/content/block-driver-updates-install-drivers-during-windows-installation

And in the forum here : http://forum.proxmox.com/threads/3711-Floppy-support-hack

See also