Access host from Genymotion emulator

笑着哭i 提交于 2019-11-27 18:20:06

try this ip address: 10.0.3.2 It should work

I had the same problem as OP, switching to Bridged for Adapter 2 rectified the problem for me.

VirtualBox > Settings > Network  > Adaptor 2

Attached to: Bridged Adapter
Name: en0: Wi-Fi (airport)

Try this to verify (works for me)…

On your host start up the simplest web server in some random directory:

$ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 …

Now in your genymotion device startup Chrome and browse to http://192.168.56.1:8000 and you should see a webpage listing the contents of the directory you stared the SimpleHTTPServer in.

This shows that connecting from guest to host on the IP address you indicated works. There must be some other issue.

It's actually really easy to find the IP address of your host!

Linux (and Mac, presumably)

Simply open the Terminal (Ctrl+Alt+T) and run ifconfig. The IP address can be found in the information for an interface named vboxnet<number>.

Windows

Simply open CMD (

+R, "cmd") and run ipconfig. The IP address can be found in the information for an interface with something like 'vbox' or 'VirtualBox' in the name.


There may be more than one interface listed that matches these criteria, so you'll have to try which is the right one.

Even I had the same issue and here is the solution:
Your computer's internet should be "ON" while connecting to database
If you specify port number but don't ON internet, it won't work.
However if you don't specify port number and computer's internet is ON, you should get the output.

Here is the output without internet in one of my program

And here is the output with internet

Also make sure that WIFI is on in the Genymotion emulator and its working. You can check it by opening browser inside emulator and opening any web page address.

Please comment if further help is required.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!