QEMU/KVM: Finding VNET Associated with VM

Quick command to list each running VM and the vnet that is associated to the VM

for vm in $(virsh list | grep running | awk '{print $2}'); do echo -n "$vm:"; virsh dumpxml $vm| grep -oP "vnet\d+" ; done

Leave a Reply

Your email address will not be published. Required fields are marked *