virsh – show ip address of all running VMs
2016-02-01
146 words
1 min read
If you are using the libvirt and associated tools, then you must be aware about virt-manager. However this being a GUI tools, it is not possible to always use this. “virsh” is a good option for this.
To start with, if you need to know all the VMs all the running VMs, then you can use (to only view the names):
virsh list --name
Extending this to make it more useful is the case if you need to know the IP address for the running VMs. Here is a simple code that you can put in alias or function that can be used to get the IP address of the running VM’s.
virsh list --name | \ while read line do [[ ! -z $line ]] && virsh domifaddr $line done
Bonus note:
If you want to start the VM, then you can use
virsh start
Related Articles:
- 2015/05/05 docker search description truncated
- 2011/12/22 qemu manager for Windows to run your linux distribution
- 2015/08/27 dnsmasq local name resolution with NetworkManager
- 2015/01/05 apache in docker to serve local website
- 2010/07/18 Try a live Distro without burning on CD or running in VM
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.