Virsh patcher
Utility to apply common patches to libvirtd domain definitions.
**virsh patcher** is a Utility to apply common patches to libvirtd domain definitions. The project is written primarily in Python, distributed under the BSD 2-Clause "Simplified" License license, first published in 2017. Key topics include: kvm-hypervisor, libvirt, vfio.
Virsh Patcher 
Simple utility to apply common changes to libvirtd guests.
Changes will not be applied if the guest is running.
Supported Fixes
- Error 43 for Nvidia GPUs
- Hugepages memory backing
host-passthroughCPU type.
Installation
Arch Linux
Install virshpatcher from the AUR.
Debian / Ubuntu
sudo apt-get install python-libvirt
sudo pip install -U https://github.com/PassthroughPOST/virsh-patcher/archive/master.zip
Fedora
$ sudo dnf install libvirt-python
$ sudo pip install -U https://github.com/PassthroughPOST/virsh-patcher/archive/master.zip
Other Distributions
The libvirt-python package is a dependency. This can be either installed by you distributions
package manager, or via pip. In the latter case, libvirt-dev is required.
Usage
$ virshpatcher --error43 --hugepages --host-passthrough win10-guest
$ virshpatcher --help
usage: virshpatcher [--connect URI] [--error43] [--hugepages]
[--host-passthrough] [--patch PATCH] [--help]
[--vendor-id ab1234567890] [--random-vendor-id]
[DOMAIN [DOMAIN ...]]
libvirtd xml patcher
positional arguments:
DOMAIN
optional arguments:
--connect URI, -c URI
hypervisor connection URI
--error43 Add fixes for 'error43' with nvidia devices.
--hugepages Make guest use hugepages.
--host-passthrough Make guest CPU model `host_passthrough`.
--patch PATCH, -p PATCH
`XMLPatcher` class path
--help, -h This help text
--vendor-id ab1234567890
Vendor ID for E43 patch.
--random-vendor-id Set a random Vendor ID.
Future Improvements
- Add ability to connect PCI devices to guest (By name/pattern/id?)
- Interactive (?)
- More tests.
Contributors
Showing top 1 contributor by commit count.
This article is auto-generated from PassthroughPOST/virsh-patcher via the GitHub API.Last fetched: 6/27/2026
