Opened 7 years ago
Closed 7 years ago
#17323 closed enhancement (duplicate)
Feature request: Add a way to get VM's IP address through the API without guest additions
Reported by: | MartinDachev | Owned by: | |
---|---|---|---|
Component: | network | Version: | VirtualBox 5.2.0 |
Keywords: | ip address bridged mode main api guest additions | Cc: | |
Guest type: | all | Host type: | all |
Description
I am constantly reading about VirtualBox networking and trying to find a way to get the IP of a VM without installing Guest Additions to it, mainly when using Bridged Networking. From what I have read from the manual - it should be possible with a little tweak.
I work in a project that uses the VirtualBox Main API through the VirtualBox Web Service. I use it to make and configure VMs. The IP needs to be taken automatically, without user interaction and no logging with SSH - because you don't know the IP.
I have read the following from the manual:
"Bridging to a wireless interface is done differently from bridging to a wired interface, because most wireless adapters do not support promiscuous mode. All traffic has to use the MAC address of the host's wireless adapter, and therefore VirtualBox needs to replace the source MAC address in the Ethernet header of an outgoing packet to make sure the reply will be sent to the host interface. When VirtualBox sees an incoming packet with a destination IP address that belongs to one of the virtual machine adapters it replaces the destination MAC address in the Ethernet header with the VM adapter's MAC address and passes it on. VirtualBox examines ARP and DHCP packets in order to learn the IP addresses of virtual machines."
From this statement it looks like VirtualBox already knows the IP address of a VM using Bridged Adapter - yet I haven't found a way to get it without Guest Additions.
w