Enable autostart for running VMs for i in $(virsh list | grep running | awk '{print $2}') do virsh autostart $i done