[ubuntu-us-mi] IP address of VM running in bridge mode

Robert Citek robert.citek at gmail.com
Fri Jul 31 05:54:38 BST 2009

On Thu, Jul 30, 2009 at 4:31 PM, Jeff Hanson<jhansonxi at gmail.com> wrote:
> On Thu, Jul 30, 2009 at 4:46 PM, Robert Citek<robert.citek at gmail.com> wrote:
>> Right.  The brute-force method would be to ping the entire subnet and
>> then lookup the MAC in the arp table.  Fortunately, I'm on a class-C
>> subnet so it wouldn't be too big a problem.  But I was hoping for a
>> more general solution that could also be used on a class-A network.

The following worked but I find it rather inelegant:

nmap -p 22 ${netip}/${class} > /dev/null
arp -an | grep -i ${mac}

> You only need to do that if you don't know the guest hostname or don't
> have a (reliable) DNS server.  The MAC of a guest will be in the vmx
> file as "ethernet0.generatedAddress".

Just to clarify, I'm looking for the IP address instead of the MAC
address.  Also, I'm using VirtualBox instead of VMware, which does use
a .vmx file to store its configuration.  With VirtualBox the MAC
address can be discovered by using 'VBoxManage list vms'.

So, my question is, given the MAC address of the guest, does
VirtualBox provide a method to discover the IP address of a guest VM
that is running headless?

- Robert

More information about the ubuntu-us-mi mailing list