To find the IP address of a Linux KVM guest virtual machine, you have several options:
- Check the DHCP server logs: If the virtual machine is configured to obtain its IP address from a DHCP server, you can check the DHCP server logs to find the assigned IP address. The location of the logs may vary depending on the DHCP server software used.
- Check the virtual machine’s network configuration: If the virtual machine is using a static IP address, you can check the network configuration files in the virtual machine’s file system to find the IP address. For example, on a Debian-based virtual machine, the IP address is typically configured in the
/etc/network/interfaces
file. - Use the KVM management tool: You can use the KVM management tool, such as
virsh
, to list the virtual machine’s network interfaces and their associated IP addresses. For example, to list the IP addresses of all virtual machines managed by KVM, you can run the following command:
virsh net-dhcp-leases default
Note that the name of the virtual network (default
in this example) may vary depending on your KVM setup. Also, some virtual machines may not have an IP address assigned yet, or may have multiple IP addresses assigned to different network interfaces, so it’s important to check the correct network interface and IP address for your use case.