How to get the IP addresses of VMs in KVM with virsh

When we create VMs in KVM, we may don't know the IP addresses because they are automatically assigned by DHCP. So we want to get them in VMM so that can login by SSH.

asked Sep 27, 2016 by harryxiyou (5,830 points)

1 Answer

 
Best answer

Do the commands as follows.

$ virsh domiflist hvm1
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet0      network    default    virtio      52:54:00:1c:36:cd
$ arp -e
Address                  HWtype  HWaddress           Flags Mask            Iface
10.80.1.17               ether   52:54:00:2b:08:c3   C                     br0
10.80.1.16               ether   52:54:00:78:02:89   C                     br0
10.80.1.18               ether   52:54:00:96:f6:59   C                     br0
kvm2                     ether   52:54:00:ec:31:68   C                     br0
kvm4                     ether   52:54:00:fd:4c:1e   C                     br0
kvm3                     ether   52:54:00:28:dd:2d   C                     br0
10.80.1.15               ether   52:54:00:f9:73:1e   C                     br0
kvm1                             (incomplete)                              br0
10.80.0.1                ether   00:50:56:b4:22:78   C                     br0
192.168.122.210          ether   52:54:00:1c:36:cd   C                     virbr0
10.80.0.11               ether   00:50:56:b4:22:7f   C                     br0

At last, you know the IP address of hvm1 is 192.168.122.210.

answered Sep 27, 2016 by harryxiyou (5,830 points)

Please log in or register to answer this question.

Related questions

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...