Guides tagged “libvirt”

Step-by-step MdmHost guides about libvirt, sorted A-Z.

24 guides · page 1 of 2

  • Back up running KVM VMs with virsh and a simple script

    Back up live KVM virtual machines without downtime using external snapshots and blockcommit, save the XML definition, compress and copy off-host, schedule with cron and restore.

    AdvancedKVM hosts2 min read
  • Create a KVM virtual machine with virt-install

    Use virt-install to create a KVM virtual machine from the command line: choose CPU, RAM and disk, attach an ISO or cloud image, connect a bridge and finish the install over VNC or serial console.

    IntermediateKVM hosts2 min read
  • Create isolated and routed networks in libvirt

    Define libvirt virtual networks beyond the default NAT: isolated networks for private VM traffic, routed networks for extra public subnets, DHCP ranges and static leases, and how to attach VMs.

    IntermediateKVM hosts2 min read
  • Install and use the QEMU guest agent on KVM VMs

    Install qemu-guest-agent on Linux and Windows VMs, add the virtio-serial channel on the host, and use it for clean shutdowns, IP reporting, filesystem freeze for backups and password resets.

    IntermediateKVM hosts and VMs2 min read
  • Install KVM on AlmaLinux or Rocky Linux

    Install KVM on AlmaLinux or Rocky Linux 8/9: check virtualization support, install the virtualization host packages, start libvirt's modular daemons, create a bridge with nmcli and use Cockpit.

    IntermediateAlmaLinux and Rocky Linux servers2 min read
  • Install KVM on Ubuntu Server with libvirt and virt-manager

    Install KVM on Ubuntu step by step: check VT-x/AMD-V support, install QEMU, libvirt and tools, add your user to the right groups, create a network bridge and verify the setup.

    IntermediateUbuntu servers3 min read
  • KVM and libvirt common errors and how to fix them

    Fix the most common KVM and libvirt errors: /dev/kvm missing, permission denied on images, network default not active, domain already exists, failed to connect to the hypervisor and more.

    IntermediateKVM hosts2 min read
  • KVM CPU models explained: host-passthrough, host-model and named models

    Choose the right CPU model for KVM VMs: host-passthrough for maximum features, host-model for balance, named or x86-64-v levels for migration across mixed hardware, and how to check what a guest sees.

    AdvancedKVM hosts2 min read
  • KVM disk performance: cache modes, io modes and iothreads

    Tune KVM virtual disk performance: compare cache=none, writeback and writethrough, io=native, threads and io_uring, add iothreads, enable discard, and measure results with fio.

    AdvancedKVM hosts2 min read
  • KVM live migration with virsh: move running VMs between hosts

    Move a running KVM virtual machine to another host with virsh migrate: shared vs local storage, CPU compatibility, network and SSH requirements, and how to verify and troubleshoot.

    AdvancedKVM hosts2 min read
  • KVM snapshots with virsh: create, revert and delete

    Create, list, revert and delete KVM VM snapshots with virsh, understand internal vs external snapshots, add the guest agent for consistency, and why snapshots are not backups.

    IntermediateKVM hosts2 min read
  • libvirt storage pools explained: dir, logical, netfs, ZFS and RBD

    An overview of libvirt storage pool types for KVM: directory, LVM logical, NFS netfs, iSCSI, ZFS and Ceph RBD, with commands to define, list and manage pools and volumes.

    IntermediateKVM hosts2 min read
  • Manage a remote KVM host with virt-manager or Cockpit

    Manage VMs on a headless KVM server from your desktop: connect virt-manager over SSH, or install Cockpit with the machines plugin for a browser-based UI, and secure both.

    BeginnerKVM hosts2 min read
  • Monitor KVM hosts and VMs with Prometheus and Grafana

    Collect metrics from KVM hypervisors with node_exporter and a libvirt exporter, scrape them with Prometheus, build Grafana dashboards for host and per-VM CPU, memory, disk and network, and add alerts.

    AdvancedKVM hosts2 min read
  • NUMA and virtual machines: keep large VMs fast

    What NUMA is on multi-socket servers, why large VMs slow down when they span NUMA nodes, how to inspect topology with numactl and lscpu, and how to align vCPUs and memory with libvirt.

    AdvancedKVM hosts2 min read
  • Port forwarding to KVM VMs on libvirt's NAT network

    Expose services in KVM VMs behind libvirt's default NAT network: give VMs fixed DHCP addresses, add iptables or nftables DNAT rules, make them persistent with a libvirt hook and test.

    IntermediateKVM hosts3 min read
  • Set up NFS shared storage for KVM hosts

    Export an NFS share from a storage server, mount it on KVM hosts, add it as a libvirt storage pool for VM disks, ISOs and backups, and tune it for live migration and reliability.

    IntermediateKVM hosts2 min read
  • Share host folders with KVM VMs using virtiofs

    Use virtiofs to share a host directory with KVM guests at near-local speed: requirements, enabling shared memory, adding a filesystem device in libvirt, mounting in Linux and Windows, and security notes.

    IntermediateKVM hosts2 min read
  • USB passthrough to KVM VMs with libvirt

    Pass a USB device such as a licence dongle, Zigbee stick or UPS to a KVM virtual machine: find vendor and product IDs, attach by ID or port with virsh, hotplug, and fix common permission issues.

    IntermediateKVM hosts2 min read
  • Use Ceph RBD block storage with libvirt and KVM

    Connect KVM hosts to an existing Ceph cluster: create an RBD pool and client key, store the secret in libvirt, define an RBD storage pool, create VM disks and live migrate without copying data.

    AdvancedKVM hosts with Ceph2 min read

Browse by topic

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.