Comments on How to connect your Android device on Ubuntu Linux

Buying a media device that needs a special driver and/or connectivity suite to navigate and update its contents is a common case nowadays, and has been ever since manufacturers decided that it would be a good idea to just limit the access that users can have on the products that they bought. This may not be a huge problem to Windows and Mac OS users who can simply download the manufacturer's suite and use it to connect to their device, but Linux is often (if not always) left unsupported in that part. The first time I encountered this problem was with the first generation of iPods and Creative Zen players that refused to show any contents on the File Manager when connected via the USB port, and then came the newest generations of Android devices which do the same. In this quick guide, we will see how we can overcome this problem, and connect our media device on our Linux system.

26 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: X

mpt-detect instead of mtp-detect

By: Y

From my experience mtpfs is not fully stable in Linux and mtp per se is not worth any trouble. The best way to access files on an android device from Linux is to install a ssh server app on the device (e.g., SSHelper) and use a ssh client of choice from Linux to access it - it is safe, most gui file managers in Linux can be used as ssh clients, it works over WLAN too no need to phycally connect the device via cable. Whether you trust an android device to be in same WLAN as your Linux box is another topic :).

By: cmcanulty

error on first step

 

cmcanulty@ubuntu1:~$ sudo apt-get install libmtp[sudo] password for cmcanulty: Reading package lists... DoneBuilding dependency tree       Reading state information... DoneE: Unable to locate package libmtpcmcanulty@ubuntu1:~$

By: woo

i gave up on mtp lib a long time ago. It was unusable in ubuntu 12.04 and debian wheezy... instead I use samba shares and the ES File Explorer app on android.

By: proturk

you should give a try to gMTP. its gtk based and will work faster on gnome, xfce, unity.

By: Don Morse

ummmm, what's wrong with simply connecting with a USB cable, making sure the android screen is unlocked.  file manager opens and I've got full access to my Samsung Galaxy 5 as though it was an external drive.  I can play movies from it or even listen to music.  It's also how I back up the device, to my 1Tb external USB drive.  I've been doing this with almost every version of Linux Mint or Ubuntu for several years.

By: Kamil

Problem started with android 6 hiding usb protocol options...

By: Nagy Csaba

Hello!Thanks for the tutorial. I have two question. What is the name of the dock? And how can I do transparnecy the upper tray? 

By: aa

that is plank. he is using elementary OS

By: Michael Ray

ok i have a question im in the process of building a printer and a file server using linux say i need to print from the server how do i get the tablet to communicate with the server

By: Bill Wilken

Thanks for your info, but it doesn't work on 64-bit Ubuntu 16.04.  While it can find the phone, it cannot find any storage information:  See below --

Listing raw device(s)

Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).

   Found 1 device(s):

   Samsung: Galaxy models (MTP) (04e8:6860) @ bus 1, dev 9

Attempting to connect device

LIBMTP ERROR: couldnt parse extension samsung.com/devicestatus:4

Error 1: Get Storage information failed.

Listing File Information on Device with name: SAMSUNG-SM-G920V

LIBMTP_Get_Storage() failed:-1

 

By: Z

I think Y is right. The best way to connect an android device to Ubuntu or whatever other linux distro, is to install a ssh server app and access to it through local ip address using a file manager as a ssh client.

By: Tcll

Heres the problem with libmtp when connecting your phone through usb:1: upon connecting the device, you may be unable to mount it:https://goo.gl/photos/WauNeBhzXK6n3cR78Though this can be worked around by unplugging the device and waiting at least 5 seconds before reconnecting it.5 seconds may fail though, leaving you stuck at the error again, even with 7 seconds...I've found waiting at least 10 seconds guarantees me a successful reconnection.2: once successfully mounted, when performing actions after some time has passed with no activity (perhaps you're writing a comment on a blog post), you may get errors like these:- F5: (after a download because it doesn't auto-update)https://goo.gl/photos/VowrvYnSaxmVLgoPA- cut/paste:https://goo.gl/photos/iPMbALM3fmXshMKq5

sorry for text-links, had to write this post in QuickEdit because it doesn't refresh the page after copying the shared link in G-photos. (PC has no net and I can't teather)

By: tlopez51

