Operating System and Software
- CentOS 6, 8
- Libvirt
Problem
- After moving a Virtual Machine (VM) from a RHEL 6 hypervisor to a Rocky Linux 8 hypervisor, starting the VM fails with the error: libvirt.libvirtError: internal error: process exited while connecting to monitor: qemu-kvm: -machine rhel6.2.0,accel=kvm,usb=off,dump-guest-core=off: unsupported machine type
How to Fix
-
open the virtual machine configuration on the Rocky Linux 8 hypervisor:
$ virsh edit virtual_machine_id_or_name
-
inside the editor, look for the string
rhel6.2.0
and replace it withpc
- save the file and start the Virtual Machine
- the libvirt error should be now gone
Origin of the Problem
Qemu, the PC emulator used by default on RHEL with libvirt, has a defined list of emulated machine models, which is updated for each RHEL release.
It is possible the see this list by calling:
$ /usr/libexec/qemu-kvm -machine help
Qemu on RHEL has support for machine types for all the minor release of the current release, plus all the minor releases of the previous major release.
Besides these RHEL specific types, Qemu has support for the generic machine types pc
and q35
.
In the error message above we had a Virtual Machine (VM) with the type rhel6.2.0
, and the VM boot failed on a Rocky Linux 8 host.
As the Rocky Linux 8 host supports only VM types from rhel7.0
and higher and the generic types pc
and q35
, we have to change the machine type to pc
so that Qemu can boot the VM.