How can I show all active leases of a Virtualbox DHCP server?

I'm trying to debug an issue and trying to figure out if a particular Machine of mine even has an IP. How can I show all the leases of a Virtualbox DHCP server? The reason I can't just log into the guest is, that it's a Vulnhub VM. Finding out a way to log into the machine is the whole point of the exercise.


Solution 1:

On Linux :

cat $HOME/Library/VirtualBox/NatNetwork-Dhcpd.leases

On Windows :

%userprofile%\\.VirtualBox\HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter-Dhcpd.leases

This is the file:

<?xml version="1.0"?>
<Leases version="1.0">
...
  <Lease mac="08:00:27:45:fb:92" network="0.0.0.0" state="acked">
    <Address value="10.0.2.15"/>
    <Time issued="1594735097" expiration="600"/>
  </Lease>
...
</Leases>

You can find the mac from vm with vboxmanage showvminfo smp318 | grep MAC

You can list running VM with vboxmanage list runningvms