virsh – how to get IP of your vm

List all VMs:

uvt-kvm list
webserver-xenial

or

virsh list --all
Id Name State
- webserver-xenial shut off
  1. If you have uvtool installed you can simply run:
uvt-kvm ip NAME_OF_YOUR_VM

uvt-kvm ip webserver-xenial
192.168.122.32

For a virsh command we will have to list our networks first to get name and then check dhcp allocation.

virsh net-list
Name State Autostart Persistent
-------------------------------------------------------
default active yes yes


virsh net-dhcp-leases default
Expiry Time MAC address Protocol IP address Hostname Client ID or DUID
---------------------------------------------------------
2019-02-15 11:56:56 52:54:00:15:c9:40 ipv4 192.168.122.32/24 webserver-xenial

or

virsh net-dhcp-leases $(virsh net-list --name)

should also give you the same result as long as you have only one network in your lab.