#!/bin/sh # Stop all running domains and networks, and then stop all libvirtd daemons # Save running domains rundoms="$(virsh list | grep running | awk '{print $2}')" for dom in $rundoms do virsh managedsave $dom done # Stop network virsh net-destroy default # Stop libvirtd sudo systemctl stop libvirtd >/dev/null sudo systemctl stop libvirtd-ro.socket >/dev/null sudo systemctl stop libvirtd-admin.socket >/dev/null sudo systemctl stop libvirtd.socket >/dev/null sudo systemctl stop virtlogd >/dev/null sudo systemctl stop virtlogd-admin.socket >/dev/null sudo systemctl stop virtlogd.socket >/dev/null sudo systemctl stop systemd-machined >/dev/null