While developing a new Android app this evening, I came across an annoying problem: I was unable to access my locally-running Rails server from within my new, shiny Genymotion emulator. Using the stock emulator, one could do this by replacing “localhost” with “10.0.2.2,” but this wasn’t working for me with Genymotion.

Long story short, Genymotion is running on Virtualbox, and the default network configuration is “Host-Only.” This method essentially emulates a physical network that is shared by your Genymotion VM (the emulator) and your host machine. The name of the network is vboxnet0, and if you run “ifconfig vboxnet0” (or “ipconfig vboxnet0” if running Windows) on your host machine, you should receive the IP address of your host on the vboxnet0 network. The default IP is most likely 192.168.56.1. This is the IP address to use when accessing your host machine from the Genymotion emulator. For my Rails app, this meant calling “192.168.56.1:3000” instead of “10.0.2.2:3000.”

Hope this helps someone!

(VirtualBox Reference)