Skip to content

Instantly share code, notes, and snippets.

@kurtis318
Created August 17, 2018 20:51
Show Gist options
  • Save kurtis318/54d3f789f40777cb26584f89cba0325a to your computer and use it in GitHub Desktop.
Save kurtis318/54d3f789f40777cb26584f89cba0325a to your computer and use it in GitHub Desktop.
virsh command to get URI of display
REF: https://serverfault.com/questions/334199/how-to-find-which-screen-and-thus-port-the-vnc-ui-for-a-kvm-guest-has-or-how
Using the above site, I was able to come up with the following pipe to show URI display for all KVMs:
[root@kwrlinux2 kurtis] # virsh list|tail -n +3|awk '{print $2;}'|xargs -I {} echo "echo \">>> {}\";virsh domdisplay {}">t.sh; sh ./t.sh
>>> oc74
vnc://127.0.0.1:3
>>> win7
spice://localhost:5904
>>> mint
vnc://127.0.0.1:5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment