Question

List Linux KVM VM IP Address ?

By gabrielturqos ·
How do I find out an IP address of Linux KVM guest from Linux host itself? I wanted to ssh into KVM guest VM. How can I find the IP address of a KVM Virtual Machine Guest on a CentOS Linux 7.x server?
1 total post (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Answers

Collapse -

List Linux KVM VM IP Address ?

by samueltarcin9999 In reply to List Linux KVM VM IP Addr ...

First I want to conguraluce you because using Linux KVM is very technical issue.
#!/bin/bash
VMNAME=$1
for mac in `sudo virsh domiflist $VMNAME |grep -o -E "([0-9a-f]{2}:){5}([0-9a-f]{2})"` ; do arp -e | grep $mac | grep -o -P "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" ; done
(link removed by moderator)

Back to Linux Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums