Skip to content
Advertisement

qom-type is missing when running qemu/kvm

I’m trying to set up QEMU/KVM and faced the following issue:

$ qemu-img create  ubuntu.img 64G //Create image with raw format, not qcow2
$ qemu-system-x86_64 -hda ubuntu.img -cdrom ~/Downloads/ubuntu-20.04.2.0-desktop-amd64.iso -cpu host -enable-kvm
WARNING: Image format was not specified for 'ubuntu.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
VNC server running on 127.0.0.1:5900

So I tried to specify this as a format as

$ qemu-system-x86_64 -hda ubuntu.img -cdrom ~/Downloads/ubuntu-20.04.2.0-desktop-amd64.iso -cpu host -enable-kvm -object format=raw
qemu-system-x86_64: -object format=raw: Parameter 'qom-type' is missing

Searching for qom-type at QEMU manual page didn’t give any results.

How to specify the correct qom-type for that case?

Advertisement

Answer

“-object format=raw” says “create a QOM object, whose type I have not specified, and then give it the option format=raw”. The error message is a bit unhelpful, but it’s trying to tell you that that makes no sense.

What you need to do is replace the “-hda ubuntu.img” with a “long form” set of options which provide you with a place to tell QEMU to use format=raw for that disk image file. You can find out how to do that in the answer to this existing question.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement