Mounting Android devices on Ubuntu Mate

Can anyone explain how to mount Android devices on my Ubuntu Mate desktop? I am currently running Ubuntu Mate 15.10 64 bit and I will be upgrading to 16.04 in April.

I have an HTC One phone running Android 5.0.2 and an Amazon Fire HD (2015 model), running Android 5.1.1.

I would like to mount both of these devices on my desktop, though not necessarily at the same time.

I have followed some of the instructions on Ubuntu forums, but I am having limited success.

A guide to the principles would be very useful.

Starting with Android 4.0 Ice Cream Sandwich, the OS switched to MTP from USB Mass Storage mode for access to the device’s storage via USB. MTP stands for Media Transfer Protocol. It works quite well on Windows because I’m sure they developed it. Adopting it for Android, well I think it was a mistake. Last time I tried it, a couple years back, there was some buggy and limited support in Linux provided by a package called mtpfs, you could try it, perhaps it’s been improved.

Ubuntu MATE has everything included, by default, for Android phones to be connected and automatically mounted via USB.

1 Like

I must be doing something wrong then @Wimpy.
When I plug the HTC phone in, it immediately appears in the Computer Window as ‘Android Phone’. However, I keep getting dialog boxes stating ‘Unable to mount HTC Android Phone Couldn’t find matching device’. Then I get loads of activity on my HTC phone, stating ‘USB connected’, ‘USB debugging connected’ and something about ‘Media device [MTP] connected’. On the computer screen I get more dialog boxes stating 'Unable to mount Android Phone Unable to open MTP device ‘[usb:002,081]’. The number after the colon increases by 3 every time this dialog appears. When I clear the dialogs from the computer, the process starts again.

With the Amazon Fire I can’t get the above. Nothing!

I’m obviously missing something.

@quonsar, I’ve tried mtpfs but it seems to crash regularly.

I’ve installed Android Studio on my my desktop computer (Ubuntu Mate 15.10 64 bit) as I want to look at developing apps in Java for Android devices. The problem of attaching my devices is holding me back. Very frustrating.

Hmm. After reading Wimpy's post I dug around to find a USB that fit the phone, which is an older LG G2 running Android 5.02. When the USB notification comes up on the phone, drop down the notification area and tap it. I got radio boxes to choose MTP (Media) or PTP (Pictures). Make sure MTP is selected. After plugging and unplugging the device several times, with the "Can't mount..." errors you described, it finally did mount. Seems pretty fussy though, but as Wimpy said, everything needed is apparently built right into Ubuntu Mate.

The backend might just be a bit buggy, my Nexus 6 (running Android 6.0.1) can occasionally display the message: “Unable to open MTP device…” as soon as it’s plugged in - but it works fine over MTP otherwise.

1 Like

I have a Samsung Note III (carrier free), and it only supports MTP. It’s practically plug&play on Ubuntu-MATE 15.10, never had any problem copying or browsing files.
Never encountered that error either :open_mouth:

Some success!

I found a post on the Ubuntu forums which was very useful. - http://ubuntuforums.org/showthread.php?t=2226702

I followed the various steps and found some of them to be unnecessary.

I didn’t need to install libmtp-common mtp-tools libmtp-dev libmtp-runtime or libmtp9 as my Ubuntu Mate installation already had the latest versions of these.

My version of fuse.conf was already the same as the one recommended in the post on Ubuntu forums.

With the undetected device plugged in, I ran lsusb from a terminal and saw a line representing my HTC One. The line will look something like the following:

Bus 002 Device 004: ID 0bb4:0dea M7_UL [HTC One]

The Bus and Device numbers will depend on the USB bus your device is connected to and the ID numbers, which are in the format Vendor:Device will depend on the actual device. The Vendor 0bb4 is HTC and the device 0dea is the M7_UL [HTC One].

Next thing is to add a line in the file /etc/udev/rules.d/51-android.rules. This will look like the following:

ATTR{idVendor}==“0bb4”, ATTR{idProduct}==“0dea”, MODE==“0666”

The numbers for Vendor and device will differ, depending on the device.

Create a 69-mtp.rules file (or edit it if it already exists). The file should be in /lib/udev/rules.d/69-mtp.rules

Add a couple of lines like the following (again the vendor and device numbers should match your device):
(the first line is simply a comment to remind you what the following line is for

# HTC One M7_UL
ATTR{idVendor}==“0bb4”, ATTR{idProduct}==“0dea”, SYMLINK+=“libmtp-%k”, ENV{ID_MTP_DEVICE}=“1”, ENV{ID_MEDIA_PLAYER}=“1”

Restart to udev service with: sudo service udev restart

When you next connect the device it should show up.

I’ve managed to connected my Amazon Fire HD 8 (2015 edition) also. You just need additional lines in the two files mentioned above.

When the Fire connects, you can either connect in MTP mode or in PTP mode (photographs). This is selected on the Fire screen (pull down from top when you connect).

There is a database of USB ids at http://www.linux-usb.org/usb.ids
If anyone finds devices not already in this database, they should submit them for inclusion.

Hopefully others will find this useful. Thanks to write_mem on Ubuntu forums for the original.

1 Like

Glad to hear it’s working! The large text is caused by the hash character, consider using the code formatting (the code icon) to prevent that. :wink:

Thanks for that Luke. I’m fairly new to this forum format. More used to PHPBB.

For anyone wanting to gain a further understanding of this, I found this article useful though it isn’t particularly geared towards Linux. Nevertheless it offeres a decent description of MTP and PTP:

1 Like

I'm sorry but this solution does NOT work. Ubuntu 19.04 Android rev 8.1.0. Samsung experience 9.5.
kernel vers - 3.18.14-14372886-QB24269775( GCC vers 4.9.x20150123 (prerelease)(GCC)
dpi@SWDH7005#1
fri june 14 15:07:46KST2019BUILD # M1aAQJ27UUES6BSF2

Non-rooted, non-tampered with.

After I executed Steve's instuctions, I get nothing when plugging in the android. A beep on the android but no permissions screen. absolutely nothing on the Mate box.

PS: Everything since about 16.04 has changed. Everything worked so smoothly on that revision. I have almost 2 months wasted in making various things work. This is simply the latest.

In 16.04, any Android device could be plugged in to the computer and it would simply work by popping up a file manager screen. This time, nothing I have in the place that has MPT works. Seems to me like these device-specific patches are simply hacks until the real cause is found.

John

Please forgive me for that idiot trouble i made to myself:
first:
sudo apt-get remove --purge samba smbclient libsmbclient
and than:
sudo apt-get install samba smbclient libsmbclient

and now my 22.04.06 cant mount or at least do not show me my android tablet pluged in usb3 or usb2

please help.

1 Like

Welcome @Zemlyanin to the community!