0

How do I get the Ip address of the Android x86 machine from outside Virtualbox/Android console?

I am currently running Android x86 in Virtualbox. Instead of opening the Android console to runifconfig to get the Ip address, I want to be able to get the Ip address of the machine from outside the Android console? I have tried various other methods such as

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

However, no value is set!

I saw other post that recommends setting static Ip address for the machines, but wouldn't you need to reconfigure them again when you switch to a different network? (not very sure about this)

I need the IP address to use adb to connect to the android host machine. Are there any idea or workaround for this?

oJYW
  • 1
  • 3
  • 1
    Did you try https://stackoverflow.com/questions/15251024/adb-virtualbox-connection? – user16967562 May 20 '23 at 07:01
  • ah ok, was stuck at first as I couldn't get any other network config going for android other than bridged adapter but turning off cloudflare seemed to allow android to have network using NAT . After getting it to work on NAT, reading the given post again made me realise port forwarding might be a solution. I am using the command 'VBoxManage modifyvm Android --natpf1 "net1,tcp,,port,,5555" ' to auto assign ports instead. – oJYW Jun 09 '23 at 04:49

0 Answers0