Setup network between Host and Android in VM

Discussions related to using VirtualBox on Windows hosts.
Post Reply
YogiYang
Posts: 30
Joined: 27. Mar 2008, 13:50

Setup network between Host and Android in VM

Post by YogiYang »

Hello,

I have created a VM for Android. It is working fine but I am not able to access it from Host.

I want to connect Android VM with my Windows host and connect to a app running in Android.

How can we do this?
Yogi Yang
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Setup network between Host and Android in VM

Post by socratis »

Please read the following: User Manual, ch. 6.2. Introduction to networking modes including the Overview table, which shows quickly what kind of connection is required to achieve what you want.

And remember, you can always have more than one network card in your guest to cover multiple scenarios, although I'm not so sure about Android...

Which Android version do you have, the android-x86 one?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
YogiYang
Posts: 30
Joined: 27. Mar 2008, 13:50

Re: Setup network between Host and Android in VM

Post by YogiYang »

Thanks for the link. I will check it out.
socratis wrote:Which Android version do you have, the android-x86 one?
Yes I am using x86 one.
Yogi Yang
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Setup network between Host and Android in VM

Post by socratis »

I was hoping for more details actually, like the version of the ISO that you used for the installation...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
YogiYang
Posts: 30
Joined: 27. Mar 2008, 13:50

Re: Setup network between Host and Android in VM

Post by YogiYang »

Sorry for the late reply.

I have installed from Android-x86_64-8.1-rc2.iso

I hope this info will help.
Yogi Yang
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Setup network between Host and Android in VM

Post by socratis »

YogiYang wrote:I hope this info will help.
It will help me as far as getting the same VM installed. But it won't help me with the original question, I still need some clarification with that.
YogiYang wrote:I want to connect Android VM with my Windows host and connect to a app running in Android.
  • What exactly does that mean?
  • What app are we talking about?
  • What do you mean "connect to the host"? In what way? Seeing the directory/file structure of the host, or a part of it like Shared Folders?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
YogiYang
Posts: 30
Joined: 27. Mar 2008, 13:50

Re: Setup network between Host and Android in VM

Post by YogiYang »

socratis wrote:
YogiYang wrote:I want to connect Android VM with my Windows host and connect to a app running in Android.
  • What exactly does that mean?
  • What app are we talking about?
  • What do you mean "connect to the host"? In what way? Seeing the directory/file structure of the host, or a part of it like Shared Folders?
I am using a development tool called B4A for building Android apps. This powerful tool provides an Android app called B4A Bridge. Now this B4A Bridge makes it easy for me to build and debug my app on physical device. Provided the development PC and the phone are on the same network.

But instead of using my phone every time, I want to use Android running in a VM. For this I have managed to get Android up and running in virtual Box VM. I have also enabled Developer Mode on Android (which is required for for testing and running debug app on Android).

On a phone when we run B4A Bridge it show the IP address of the phone's network connection.

I also managed to install B4A Bridge on it. But now when I start B4A Bridge it does not show me the IP address of network connection. I need this IP address so that I can configure the B4A IDE to connect to it.

BTW I am not looking to share files between Host and Client Shared Folders.

TIA
Yogi Yang
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Setup network between Host and Android in VM

Post by BillG »

How have you configured the networking for the vm? If the host and guest need to be in the same network you would need to use bridged mode, so that host and guest get their network config from the same DHCP server.

The host is on a LAN with a DHCP server I hope!
Bill
YogiYang
Posts: 30
Joined: 27. Mar 2008, 13:50

Re: Setup network between Host and Android in VM

Post by YogiYang »

Yes the host is on WiFi network with DHCP. Will it do?

In my VirtualBox Network option I have got these many options for Bridge Adopter;
https://ibb.co/QHyGjhz
Which one to use from these many options?
Yogi Yang
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Setup network between Host and Android in VM

Post by BillG »

Wireless is not reliable with bridged networking in VirtualBox. I would choose the Realtek ethernet connection if it is plugged into the LAN.
Bill
YogiYang
Posts: 30
Joined: 27. Mar 2008, 13:50

Re: Setup network between Host and Android in VM

Post by YogiYang »

BillG wrote:Wireless is not reliable with bridged networking in VirtualBox. I would choose the Realtek ethernet connection if it is plugged into the LAN.
My Laptop does not have Ethernet port.
Will have to work a way out for this. Will have to get some kind of USB to Ethernet converter.
Last edited by socratis on 16. Apr 2019, 08:01, edited 1 time in total.
Yogi Yang
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Setup network between Host and Android in VM

Post by socratis »

YogiYang wrote:My Laptop does not have Ethernet port.
I edited your post trying to fix what I thought was a typo, the "not" to "now".

But then I saw the picture that you linked to, and I saw a "Realtek PCIe GBE Family Controller", so I reverted the changes. Can you explain what's going on?

Please edit your post, delete the link and attach the picture here, locally in your response (see the "Upload attachment" tab below the reply form). Not a lot of people will go to 3rd party sites. Plus, it's more convenient if the image goes along with the message...

Image
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply