Can I alternate a GPU without needing to log off the host having 2 GPUs?

Hey guys,

I have a kubuntu and a working windows 11 VM on qemu and want to pass through the GPU for gaming, but am still wondering which method I’ll follow. I have a dell g3 laptop with an intel iGPU and a nvidia 1650ti mobile.

The ideal scenario for me would be of when turning the VM on, having it being passed through, and when it is turned off, having it being passed back (the nvidia one). So after searching I came across the single GPU passthrough guides (Single-GPU-Passthrough by joeknock90) and was about to follow it, but realized I would be logged off my host user when the GPU is passed to the guest. The problem is that, if possible, I’d still like to use linux while browsing the VM, and by having 2 GPUs I figured there could be a way of one maintaining linux. As the single-gpu guide uses a script for passing it and passing it back, could I just remove the log off part?

I also came across the looking-glass guides, but honestly didn’t fully understand the advantages of it and if it would be a solution for this use case.

If anybody knows what could be the best method of passing through in this case, I’d appreciate it. Thanks for reading my question.