Hello, i am pretty much a Linux Noob. I got the Basics of the Terminal down already and riced my PC and Laptop a bit and am now using Arch as a daily Driver. But i still have one Problem: Gaming. I play a lot of Games with my Friends that run Windows and am tired of having to reboot my System all the Time just to play a round of Overwatch. So I decided to make a Virtual Machine with Qemu + KVM and GPU Passthrough to run Windows while i am still booted into Linux. The Problem with that is, that if i Pass through my Main Graphics Card Linux doesnt have anything to run on. My Question is, if there is way to keep Linux running in the Background ( preferrably with my Programs still functioning ) without a Graphics Card ?
In theory Linux doesn't need a graphics card to function, servers and such are headless and don't need graphics card, the thing is, I'm not sure if the graphics sub system will initiate without a GPU present and I suspect this is the case, You can run Qemu+KVM with GPU passthrough on a headless machine but whether you can have the desktop running in the background without a GPU I have no idea.
the easiest way is to buy a 20 dollar beater gpu for the host system. since you aren't on an intel platform, Bumblebee isn't an option, but if you have an AMD gpu you can use a script to detach and then reattach the GPU on VM bootup/shutdown.
There is some experimental stuff for both host and VM sharing the hardware i think on Fedora but it is will need quite sometime before being usable. You best bet is to buy a cheap 20 buck GPU and run Linux host from there.
I've been doing some work on this lately. Let's put it this way:
It's not exactly supported right now. The reason for that is because X11 doesn't exactly support disconnecting all the displays from the server. You'll need some sort of virtual display that you can link into if you want this working.
Also, the Virtual Terminals will have a problem disconnecting. My advice is to find a used older GPU of the opposite vendor (if you've got AMD go Nvidia, if you've got Nvidia go AMD) so that you can boot off one and pass the other through.
@turin231 That's not fully correct. They're trying to work on "one-click passthrough" which is going to be freaking awesome and I'll switch to fedora as soon as that's a feature. The thing is that with the current implementation of QEMU and KVM, it's not possible to share the GPU between Windows VM and the Linux host. Windows would have to be aware of the Linux host's X11 or Wayland server, and that's just never going to happen. It's a hard concept to explain. If you want me to, I can give it a go.
Sure thing. What follows will assume you have a preliminary understanding of how IOMMU and IOVA works. An overview (albeit, brief) can be found on part 3 of my Pragmatic Neckbeard discussion, linked below:
So, when you pass through a GPU to a VM, you're attaching all the IOVA space (it's input/output registers) to the VM. This gives said VM exclusive access to it. The VM isn't aware of the X11 server that's trying to access it and the X11 server (for example) isn't aware of the VM that's got access to it. They're both theoretically able to access it, but when the VM tries to execute a PCI call after the X server does, you're going to have the device in an inconsistent state. Imagine trying to have two people trying to assemble the same ikea desk with a blindfold while being entirely unaware of the other person that's working on the desk. You go to pick up part D and find that screw H is no longer where you'd left it. It's the same idea if you were to share them. This would require a rewrite of the fundamental principals of the GPU drivers on both Windows and Linux for GPU sharing to be capable. At least, that's my understanding of it.
I hope this wasn't too out there. If you've read through the conceptual discussion on the link and still have questions, feel free to call me out for being a terrible writer.
basically, if you're on AMD, you can write a system that shuts down X and detaches the card via KMS, boots up the vm, and vice versa when you shut it down. comes with a lot of caveats, but it works if you build the system right.
Anyone had troubles with passthrou in fedora? Only thing that makes problems for me now is driver install in guest (it just turns screen off but vm is running fine, I've checked if amdgpu is being properly unloaded, and it is.) everthing is good only installing drivers makes issue. :(
From my experiences you need a few megabytes of gpu memory to render a console, atleast this was the case from my previous job, but were talking around 7-8mb or so. No idea wether or not they had some wierd setup which caused this, they were working with some really wierd setups doing math on GPUs and what not, but the onboard gpu from your motherboard would do more then well, and you dont need to connect a monitor or anything, just the vram is needed.