Using Android ADB when LM is a Virtualbox guest

E3V3A
  8 years ago
  2

WIP

Setup: 

Linux Mint 17.3 running as a Virtualbox guest on a Windows machine. The phone is connected to the PC via a USB hub and Virtualbox setting is such that it allows direct connection of Samsung devices.

Pre-requestite:

  1. Installed Android SDK (or Android Studio).
  2. Added the SDK ./platform-tools/ to your PATH.
  3. Added Phone USB to the Virtualbox automatic USB detection filter

  4.  

 

Problem:
There are some peculiarities when trying to connect an Android device in Linux Mint, via adb.

What happens is that although your device is shown in lsusb, but the when running "./adb devices", you will see your device listed, but without permissions. (I.e. "no permission"). The issue goes away when running adb as superuser, but that should not be necessary, nor recommened.

Check your usb devices with:

$ lsusb
Bus 001 Device 003: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 

 

The solution is to add a some new usb device rules under /etc/udev/rules.d/ like this:

sudo gedit /etc/udev/rules.d/51-android.rules

Then add a line with the USB VID (Vendor ID) you found from lsusb like this:

#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0664", GROUP="plugdev"

Save and execute the following:

sudo udevadm control --reload-rules
sudo service udev restart
sudo udevadm trigger
 

Now re-start the adb server, and re-insert the phone. You should now be able to run adb as a normal (non-root) user.

 

A different method for solving this is to edit: ~/.android/adb_usb.ini. As shown here

 

References:

http://stackoverflow.com/questions/14460656/android-debug-bridge-adb-device-no-permissions

http://ptspts.blogspot.com/2011/10/how-to-fix-adb-no-permissions-error-on.html

https://wiki.cyanogenmod.org/w/UDEV

http://stackoverflow.com/questions/32151114/adb-is-not-detecting-my-android-device-on-ubuntu

Comments
Hammer459 8 years ago

Well structured.