I'm using gnome-boxes
to run lubuntu inside a virtual machine. I am wondering how I can verify whether or not it is using KVM? I am using a CPU that supports virtualization (Intel Core i5 3330) and kvm is enabled in the kernel. However, I don't see any clear indication in the gnome-boxes
preferences panel for the VM that confirms one way or another if it is using KVM.
1 Answer
According to What is the technology used by Boxes?:
Boxes uses qemu-kvm, libvirt-glib and spice-gtk to allow users to easily manage virtual machines and connect to remote machines.
... QEMU achieves near native performance by executing the guest code directly on the host CPU using KVM.
KVM (Kernel-based Virtual Machine) is a Linux kernel module that allows a user space program to use the hardware virtualization features of various processors.
I ran apt install -s gnome-boxes
within a VM of Kubuntu 20.04. Here's a partial output on that system. (The packages to be installed on your system may differ depending on what you already have):
The following NEW packages will be installed: cpu-checker dmeventd gnome-boxes ibverbs-providers ipxe-qemu ipxe-qemu-256k-compat-efi-roms libaio1 libbrlapi0.7 libcacard0 libcue2 libdevmapper-event1.02.1 libexempi8 libfdt1 libgexiv2-2 libgsf-1-114 libgsf-1-common libgtk-vnc-2.0-0 libgvnc-1.0-0 libgxps2 libibverbs1 libiscsi7 liblvm2cmd2.03 libosinfo-1.0-0 libosinfo-bin libphodav-2.0-0 libphodav-2.0-common libpmem1 libpoppler-glib8 librados2 librbd1 librdmacm1 libreadline5 libslirp0 libspice-client-glib-2.0-8 libspice-client-gtk-3.0-5 libspice-server1 libtotem-plparser-common libtotem-plparser18 libtracker-control-2.0-0 libtracker-miner-2.0-0 libtracker-sparql-2.0-0 libusbredirhost1 libusbredirparser1 libvirglrenderer1 libvirt-daemon libvirt-daemon-driver-qemu libvirt-daemon-driver-storage-rbd libvirt-glib-1.0-0 libvirt0 libvte-2.91-0 libvte-2.91-common lvm2 msr-tools osinfo-db ovmf qemu-block-extra qemu-kvm qemu-system-common qemu-system-data qemu-system-gui qemu-system-x86 qemu-utils seabios sharutils spice-client-glib-usb-acl-helper thin-provisioning-tools tracker tracker-extract tracker-miner-fs 0 upgraded, 69 newly installed, 0 to remove and 0 not upgraded.
As you can see, KVM is part of gnome-boxes (qemu-kvm
is bolded in the output). If your kernel doesn't support KVM, gnome-boxes
won't run. I had an older laptop which could run VirtualBox but not KVM because it failed egrep -c '(vmx|svm)' /proc/cpuinfo
.
If you want to check further, run pgrep qemu
without GNOME Boxes running and with GNOME Boxes running. Examine the (lengthy) command being executed in the latter case.
According to this video titled "GNOME Boxes: Virtualization made simple … from March 2020, Felipe Borges is currently largely responsible for GNOME Boxes. I guess he could authoritatively answer the question of whether GNOME Boxes uses or doesn't use KVM.
-
Hi, thanks for your answer. So, you're saying that Boxes will always use KVM, if it is available? Hmm ... I think what I am really after though is some way to verify for sure that a running Boxes VM is using KVM. Presumably, Boxes can run on a machine that doesn't have it?– Time4TeaApr 12, 2020 at 10:05
-
No, kvm is part of gnome-boxes. If your kernel doesn't support kvm, gnome-boxes won't run. I had an older laptop which could run VirtualBox but not kvm.– DK BoseApr 12, 2020 at 11:03
-
Ok, fair enough. It might be worth adding that to your answer, that Gnome Boxes won't work without KVM.– Time4TeaApr 14, 2020 at 22:40
-