Search code examples
androidadbgenymotion

Can not connect to Genymotion ADB


I have 2 machines in the virtual box : Santoku(linux) and device from Genymotion emulator

I want to connect to Genymotion ADB from another machine which is Santoku(linux) in the virtual box.

I made a network in Santoku Machine Bridged but when I make Network in Genymotion in the virtual box as Bridged, it is not working and give me this error:

enter image description here

the android emulator works only if I change the network to host only.

and when I try to connect to adb from Santoku machine it gives me:

unable to connect to 192.56.103:5555 (IP of the android machine)


Solution

  • I think you are mixing up the various networks. Let me explain with images. The Genymotion virtual device has 2 network adapters: a host-only and a NAT or Bridged adapater.

    Adapter 1: enter image description here

    Adapter 2: enter image description here

    The first adapter is used exclusively by Genymotion player to communicate with VirtualBox - the Android OS virtualization is handled by VirtualBox and Genymotion emulates the display via OpenGL translation through this interface. It should not be used by anything else but Genymotion.

    The second adapter is the device network adapter: this is how the virtual device communicate with your local network to reach the internet. It is NAT by default which means that the device network is handled by VirtualBox DHCP. If you set the device network mode to Bridge, then the device network will be handled by your local network DHCP (as on the second screen).

    Communication with the virtual device should be done via the same network as adapter 2. So, the solution is to set your Santoku VM network adapter in Bridge mode and use the same network interface than Genymotion VD adapter 2 (wlo1 in my case):

    enter image description here