skip to content

libkvm

Table of Contents

First of all - cockpit and not virt-manager, because cockpit is in active development, not like virt-manager, with the latest stable release - 2 years ago. Discussion on virt-manager vs cockpit. I tried to search for ‘virt-manager dead 2024’ and quite many search results appeared. Guess that could mean it’s stable..

troubleshooting

journalctl _SYSTEMD_UNIT=libvirtd.service
auvirt --all-events # but it was empty for me at 2024-10-26

libkvm resume

virsh resume win2022-vm - can also put it on cron, which I did

libkvm backups

virsh dumpxml vm_name > /etc/libvirt/qemu/vm_name_backup.xml
virsh domblklist vm_name
virsh backup-begin vm1
virsh event vm1 --event block-job
virsh domjobinfo vm1 --completed

script to do backups:

for vm in $(virsh list --all --name) ; do
echo "$vm:"
virsh dumpxml "$vm" | xmlstarlet sel -t -m '/domain/devices/disk' -m 'source/@*' -v '.' -n
echo
done

reference: 1, 2, 3.

External snapshots are currently half-baked, as per RedHat manual. Internal snapshots are not recommended.

Virt-manager

Quite a useful article on Ubuntu.

sudo apt install virt-manager # on client / admin

On server:

sudo apt install qemu-kvm libvirt-daemon-system
virsh list # ready to use command line interface to libkvm

[!NOTE] VM won’t auto-start by default! That has to be configured manually in VM settings.

To enable copy-paste, Spice tools has to be installed on Windows (ref): https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe

Increase disk size

-1. Shutdown machine -2. sudo qemu-img resize /var/lib/libvirt/images/debian11.qcow2 +20G That’s it!

CPU topology

RedHat doc

Cockpit

Installation (as per ref):

. /etc/os-release
sudo apt install -t ${VERSION_CODENAME}-backports cockpit
systemctl stop cockpit # to stop web service

The remains happens via web console, that is pretty much integrated in / with RedHat’s one. I gave up as of 2024-08-24 - as I need something simple and fast.