How To Get Runnig VM Ip Address in Kvm/Libvirt

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-get-runnig-vm-ip-address-in-kvmlibvirt/
PINTEREST
PINTEREST
INSTAGRAM

There are times when we start virtual machine and want to get ip address quickly without open any GUI or connecting virtual machines console. Here is the tip.

virsh domiflist Command

The magic is that virtual machines interfaces are listed than mac address is grepped. After grepping mac address we are looking our ARP table to find corresponding ip address and put it to the screen. This script will list all interfaces of VM if it has more than one.

As we have provided as script we can use this script like below. We will name script as vm_ip and provide the virtual machine or VM name as parameter. VM name is ubu1 in this example.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-get-runnig-vm-ip-address-in-kvmlibvirt/
PINTEREST
PINTEREST
INSTAGRAM
LEARN MORE  How To Install VMware Tools To The Linux Debian, Ubuntu, Kali, Mint, Fedora, CentOS, RHEL Distributions