Question

I try to connect from my app to host using IP address 192.168.56.1, but without success. I checked in ipconfig and there is a Virtualbox connnection with above mentioned IP. Can someone help to fix it?

Était-ce utile?

La solution

try this ip address: 10.0.3.2 It should work

Autres conseils

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.

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 Output without internet

And here is the output with internet

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.

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 (Windows logo key+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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top