I have a VFIO VM set up using a single Nvidia 10 series GPU, with the host running off the IGPU. I am attempting to automate the process of attaching/detaching the GPU from the virtual machine and handing it back to the host, allowing Linux to utilize both monitors (I have two, the host on one, and guest on the other) while the guest is offline. I’ve seen a lot of setups using libvirt hooks to automate the process, but it usually results in the guest machine taking up all monitors when it’s online.
Would it be possible to automate using libvirt hooks but have the host use the IGPU, and second monitor while the guest uses the Nvidia GPU and main monitor. Then have the GPU be passed back to the host, and have it utilize both monitors instead of only the guest/host taking up all monitors?