# [SOLVED] KVM vga passthrough suspend host

## jnack95

I have a problem I've been unable to find an answer to, if one exists. I am running Gentoo with kvm installed using libvirt and virt-manager. I have two graphics cards installed, a Geforce GTX 560 and a Quadro 2000. I am running Win7 professional as a guest with the Quadro 2000 so I can use CAD/CAM software (Sprutcam). I stubbed out the Quadro PCI address and bound it and it works perfectly. The problem is if I suspend my Gentoo host system while the Win7 Guest is running (or paused), the Quadro is not re-attached after resuming and passed through to the guest and I get a blank screen, but windows is still running. Sometimes it freezes the whole system and sometimes I can forceably shutdown Windows (or use keystrokes to shut it down). I'm not sure this is even possible, but there is no problem pausing and restarting the guest as long as there is no vga passthrough. It seems the quadro card needs to be re-initialized or something. I would like to keep windows running (or paused) all the time without having to shut it down. Hoping someone else has figured this out. Thanks.Last edited by jnack95 on Thu May 12, 2016 3:39 pm; edited 1 time in total

----------

## szatox

An interesting scenario. What happens when you try to suspend that guest OS before you suspend the host?

----------

## jnack95

I can't suspend (Sleep) the Windows 7 guest from within windows (greyed out), but I can pause the guest from the host on virt-manager.  When I pause the guest and suspend the host, then resume the host and unpause the guest, is when I lose my graphics (blank screen).  Interestingly though, If I just pause the guest and then unpause it, the graphics come back.

----------

## jnack95

Finally figured this out.  SeaBIOS doesn't have this functionality and OVMF must be used.....which means the guest must be installed with the proper OVMF uefi bios.  Then, the suspend function in the guest can be turned on in the .xml file virt-manager uses.  To suspend the host without losing the graphics during resume, the guest must first be suspended.  When the host is resumed, the guest also resumes and the graphics work fine.  There's probably some way to have the host issue suspend to the guest via virsh before it suspends, but I haven't put any effort into figuring this out yet.

----------

## szatox

Great news!

 *Quote:*   

>  There's probably some way to have the host issue suspend to the guest via virsh before it suspends, but I haven't put any effort into figuring this out yet.

 

The easiest way will be setting action triggered by power button to suspend and sending ACPI even to the guest.

You could use network-based service or virtio device for that as well, but why do that the hard way?  :Wink: 

----------

