- https://computingforgeeks.com/how-to-install-kvm-on-rhel-8
- https://blog.hostonnet.com/opennebula
- https://godleon.github.io/blog/KVM/KVM-Template-And-Snapshot/
-
Most of trobuleshottings are also for KVM running in Ubuntu 18.04.
-
virsh define node_imei.xml
error: Failed to define domain from node_imei.xml
error: Cannot check QEMU binary /usr/bin/qemu-system-x86_64: No such file or directory
virsh create node_imei.xml
error: Failed to create domain from node_imei.xml
error: internal error: process exited while connecting to monitor: 2020-07-16T14:37:16.111004Z qemu-system-x86_64: -machine pc-i440fx-bionic,accel=kvm,usb=off,dump-guest-core=off: unsupported machine type
Use -machine help to list supported machines
- Using
virsh capabilities | grep machine
to find available machine name
error: Failed to create domain from node_imei.xml
error: internal error: process exited while connecting to monitor: 2020-07-16T14:41:54.254519Z qemu-system-x86_64: -drive file=/root/virtual_smartphone/imei-test/system.img,format=raw,if=none,id=drive-virtio-disk0,readonly=on: Could not open '/root/virtual_smartphone/imei-test/system.img': Permission denied
- Editing
/etc/libvirt/qemu.conf
with vim editor. - Change to line
442
probably. - Uncomment
#user = "root"
and#group = "root"
. - Uncomment
dynamic_ownership = 0
to disable file ownership change. systemctl restart libvirtd
to restart libvirt daemon service.
error: internal error: process exited while connecting to monitor: 2020-07-16 14:48:12.280+0000: Domain id=1 is tainted: high-privileges
2020-07-16T14:48:12.424833Z qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory
- Try to decrease memory or allocate memeories on host OS.
......
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
......
2020-07-16T15:07:48.264787Z qemu-system-x86_64: -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,share-rw=on,drive=drive-virtio-disk1,id=virtio-disk1,write-cache=on: Block node is read-only
- Set current ownership via
chown root:root imei-test/*
command
guest CPU doesn't match specification: extra features: hypervisor, missing features: tsc_adjust,clflushopt,stibp,ssbd
......
unsupported machine type "pc-i440fx-3.1"
......
Here are useful commands to check out current CPU features and machine name support:
virsh -c qemu:///system capabilities | grep machine
virsh -c qemu:///system capabilities | grep "feature "
- Fix defined
XML
file:
......
<feature policy='require' name='ss'/>
<feature policy='require' name='tsc_adjust'/>
<feature policy='require' name='clflushopt'/>
<feature policy='require' name='stibp'/>
<feature policy='require' name='ssbd'/>
<feature policy='require' name='pdpe1gb'/>
<feature policy='disable' name='mpx'/>
......
Sample CPU Features (propably suggested):
......
<cpu mode='custom' match='exact' check='full'>
<model fallback='forbid'>Skylake-Client-IBRS</model>
<vendor>Intel</vendor>
<feature policy='require' name='vme'/>
<feature policy='require' name='f16c'/>
<feature policy='require' name='rdrand'/>
<feature policy='require' name='hypervisor'/>
<feature policy='require' name='arat'/>
<feature policy='require' name='xsaveopt'/>
<feature policy='require' name='abm'/>
<feature policy='disable' name='rtm'/>
<feature policy='disable' name='hle'/>
<feature policy='disable' name='mpx'/>
<feature policy='disable' name='rdseed'/>
<feature policy='disable' name='adx'/>
<feature policy='disable' name='smap'/>
<feature policy='disable' name='xsavec'/>
<feature policy='disable' name='xgetbv1'/>
<feature policy='disable' name='3dnowprefetch'/>
<feature policy='disable' name='pcid'/>
<feature policy='disable' name='erms'/>
<feature policy='disable' name='invpcid'/>
<feature policy='disable' name='spec-ctrl'/>
</cpu>
......
- Export XML setting file via
virsh dumpxml "machine_name"
- Convert
qcow2
file toraw
(.img) file
qemu-img convert -f qcow2 -O raw rhel7.5.qcow2 rhel7.5.img
- Convert
qcow2
file toraw
(.img) file
qemu-img convert -f raw -O qcow2 rhel7.5.img rhel7.5.qcow2