0

I have a linux VM and a genymotion VM on my host. Both have the same network configuration (I set it up myself) which is:

Adapter 1:
  Attached-To: Host-only adapter
  Name: VirtualBox Host-Only Ethernet Adapter
  Advanced:
    Promiscuous Mode: Deny
    Cable connected: yes

Adapter 2:
  Attached-To: NAT
  Advanced:
    Cable connected: yes

Adapter 3:
  Attached-To: Bridged Adapter
  Name: Realtek PCIe GBE Family Controller
  Advanced:
    Promiscuous Mode: Deny
    Cable connected: yes

Adapter 4:
  Attached-To: Bridged Adapter
  Name: TAP-Windows Adpater V9
  Advanced:
    Cable connected: yes

I can adb devices in the host and see:

C:\Program Files\Genymobile\Genymotion\tools>adb devices
List of devices attached
192.168.184.101:5555    device

When I try in my linux guest to adb devicesit shows nothing. If I input adb connect 192.168.184.101 it says connected but it shows offline status. Finally, I can ping my android VM from linux VM successfully.

2 Answers 2

0

since I ran into the same problem I looked deeper in it and found a "ok"-solution.

Basically the point is, that Genymotion automatically connects to the Emulator with the adb from the Windows OS (either Genymotion-Local-adb or installed SDK one in case you provided the path in the settings)

So by starting the emulator, "Windows-ADB" connects to the emulator via the Host-only adapter and 'blocks' the port. When you try to connect, the emulator is already busy and sends the status "offline".

I did not find a solution, how to block adb connection via Genymotion directly, but here is a workaround:

1.) Locate the adb which Genymotion is using (probably in Genymotion/tools or the provided /android-sdk/platform-tools/

2.) Kill the connection on Windows Open a cmd at the folder and interrupt connection:

adb disconnect
adb kill-server

3.) After doing this, you connect to the emulator faster via the vm:

#!/bin/bash

echo ADB Genymotion connect...
./adb disconnect
./adb kill-server
ADBHOST=192.168.1.2 ./adb devices    
echo Done!

after ADBHOST the IP of Genymotion-Emulator. If everything is fine, the device is now 'online' in the VM and 'offline' in windows.

Cheers, hob

UPDATE: Adetutu gives details on step3 which is correct. Thank you!

-1

Hob answer is correct. =Just to correct the script on the VM/guest machine it should be

#!/bin/bash

echo ADB Genymotion connect...
adb disconnect
adb kill-server
ADBHOST=IPofGenyMotiondevice adb devices

echo Done!

=then save as an executable bash file, immediately you kill-server on windows run the bash file in your guest os

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .