You should be able to use https://developer.apple.com/documentation/virtualization/vznetworkdeviceconfiguration/3656653-macaddress?language=objc to get the virtual machine mac address.
You can then parse /var/db/dhcpd_leases and lookup this mac address to find the IP which was assigned to the VM.
Topic:
App & System Services
SubTopic:
Core OS
Tags: