New
#1
Mega Optimising Disk I/O for Windows Guests on KVM
Hi folks
Two ways -- pass the pci device of say the SSD or whatever to your Windows Guest - then use Native file system
If you can't pass the pci device then create a virtio disk - then before booting up change the xml for that disk to :
<disk type="file" device="disk">
<driver name="qemu" type="raw" cache="none" io="native"/> "This line only -- leave every thing else !!!!
<source file="/mnt/DV2/XPVIORAW"/>
<target dev="vdb" bus="virtio"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x0a" function="0x0"/>
</disk>
The RAW and native I/O file is the key -- then on ist boot of the VM use DISKPART windows command to format the disk and assign a letter and then use any live linux distro (can be 64 bit OS for this purpose) with dd command to clone existing disk to new one if you want to use that as your Windows OS disk. the disk will be /dev/vda /dev/vdb . You can also use Macrium stand alone bootable iso provided it has the virtio drivers in it - that's why probably better to use Linux live iso for cloning.
(If you use the GUI virtual machine manager just enable xml editing and open the XML section for the disk if you don't like virsh command line - probably better to use the GUI if you are relative beginners at this).
For Windows 10 using Macrium to clone to RAW (Native FS) HDD
BTW for people using XP VM's the easiest way to clone a disk is to boot any current linux iso (the bios will support 64 bit virtual OS) from WITHIN the GUEST, note you have to add the cd as a SATA cd rom on the VM -- boot it, clone your HDD,
shut down the VM , remove the sata CD rom and the sata controller and now boot from the relevant HDD --remove the original one.
here's the clone process of the XP virtual disks using a Fedora live iso image set as boot device from the XP VM -- doesn't matter that it's 64 bit OS. The HDD's show up as vda and vdb.
For XP printing - install win2pdf printer - still works on XP and print to pdf file (FF handles pdf OK to view in XP) then print pdf on host or a W10 VM with modern laser printer driver or whatever.
I think I've re-jigged XP enough now to keep it useful for a few more years for those who need to use it for all sorts of reasons -- legacy games work fine too if you are in that sort of thing.
KVM has come such a long way these days and on modern kernels it runs rings around HYPER-V (on a Non server edition of a Windows Host), VBOX and VMWare too. You can also experiment by running any Linux as a VM on whatever Windows you like and then enabling KVM to try nested VM just to "have a go with it" .
It's 100% free as well - and really obsoleting things now like CITRIX and XEN.
Also you don't need poor I/O pergormance any more on Windows VM's - whether or not you pass thru a whole HDD or use "Raw Native " Virtual disks.
Cheers
jimbo
Last edited by jimbo45; 23 Mar 2021 at 11:37. Reason: added info about cloning the virtual disks especially on XP