Device not listed by adb devices on a virtual machine guest
Device not listed by adb devices on a virtual machine guest
Why is my android phone not listed by adb devices?
adb devices
I followed instructions described at https://developer.android.com/studio/run/device but ADB still doesn't find my device.
My user is already member of plugdev group. I also have tried to kill and restart the adb server.
plugdev
adb
I'm running Debian Stretch in a VirtualBox machine. Debian can see my device but adb can't.
adb
eduardo@debian:~$ lsusb
Bus 001 Device 002: ID 1004:633e LG Electronics, Inc. GZ Android Phone [MTP mode]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 8oee:0021 VirtualBox USB Tablet
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
eduardo@debian:~$ ls -l /etc/udev/rules.d/51-android.rules
-rw-r-r- 1 root root 4611 Sep 5 15:25 /etc/udev/rules.d/51-android.rules
eduardo@debian:~$ grep 1004 /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTRfidVendor1=="1004", MODE="0666", GROUP="p1ugdev"
eduardo@debian:~$ adb devices
List of devices attached
eduardo@debian:~$
Debug mode is enabled. Rebooted device and host machine. Still doesn't list.
– Eduardo
Sep 5 '18 at 19:28
I'm not sure ADB works within a VM, even if the device is seen.
– TheWanderer
Sep 5 '18 at 21:54
please do not use screen shots of text
– Alex P.
Sep 5 '18 at 23:34
@AlexP. Ok. Removed.
– Eduardo
Sep 6 '18 at 2:10
3 Answers
3
The easy way to use adb in a virtualized environment regardless of the specific platforms is to run adb server on the host as a remote system and run adb clients inside the guest systems. See my answer to another question here .
adb
adb server
adb
While it is possible to run both the server and the clients completely inside of guest system, to do so reliably usually involves passing through the whole USB controller into the guest system.
I made a workaround that solved my problem. It is not perfect but it works.
adb devices
In the virtual machine make a tcp tunnel that redirects local port 5037 to the host machine 5037 port:
ssh -L 5037:10.0.2.2:5037 localhost -N -f
ssh -L 5037:10.0.2.2:5037 localhost -N -f
I'm not going to mark this as the correct answer because my Guest ADB still doesn't see my device
My host machine is Windows. ADB works fine there.
– Eduardo
Sep 5 '18 at 22:03
It worked when I changed my device USB to charge only mode.
Reference: https://askubuntu.com/a/632668
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Did you enable developer options and enable debug mode on your device?
– MidasLefko
Sep 5 '18 at 19:02