@adw yes and no. I understand that Xen → Xen nested virt might be totally wrong. But I would love direct links on what are the actual problems into having KVM working under Xen.
Totally broken doesn’t leave practical points that need to be perfected to be able to use Qubes in other way then qemu (TCG) under it to run test and if that is the conclusion, I would love to understand why.
The issue linked is closed for discussion so what ticket should be opened to be able to discuss the minimal things broken inside of xen to be able to run kvm under it?
@adw: there is a difference between
- Expecting Xen to be able to run under other virtualization solutions
- Have Xen support KVM by having Xen support nested virtualization.
This discussion is aimed to support the second option: that is, being able to run kvm under a qube. What works, what doesn’t, where we are at and we can and cannot go. What is broken, what can be fixed and not.
Some not so relevant bing chat output:
I see. So you want to run KVM inside a Qube, which is a virtual machine managed by Xen and Qubes OS. You are currently using QEMU TCG, which is a software emulator that does not use hardware acceleration, and you want to switch to KVM, which is a hypervisor that uses hardware acceleration¹.
I did some web search and found some relevant discussions on this topic. It seems that there are some blockers that prevent you from running KVM inside a Qube, such as:
- Qubes OS does not support nested virtualization, which is the ability to run a hypervisor inside a virtual machine. Nested virtualization is considered both experimental in Xen and a potential security liability in Qubes OS².
- Qubes OS requires direct access to the hardware for security and performance reasons, and does not allow passing through devices such as GPUs to the Qubes³ . This may limit the functionality of KVM and the guest VMs running on it.
- QEMU TCG and KVM use different execution modes and have different requirements for the guest VMs. Switching between them may not be possible or easy without modifying the QEMU code or the guest VM configuration.
I’m afraid I don’t have enough knowledge or authority to provide you with a working plan to fix these issues. You may need to contact the developers or maintainers of Qubes OS, Xen, or KVM for more information and guidance. Alternatively, you may want to consider other solutions for your use case, such as using another hypervisor or another operating system that supports nested virtualization.
I hope this helps you understand some of the challenges of running KVM inside a Qube. If you have any more questions, please feel free to ask me.
Source: Conversation with Bing, 9/5/2023
(1) Does QubesOS support running a QEMU/KVM VM within a Qube?. Does QubesOS support running a QEMU/KVM VM within a Qube?.
(2) Can QEMU switch between KVM and TCG dynamically?. Can QEMU switch between KVM and TCG dynamically? - Stack Overflow.
(3) Documentation/TCG - QEMU. Documentation/TCG - QEMU.