(SOLVED) Dual Monitor Setup Solutions / Multi VM in VirtManager (Vfio)

Hi! I’ve been reading this post:
https://forum.level1techs.com/t/two-monitor-host-with-gpu-passthrough-for-guest/173362

I am looking into a similar setup. However I have a few questions related to it and hope any of you might have some answers.

I have a functional qemu/virt-manager setup running with Linux guests as well as Win guests. I have 2 dedicated GPUs and an iGPU. So I can basically run 2 VMs at the same time. This is all a recent setup/upgrade and I am still tinkering with it. It is running fine but only on 1 screen per VM each at most (virt manager windows, the host runs obviously on 2 screens just fine as one would expect).

My host system is Debian 12. I have 2 graphic ports on my MOBO and a dual monitor setup. I need switching between the VMs and Host a bit.

A functioning two-monitor output for EACH running VM is basically a requirement. Looking Glass isn’t really working for a Linux Guest setup so I kind of stayed away from it for now.

Question is. What working alternatives are there?

Is there a way to have a dual monitor setup on every VM (mostly Linux but also Win) when running them. Basically so that the video output of the dedicated GPU gets “copied” to the iGPU, depending on which VM is currently active?

Basically (as I’m sure you are well aware) same as when I run Linux or Windows bare metal using my dGPU but only having a physical cable connection to my iGPU. Same principal (in theory).

I understand that the alternative is a KVM switch and connect all outputs through that device and switch then whenever needed. Is there no soft-alternative to this?

I found this as well (https://www.nomachine.com/) but not sure if anyone has tried this and will actually work?

I’ve also read a few things about Proxmox but don’t know much about it. Or maybe I am missing something and it is actually something that can be done inside of virt-manager / host? Any advice on what to do is appreciated.

Want to share how I’ve set the whole thing up in the end. Some friendly people on Discord pointed me to the solution (vfio discord).

First I’ve set up ‘evdev’ so I can switch KB/Mouse between VMs as I like. The Arch wiki explains how to do so. I’ve set different KB commands for different VMs (Alt&Alt / Ctrl&Ctrl / etc…).

Then I’ve set this up: https://passthroughpo.st/switching-monitor-inputs-software-ddc/. Your monitor needs to support DDC. Most do, even though sometimes buggy.

I didn’t do the end part as instead I’ve setup a simple custom command (KB shortcut) in my host that then runs a shell script to switch to a different monitor channel when I need to do so. If that sounds in any way complicated to you then rest assured it isn’t. Of all the paths I had a look at this was by far the easiest with great results.

So for example when I run a Linux VM I can switch Mouse & KB back and forth with Alt&Alt and press (in my case) Alt+F12 to switch the monitor channel. To go back it is Alt&Alt again to get KB&Mouse active in host and then press Alt+F11 to switch monitors and I am fully back again. Takes a few seconds and it’s all done.

The only downside that I can see with this compared to for example looking glass is that all GPU outputs have to be physically connected. So in my case (with 2 dGPUs and 1 iGPU, each with 2 outputs) I actually have 6 cables running to my monitors (3 x 2). And of course the monitors need 3 inputs each all with DDC enabled (which a wide range of monitors should have).

All of this saved me buying a KVM switch and it works really well without a hitch so far. I’ve stress tested the VMs a good bit already and no issues or lag at all. It is so good that one wouldn’t even be aware a VM is running at all.

Really happy with the setup and hope this helps others as well to come to this solution quicker. Good luck!