Got it working on Debian Jessie and a Samsung On5. Thanks for sharing.

https://wiki.debian.org/mtp

By: John

I need help it says:

PTP_ERROR_IO: failed to open session, trying again after resetting USB interfaceLIBMTP libusb: Attempt to reset deviceLIBMTP PANIC: failed to open session on second attemptUnable to open raw device 0OK.

How do i fix this?

By: Deke

I've been trying to connect an old Lenovo A2109f tablet that's stuck in a loop although, I can boot it into recovery mode. Windows won't look at it even with ADB universal drivers (seems to be a common problem with Lenovo not giving out tablet drivers). So my problem is trying to get Linux to connect with it. It sees the tablet briefly when it goes through its' loop and then shuts down again. How do I get Linux to connect with it in recovery mode? This should be possible, yes?

By: dj--alex

NO WORK . Cannot install . Only mtp-tools  and it not enough

I dont want send every one file by console command. !

Xiaomi redmi 5

 

user@PC1:~$ sudo apt-get install mtpfs?????? ??????? ???????… ???????????????? ?????? ????????????       ?????? ?????????? ? ?????????… ??????E: ?????????? ????? ????? mtpfsuser@PC1:~$ sudo mtpfs -o allow_other ~/mntsudo: mtpfs: ??????? ?? ???????

 

By: Grünbär

Paket libmtp kann nicht gefunden werden.  so what?

By: Grünbär

No raw devices found. and now?

By: V Green

geezaloweeza are you kidding me? all of that to connect my phone to my computer for a transfer?  What a techie wet dream that is.

By: Brad

That is SO true--and well said.

By: CA2020

Hi, unfortunately I get the following error message,

allesgroup@allesgroup-Lenovo-V15-ADA:~$ mtp-connectlibmtp version: 1.1.17Device 0 (VID=22b8 and PID=2e82) is a Motorola Moto G (ID2).error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize deviceNo devices.allesgroup@allesgroup-Lenovo-V15-ADA:~$ mtp-foldersAttempting to connect device(s)Device 0 (VID=22b8 and PID=2e82) is a Motorola Moto G (ID2).mtp-folders: Successfully connectederror returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize deviceUnable to open raw device 0OK.

please if anyone in the community can help me out thanks

 

By: Roger Franz

Doesn't work. Linux doesn't see my Samsung phone. It did at one time, however. But now it does not.

By: R

Where would I find the commands to root/unlock bootloader & re-flash ROM? (using Mint--mate)

By: nmrk.n

Bonjour,

Problèmes :

$ mtp-detect libmtp version: 1.1.18 Listing raw device(s) Device 0 (VID=12d1 and PID=107e) is a Huawei P9 Plus.   Found 1 device(s):   Huawei: P9 Plus (12d1:107e) @ bus 3, dev 93 Attempting to connect device(s) libusb_claim_interface() reports device is busy, likely in use by GVFS or KDE MTP device handling alreadyLIBMTP PANIC: Unable to initialize device Unable to open raw device 0 OK.

$ mtp-connect libmtp version: 1.1.18 Device 0 (VID=12d1 and PID=107e) is a Huawei P9 Plus. libusb_claim_interface() reports device is busy, likely in use by GVFS or KDE MTP device handling alreadyLIBMTP PANIC: Unable to initialize device No devices.

$ mtp-folders Attempting to connect device(s) Device 0 (VID=12d1 and PID=107e) is a Huawei P9 Plus. mtp-folders: Successfully connected libusb_claim_interface() reports device is busy, likely in use by GVFS or KDE MTP device handling alreadyLIBMTP PANIC: Unable to initialize device Unable to open raw device 0 OK. $ mtp-files libmtp version: 1.1.18 Device 0 (VID=12d1 and PID=107e) is a Huawei P9 Plus. mtp-files: Successfully connected libusb_claim_interface() reports device is busy, likely in use by GVFS or KDE MTP device handling alreadyLIBMTP PANIC: Unable to initialize device Unable to open raw device 0 OK. $

Que faire? merci.

By: Timely

It would really help if you would date your tutorial. As other have pointed out, Android connectivity worked great with 4.4 but sucks with 11. No one knows how old your tutorial is, so we don't even know what you're talking about.