As part of my new VM-based desktop build, my plan was to run a hypervisor and virtualize Windows and OS X, each with a dedicated graphics card using PCI Passthrough.

PCI Passthrough of NVidia cards is usually software-restricted to the professional Quadro series of cards. Desktop cards will flat out not work whatsoever if the drivers detect that they are being run inside virtualization. Through all the research I did online, I found that only KVM allows you to passthrough Nvidia GPUs by toggling the "kvm=off" flag so the drivers can't detect virtualization and don't throw an error -43 when they detect they are in a VM.

I got this to work on an Arch linux install with KVM/libvirt, however I wanted the same thing to be possible on ESXi, which is my preferred hypervisor.

After hours of trail and error, I finally found a solution. It's really simple, but I found nobody else online who was able to actually get it to work.

What you need to do is the following:

  • Open your VM's .vmx file with a text editor.
  • At the bottom of the file, add the following line: hypervisor.cpuid.v0 = FALSE
  • Save the file.

The line that you need to add will hide from the guest OS the fact that it is being virtualized, hence allowing the NVidia drivers to run.

If you continue to have issues, make sure you are booting your ESXi box with Intel integrated graphics disabled. The graphics card to passthrough should be in use at boot, then passed over to the VM once it starts up.