Tuesday, 20 August 2013

How to get IP address assigned to VM running in background?

How to get IP address assigned to VM running in background?

I run my Ubuntu instance out of Virtual Box in the background using the
following command:
VBoxManage startvm ${VM_NAME} --type headless
The main difference between that and running it through the GUI is that,
when I am in the GUI after it starts, I can check ifconfig to see what the
IP address is so that I can ssh into it from my terminal on the host and
obviously can't do that in the background.
Assuming a dynamic assignment of IP addresses on the network, is there a
way to extract the assigned IP to the newly created instance for ssh
purposes OR is there a way to ssh into it without knowing the IP (e.g. via
a backdoor port on the host)?

No comments:

Post a Comment