How To Get Runnig VM Ip Address in Kvm/Libvirt – POFTUT

How To Get Runnig VM Ip Address in Kvm/Libvirt

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.

LEARN MORE  How To Use Virt-Manager, Libvirt With Normal User Without Root Privileges and Without Asking Password

1 Response

  1. 23/09/2019


Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)