Find the local SPICE/VNC display port of a running KVM virtual machine with virsh.

Virsh: find the display port of a VMSep 13, 2016 PDF

Get the local display port of a VM

List all running VMs:

# virsh list
 Id   Name       State
--------------------------
 1    debian12   running
 4    AGENDA     running

Find the local display port:

# virsh domdisplay --domain debian12
spice://127.0.0.1:5900