Fighting error 43 – Nvidia GPU in a virtual machine

The infamous error 43 is the answer of Nvidia windows driver, in case it recognizes the GPU is used inside a virtual machine with GPU passthrough.

Luckily, with a few tweaks in the virtual machine configuration file the Nvidia driver can be tricked.

System setup

This method worked for me with these system evironment:

  • Host: Ubuntu 18.04, as well as a 16.04 host. 
  • Host: QEMU emulator version 2.12.0
  • Host: virsh version 4.6.0.
  • Guest: Windows 10
  • VM chipset: x440FX
  • Guest: Nvidia driver 399.07
  • Guest: GPU Geforce GTX 970 and Geforce GTX 1060

Virtual machine config changes

In order edit the virtual machines configuration use:

cd /etc/libvirt/qemu
sudo virsh define windows10.xml (change this according to your virtual machine name)
sudo virsh edit windows10

once your done with the edits and have saved your config re-run:

sudo virsh define windows10.xml

Fixing error 43

First of all find the very first line, which should read:

<domain type='kvm'>

and replace it with:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>

Now find the block <features> and add (or update if it already exists) the following block in parallel to the <acpi> block:

 <kvm> 
<hidden state='on'/>

</kvm>

Attention: Make sure <acpi> and <kvm> have the same indent.

Find the line which ends with </devices>
and add the following block afterwards (or alter the block if it already exists):

<qemu:commandline> 
<qemu:arg value='-cpu'/>
<qemu:arg value='host,hv_time,kvm=off,hv_vendor_id=null'/> </qemu:commandline>

Attention: Make sure <devices> and <qemu:commandline> have the same indent.

Special case for Qemu 4.0 and newer

In case you run Qemu 4.0 (or newer) with a q35 chipset,

find the block <features> and add (or update if it already exists) the following block in parallel to the <acpi> block:

 <ioapic driver='kvm'/>

Attention: Make sure <acpi> and <ioapic> have the same indent.

This also helps fixing BSOD and stuttering on the guest during mouse movement.


Thats it – these settings work for me. Instead of adding the hv_vendor_id=null to the qemu commandline, one can also directly set a tag in the <hyperv> section – but as I said these are the settings which worked for me.

As usual, the glorious arch wiki has further information and help; i.e. it recommends using a 12-character alphanumeric string as vendor ID.

Post updates

21.09.2019 – added further information regarding qemu 4.0 and error 43

3 Comment

  1. MICHAEL MAST says: Reply

    This got me past code 43, but now I get no video during Windows 10 boot. I can get into safe mode no issue, but normal boot produces no video signal and the monitor goes to sleep.

  2. Graeme says: Reply

    How do i fix Code 43 in Xen, as KVM my USB 3 card is grabed by XHCI_HCD!!!!!!!! and i don’t have much success recompiling Kernel to make it a damm module.

    1. Mathias Hueber says: Reply

      Unfortunately, I don’t have much experience with Xen. Which USB-3 card are you using? I found this thread. Also see the redhat post they are referencing.

Leave a Reply

Wir benutzen Cookies um die Nutzerfreundlichkeit der Webseite zu verbessen. Durch Deinen Besuch stimmst Du dem zu.