<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 28, 2015 at 2:09 PM, Alex Holst <span dir="ltr"><<a href="mailto:a@mongers.org" target="_blank">a@mongers.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I would appreciate hints on the following long-standing problem with getting two<br>
virtual gaming systems running so I can play games alongside my daughter:<br>
<br>
I have a Core i7 with two nVidia GPUs: GTX 770 and a newer GTX 960. When<br>
I invoke a virtual machine against the 960 head with the following<br>
script, the physical display inits, shows BIOS POST and the virtual guest boots:<br>
<br>
kvm -M q35 -m 8192 -cpu host,kvm=off \<br>
  -smp 4,sockets=1,cores=4,threads=1 \<br>
  -bios /usr/share/seabios/bios.bin -vga none \<br>
  -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \<br>
  -device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \<br>
  -device vfio-pci,host=02:00.1,bus=root.1,addr=00.1 \<br>
  -device vfio-pci,host=00:1a.0,bus=pcie.0 \<br>
  -device vfio-pci,host=00:1d.0,bus=pcie.0 \<br>
  -nographic -boot menu=on /vm2/maya-pew.img<br>
<br>
When I create virtual gaming systems via libvirt, I can access the<br>
virtual console and do a full install via VNC, but the attached displays<br>
never init.<br>
<br>
How do I create create two virtual clients in virsh / virt-manager and<br>
see their attached physical displays doing a normal BIOS POST?<br></blockquote><div><br></div><div>The obvious difference between your commandline version and the libvirt version is that one uses x-vga=on and the other doesn't.  Without that, the VM BIOS won't be able to post the card and whether it works in the guest OS depends on its dependencies on the VGA address space.  I describe a method for adding that x-vga=on option to a libvirt managed VM in part 5 of my howto series:</div><div><br></div><div> <a href="http://vfio.blogspot.com/2015/05/vfio-gpu-how-to-series-part-5-vga-mode.html">http://vfio.blogspot.com/2015/05/vfio-gpu-how-to-series-part-5-vga-mode.html</a></div><div><br></div><div>The basic idea is to replace the <emulator> in your xml with a wrapper script that dynamically inserts the x-vga=on option in the correct place and exec's the real QEMU binary.  Of course given the newness of your cards, a UEFI based VM using OVMF would eliminate the need for that option at all.  Thanks,</div><div><br></div><div>Alex</div></div></div></div>