KVM Passthrough
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Quentin Franchi 0d2baae059
Update 'README.md'
4 months ago
etc/libvirt/hooks Added scripts 4 months ago
README.md Update 'README.md' 4 months ago
qemu_kvm_xml.xml Update 'qemu_kvm_xml.xml' 4 months ago


VFIO KVM Passthrough configuration

CPU: AMD Ryzen 9 5900X

GPU: AMD ATI Radeon RX 6600/6600 XT/6600M


This is a Single GPU Passthrough configuration for AMD CPU and GPU.

It is also supposed to work with anti-cheat vm detection, though i don't play any games with heavy anti-cheat.

Works on Arch Linux with the amdgpu driver and PipeWire (should work fine with pulseaudio).

Note: You should check the start.sh to change the user.

If you are using Nvidia GPU you can check Mageas's repository.


CPU Pinning:

<vcpu placement="static">20</vcpu>
  <vcpupin vcpu="0" cpuset="2"/>
  <vcpupin vcpu="1" cpuset="14"/>
  <vcpupin vcpu="2" cpuset="3"/>
  <vcpupin vcpu="3" cpuset="15"/>
  <vcpupin vcpu="4" cpuset="4"/>
  <vcpupin vcpu="5" cpuset="16"/>
  <vcpupin vcpu="6" cpuset="5"/>
  <vcpupin vcpu="7" cpuset="17"/>
  <vcpupin vcpu="8" cpuset="6"/>
  <vcpupin vcpu="9" cpuset="18"/>
  <vcpupin vcpu="10" cpuset="7"/>
  <vcpupin vcpu="11" cpuset="19"/>
  <vcpupin vcpu="12" cpuset="8"/>
  <vcpupin vcpu="13" cpuset="20"/>
  <vcpupin vcpu="14" cpuset="9"/>
  <vcpupin vcpu="15" cpuset="21"/>
  <vcpupin vcpu="16" cpuset="10"/>
  <vcpupin vcpu="17" cpuset="22"/>
  <vcpupin vcpu="18" cpuset="11"/>
  <vcpupin vcpu="19" cpuset="23"/>
  <emulatorpin cpuset="0-1,12-13"/>
  <iothreadpin iothread="1" cpuset="0,12"/>
  <iothreadpin iothread="2" cpuset="1,13"/>
<cpu mode="host-passthrough" check="none" migratable="on">
  <topology sockets="1" dies="1" cores="10" threads="2"/>
  <cache mode="passthrough"/>
  <feature policy="require" name="topoext"/>


<memory unit="KiB">15624192</memory>
<currentMemory unit="KiB">15624192</currentMemory>



  • No internet in VM:


Save in a file called default.xml src: Add dev="enp5s0" to <forward mode="nat" />

  <forward mode='nat' dev="enp5s0" />
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:0a:cd:21'/>
  <ip address='' netmask=''>
      <range start='' end=''/>

Remove default NAT configuration

sudo virsh net-undefine default
sudo virsh net-destroy default
sudo virsh net-list

Make sure everything is enabled and restart libvirt

sudo systemctl enable --now libvirtd
sudo systemctl enable virtlogd.socket
sudo systemctl restart libvirtd.service

Redefine default configuration with the default.xml file.

sudo virsh net-define default.xml
sudo virsh net-autostart default
sudo virsh net-start default