glen3b

Windows VFIO VM Configuration

Aug 7th, 2020
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 6.68 KB | None | 0 0
  1. <domain type='kvm' id='1' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  2.   <name>Windows_Gaming</name>
  3.   <uuid>00000000-0000-0000-0000-000000000000</uuid>
  4.   <memory unit='KiB'>12582912</memory>
  5.   <currentMemory unit='KiB'>12582912</currentMemory>
  6.   <memoryBacking>
  7.     <hugepages/>
  8.   </memoryBacking>
  9.   <vcpu placement='static'>2</vcpu>
  10.   <cputune>
  11.     <vcpupin vcpu='0' cpuset='4'/>
  12.     <vcpupin vcpu='1' cpuset='5'/>
  13.   </cputune>
  14.   <resource>
  15.     <partition>/machine</partition>
  16.   </resource>
  17.   <os>
  18.     <type arch='x86_64' machine='pc-i440fx-3.0'>hvm</type>
  19.     <loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/x64/OVMF_CODE.fd</loader>
  20.     <nvram template='/usr/share/ovmf/x64/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/Windows_Gaming_VARS.fd</nvram>
  21.   </os>
  22.   <features>
  23.     <acpi/>
  24.     <apic/>
  25.     <hyperv>
  26.       <relaxed state='on'/>
  27.       <vapic state='on'/>
  28.       <spinlocks state='on' retries='8191'/>
  29.       <vendor_id state='on' value='GenuineLinux'/>
  30.     </hyperv>
  31.     <kvm>
  32.       <hidden state='on'/>
  33.     </kvm>
  34.     <vmport state='off'/>
  35.   </features>
  36.   <cpu mode='host-passthrough' check='partial' migratable='on'>
  37.     <topology sockets='1' dies='1' cores='2' threads='1'/>
  38.   </cpu>
  39.   <clock offset='localtime'>
  40.     <timer name='rtc' tickpolicy='catchup'/>
  41.     <timer name='pit' tickpolicy='delay'/>
  42.     <timer name='hpet' present='yes'/>
  43.     <timer name='hypervclock' present='yes'/>
  44.   </clock>
  45.   <on_poweroff>destroy</on_poweroff>
  46.   <on_reboot>restart</on_reboot>
  47.   <on_crash>destroy</on_crash>
  48.   <pm>
  49.     <suspend-to-mem enabled='no'/>
  50.     <suspend-to-disk enabled='no'/>
  51.   </pm>
  52.   <devices>
  53.     <emulator>/usr/bin/qemu-system-x86_64</emulator>
  54.     <disk type='file' device='cdrom'>
  55.       <driver name='qemu' type='raw'/>
  56.       <source file='/usr/share/virtio/virtio-win.iso' index='2'/>
  57.       <backingStore/>
  58.       <target dev='sda' bus='scsi'/>
  59.       <readonly/>
  60.       <alias name='scsi0-0-0-0'/>
  61.       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
  62.     </disk>
  63.     <disk type='block' device='disk'>
  64.       <driver name='qemu' type='raw' cache='none' discard='unmap'/>
  65.       <source dev='/dev/mapper/winvmdisk' index='1'/>
  66.       <backingStore/>
  67.       <target dev='sdb' bus='scsi'/>
  68.       <boot order='1'/>
  69.       <alias name='scsi0-0-0-1'/>
  70.       <address type='drive' controller='0' bus='0' target='0' unit='1'/>
  71.     </disk>
  72.     <controller type='pci' index='0' model='pci-root'>
  73.       <alias name='pci.0'/>
  74.     </controller>
  75.     <controller type='pci' index='1' model='pci-bridge'>
  76.       <model name='pci-bridge'/>
  77.       <target chassisNr='1'/>
  78.       <alias name='pci.1'/>
  79.       <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
  80.     </controller>
  81.     <controller type='virtio-serial' index='0'>
  82.       <alias name='virtio-serial0'/>
  83.       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
  84.     </controller>
  85.     <controller type='usb' index='0' model='nec-xhci'>
  86.       <alias name='usb'/>
  87.       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
  88.     </controller>
  89.     <controller type='scsi' index='0' model='virtio-scsi'>
  90.       <alias name='scsi0'/>
  91.       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
  92.     </controller>
  93.     <interface type='bridge'>
  94.       <mac address='11:11:11:11:11:11'/>
  95.       <source bridge='br0'/>
  96.       <target dev='vnet0'/>
  97.       <model type='virtio'/>
  98.       <link state='up'/>
  99.       <alias name='net0'/>
  100.       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
  101.     </interface>
  102.     <interface type='network'>
  103.       <mac address='22:22:22:22:22:22'/>
  104.       <source network='winvm_direct_connect' portid='33333333-3333-3333-3333-333333333333' bridge='virbrDirectWin'/>
  105.       <target dev='vnet1'/>
  106.       <model type='virtio'/>
  107.       <alias name='net1'/>
  108.       <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
  109.     </interface>
  110.     <serial type='pty'>
  111.       <source path='/dev/pts/0'/>
  112.       <target type='isa-serial' port='0'>
  113.         <model name='isa-serial'/>
  114.       </target>
  115.       <alias name='serial0'/>
  116.     </serial>
  117.     <console type='pty' tty='/dev/pts/0'>
  118.       <source path='/dev/pts/0'/>
  119.       <target type='serial' port='0'/>
  120.       <alias name='serial0'/>
  121.     </console>
  122.     <channel type='unix'>
  123.       <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-1-Windows_Gaming/org.qemu.guest_agent.0'/>
  124.       <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
  125.       <alias name='channel0'/>
  126.       <address type='virtio-serial' controller='0' bus='0' port='1'/>
  127.     </channel>
  128.     <input type='mouse' bus='ps2'>
  129.       <alias name='input0'/>
  130.     </input>
  131.     <input type='keyboard' bus='ps2'>
  132.       <alias name='input1'/>
  133.     </input>
  134.     <sound model='ac97'>
  135.       <alias name='sound0'/>
  136.       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
  137.     </sound>
  138.     <hostdev mode='subsystem' type='pci' managed='yes'>
  139.       <driver name='vfio'/>
  140.       <source>
  141.         <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
  142.       </source>
  143.       <alias name='hostdev2'/>
  144.       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
  145.     </hostdev>
  146.     <hostdev mode='subsystem' type='pci' managed='yes'>
  147.       <driver name='vfio'/>
  148.       <source>
  149.         <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
  150.       </source>
  151.       <alias name='hostdev3'/>
  152.       <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
  153.     </hostdev>
  154.     <hostdev mode='subsystem' type='usb' managed='yes'>
  155.       <source>
  156.         <vendor id='0x4444'/>
  157.         <product id='0x5555'/>
  158.         <address bus='1' device='3'/>
  159.       </source>
  160.       <alias name='hostdev4'/>
  161.       <address type='usb' bus='0' port='1'/>
  162.     </hostdev>
  163.     <hostdev mode='subsystem' type='usb' managed='yes'>
  164.       <source>
  165.         <vendor id='0x6666'/>
  166.         <product id='0x7777'/>
  167.         <address bus='1' device='4'/>
  168.       </source>
  169.       <alias name='hostdev5'/>
  170.       <address type='usb' bus='0' port='2'/>
  171.     </hostdev>
  172.     <memballoon model='virtio'>
  173.       <alias name='balloon0'/>
  174.       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
  175.     </memballoon>
  176.   </devices>
  177.   <seclabel type='dynamic' model='dac' relabel='yes'>
  178.     <label>+65534:+991</label>
  179.     <imagelabel>+65534:+991</imagelabel>
  180.   </seclabel>
  181.   <qemu:commandline>
  182.     <qemu:arg value='-enable-kvm'/>
  183.     <qemu:env name='QEMU_AUDIO_DRV' value='pa'/>
  184.     <qemu:env name='QEMU_PA_SERVER' value='127.0.0.1'/>
  185.   </qemu:commandline>
  186. </domain>
Add Comment
Please, Sign In to add comment