#!/bin/sh # list vnc display ports for all active VM virsh list --state-running --name | \ while read vm; \ do [ -n "$vm" ] && echo -e "$vm\t$(virsh domdisplay $vm)"; \ done | column -t