software:linux:kvm
Table of Contents
KVM
KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V).
Useful virsh commands
- rescan default pool for new images:
pool-refresh default
How-tos
- move from ZVOL to standard qcow2 image:
qemu-img convert -p -f raw -O qcow2 /dev/zvol/YOUR_ZVOL /your/image.qcow2
Extract SLIC and use it for your VM
credits: 1
- extract slic from donor
#!/bin/bash set -e cat /sys/firmware/acpi/tables/SLIC > slic.bin cat /sys/firmware/acpi/tables/MSDM > msdm.bin dmidecode -t 0 -u | grep $'^\t\t[^"]' | xargs -n1 | perl -lne 'printf "%c", hex($_)' > smbios_type_0.bin dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
- apply to your kvm xml
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> <!-- ... --> <qemu:commandline> <qemu:arg value='-acpitable'/> <qemu:arg value='file=/some/path/slic.bin'/> <qemu:arg value='-acpitable'/> <qemu:arg value='file=/some/path/msdm.bin'/> <qemu:arg value='-smbios'/> <qemu:arg value='file=/some/path/smbios_type_0.bin'/> <qemu:arg value='-smbios'/> <qemu:arg value='file=/some/path/smbios_type_1.bin'/> </qemu:commandline> </domain>
Quirks
High CPU usage with Windows
virt-manager doesn't pick the best options for the clock and, as consequence, the CPU usage is quite high. Replace the clock section with:
<clock offset='localtime'>
<timer name='hpet' present='yes'/>
<timer name='hypervclock' present='yes'/>
</clock>
Links
Microsoft signed drivers
Official distribution pages
Useful links
software/linux/kvm.txt · Last modified: by Michele Porelli
