Unable to import Ubuntu virtual machine on Centos 7 kvm host

mr.zog asked:

[root@kvm ~]# virsh create /root/ns1.jesse64.xml
    error: Failed to create domain from /root/ns1.jesse64.xml
    error: internal error: process exited while connecting to monitor: qemu-kvm: -machine pc-i440fx-trusty,accel=kvm,usb=off: Unsupported machine type

So I run /usr/libexec/qemu-kvm -machine ? and see

Supported machines are:
none                 empty machine
pc                   RHEL 7.0.0 PC (i440FX + PIIX, 1996) (alias of pc-i440fx-rhel7.0.0)
pc-i440fx-rhel7.0.0  RHEL 7.0.0 PC (i440FX + PIIX, 1996) (default)
rhel6.6.0            RHEL 6.6.0 PC
rhel6.5.0            RHEL 6.5.0 PC
rhel6.4.0            RHEL 6.4.0 PC
rhel6.3.0            RHEL 6.3.0 PC
rhel6.2.0            RHEL 6.2.0 PC
rhel6.1.0            RHEL 6.1.0 PC
rhel6.0.0            RHEL 6.0.0 PC

So is there some package I need to install? The VM was created on a Ubuntu KVM host.

My answer:

You’re seeing this error because Ubuntu put their own customizations into its version of libvirt and qemu/KVM. RHEL, of course, did the same thing.

But there’s always a machine type that will work, namely, pc. This is always aliased to the latest i440fx machine type available on the hypervisor at the time the VM is defined.

Somewhere in the XML you’ll find something like:

<type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>

Just change this to:

<type arch='x86_64' machine='pc'>hvm</type>

(And note that if you use the new q35-xxx machine types, the generic machine type is q35.)

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.