0

I'm trying to get the IP of a guest virtual machine connected to my network with libvirt / kvm bridging. I've come across a couple of resources online, but they seem to be out of date, like this and this.

My understanding of bridged network, at least with VMWare, is that

  • VM's IP address is allocated by dnsmasq or dhcpd, and
  • I can access its IP even with its hostname

Well, with my Debian stable host, I have the bridge created (br0) and have attached eth0 to it, with an IP of 192.168.0.102/24, but my VM's IPv4 Address is 169.254.93.211 (from within the virtual machine, of Red Hat VirtIO Ethernet Adapter), not even on the same network. The VM is using my host IP as its gateway, which look more like NAT or host-based-network to me. The VM's network is working fine though. So,

How to understand the whole situation, and how to access my VM, like to ssh or using its network shares?

UPDATE: Here is my libvirt / kvm bridged network config:

enter image description here

$ apt-cache policy libvirt-daemon libvirt-daemon-config-network
libvirt-daemon:
  Installed: 9.0.0-4
  Candidate: 9.0.0-4
  Version table:
 *** 9.0.0-4 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status
libvirt-daemon-config-network:
  Installed: 9.0.0-4
  Candidate: 9.0.0-4
  Version table:
 *** 9.0.0-4 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm
1
  • Basically linuxconfig.org/… IS the answer, whereas I was missing several steps. I'm no longer able to close/delete this question as there is already an answer. So once again, linuxconfig.org/… is the answer.
    – xpt
    Jul 13, 2023 at 18:04

1 Answer 1

0

The IP address of the VM depends on the configuration of the OS in the VM. The hypervisor (in the narrow sense) has nothing to do with that.

  • You can configure the VM to use DHCP (usually the default).
  • You can configure a static IP manually.
  • 169.254.0.0/16 is the auto IP range (used when no DHCP is available)
3
  • Thanks, please see my libvirt / kvm bridged network config in the updated question. IE, I don't see where else I can configure the VM to use DHCP, and I do have DHCP available on my localnet.
    – xpt
    Jul 12, 2023 at 22:43
  • @xpt Maybe my wording was misleading. You have to configure the OS in the VM. The network configuration is part of the hypervisor. It just enables access to a DHCP server but the VM does have to try on its own to reach a DHCP server. Jul 15, 2023 at 6:02
  • Oh, in that case, I actually believe that configure the OS to negotiate with DHCP server is not necessary, be it a normal one or in a VM, as any OS should be able to do that out of the box, and it is not the problem here, because the VM was already knowing and using my host machine as the DHCP server and its IP as its gateway.
    – xpt
    Jul 15, 2023 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .