How to use QEMU with Qubes?

61 views
Skip to first unread message

Guerlan

unread,
Jan 7, 2020, 2:43:33 PM1/7/20
to qubes-users
I undrstand that HVM uses QEMU to emulate some devices and BIOS. However, what if I want to have total control of QEMU?

What if there's an OS for which there's a QEMU tutorial and I want to do exact what is in the tutorial but in Qubes?

Do I need Qemu on dom0? dom0 has qemu-img-xen and qemu-nbd-xen. What are they for?

Or does QEMU runs inside xen, not in dom0?

Claudia

unread,
Jan 8, 2020, 6:46:52 AM1/8/20
to Guerlan, qubes-users

Xen uses QEMU just to emulate virtual hardware devices for HVMs, not for the actual virtualization. "Normal" Qemu is actually Qemu/KVM, which is not supported on Xen as far as I know. The next best thing is to create an HVM, see https://www.qubes-os.org/doc/standalone-and-hvm/#installing-an-os-in-an-hvm

qemu-img-xen is used for formatting image files or block devices for VMs. qemu-nbd-xen is for network block devices, though I'm not sure if/how they're used in Qubes.

trueriver

unread,
Jan 19, 2020, 8:30:02 AM1/19/20
to qubes-users




On Wednesday, 8 January 2020 11:46:52 UTC, Claudia wrote:
...Xen uses QEMU just to emulate virtual hardware devices for HVMs, not for the actual virtualization. "Normal" Qemu is actually Qemu/KVM, which is not supported on Xen as far as I know. The next best thing is to create an HVM, see https://www.qubes-os.org/doc/standalone-and-hvm/#installing-an-os-in-an-hvm

Here is a bit more background -- not strictly necessary to your immediate Q

For Linux users, "normal" QEMU is indeed Qemu/KVM.

However, some QEMU fans would probably argue that the definitive QEMU is the version that emulates everything. Obviously that leads to a slow running system, but will certainly run in an HVM. QEMU/KVM leverages the Linux kernel to run as much of the code as possible directly (ie on bare metal or in an HVM).

There is also a Windows variant (iirr called KQEMU) which runs on Windows (but only after you install the KQEMU drivers).

 

qemu-img-xen is used for formatting image files or block devices for VMs. qemu-nbd-xen is for network block devices, though I'm not sure if/how they're used in Qubes.


Most, or maybe all, the programs whise name begins qemu-... are utilities borrowed from the QEMU project, rather than actually part of the QEMU emulator itself. Why write a utility when the QEMU team already did what you want?

In fact, both KVM and XEN use QEMU code internally, but not in a way that you can easily leverage for what you are trying to do. So too does VirtualBox, which means Oracle cannot make it closed source without re-inventing a lot of QEMU wheels
Reply all
Reply to author
Forward
0 new messages