I am trying to Automate the build and deploy process of a piece of server software we make, this software runs on ubuntu 12.04 but doesn't allow "apt-get" for security reasons.

I have gotten as far as installing the VM using VBoxManage however to run our automated test suit I need the IPV4 Address of said server.

Is there a way to get an IP without using Guest additions eg

VBoxManage guestproperty get <VMNAME> "/VirtualBox/GuestInfo/Net/V4/IP"


EDIT: the use of guestcontrol was suggested as it doesn't need guest additions, however the run subcommand (or execute for pre VirtualBox 5) does require GA installed to function. Using the execute sub command returns

VBoxManage: error: The guest execution service is not ready (yet)

  • how about VBoxManage guestproperty enumerate VM_NAME | grep "Net.*V4.*IP"?
    – ostendali
    Dec 21 '15 at 15:27
  • I tried that earlier, returns nothing. The full enumerate only shows 4 "HostInfo" lines
    – tim
    Dec 21 '15 at 15:29

If you're able to log into the guest, just run ifconfig.

If that isn't possible, try arp -a.

  • As this is part of an automation mannually logging in and entering a command wont work for me. The goal is to get the IP address from a command line that can >> the result of said command to a text file to be read for the automated test suite
    – tim
    Dec 21 '15 at 15:48
  • 2
    Can you give some more information on this automation process then? Also, did you try running arp -a on the machine that hosts said VM? Dec 21 '15 at 15:51
  • using buildbot we create an ISO image of our product, then using a script and VBoxManage I create a custom VM and mount the ISO image which is then installed on the VM. Running arp -a returns the IP but with a "?" for a name rather than a server.domain.com, will that be consistant enough to safely use grep to search for "?" and the IP next to it?
    – tim
    Dec 21 '15 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.