Check VM's IP address from the host

By Fenguoerbian

November 29, 2021

In this post, we talk about how to check the IP address of VM from the host machine.

Guests using NAT

There is a built-in dhcp server in qemu/virtio. And one can check the guests’ IP address from the host machine by running

virsh net-dhcp-leases <network_name>

where the <network_name> is the name of your virtio network, which can be checked by

virsh net-list -all

Guests using bridged network

One can use the tool dhcpdump.

sudo apt install dhcpdump
sudo dhcpdump -i br0

The previous part of IP, and the GIADDR is the ip address of the DHCP server. The latter part of IP, and the YIADDR is the ip address of the guest’s ip address.

Posted on:
November 29, 2021
Length:
1 minute read, 115 words
Tags:
KVM QEMU Virtio NAT bridge
See Also:
Managing QEMU/Libvirt hook scripts
Setting up Intel GVT-g for QEMU/Libvirt VMs
Change virtual disk image