Wednesday, November 21, 2012

So... OK, I got this new Samsung Galaxy SIII and I wanted to explore my files and transfer some music to my phone via USB cable. Apparently, Samsung did some bad magic and by default you are not able to explore your device using MTP in ubuntu (haven't checked in other distros but I've read people had same problem). Since I'm using kUbuntu, opening dolphin explorer mounted my Galaxy S3  as "camera" and I was not able to create/paste any files into it(Unknown error). So after some time googling around, i'm finally able to operate my phone via USB cable and a cool little program. Here's a simple guide what you should do to be able to transfer files to your device.

1. Make sure when connecting your device to Ubuntu via USB cable you select the Media device connection type.

2. Open up the terminal and either use the "sudo" command or just do this as root:
'apt-get update', 'apt-get upgrade' when your update is ready or you have nothing to update check out this:
'apt-cache search libmtp'
 so you see results like this:
libmtp-common - Media Transfer Protocol (MTP) common files
libmtp-dbg - Media Transfer Protocol (MTP) debugging symbols
libmtp-dev - Media Transfer Protocol (MTP) development files
libmtp-doc - Media Transfer Protocol (MTP) library documentation
libmtp-runtime - Media Transfer Protocol (MTP) runtime tools
libmtp9 - Media Transfer Protocol (MTP) library
mtp-tools - Media Transfer Protocol (MTP) library tools
gmtp - simple MP3 player client for MTP based devices
python-pymtp - Pythonic binding to LibMTP to interact with MTP devices

Just to be sure I installed everything without the doc and debug package.
You can do that easily by this command: (copy and paste in your terminal)
sudo apt-get install libmtp-common libmtp-dev libmtp-runtime libmtp9 mtp-tools gmtp python-pymtp

3. Now install one more thingy:
sudo apt-get install libusb-dev

4. Reboot

5. The program you installed in step 2 "gmtp" is the software you will use to transfer files. The trick is: 
launch gmtp (either from Applications-->Multimedia-->gMTP or ALT+F2 "gmtp") now plug in the cable into your device and click "Connect" in gMTP fast. 

6. Give it few seconds to detect the device and select either Phone or SDcard to operate with. 

7. After you have selected the storage to operate with you will view the files like this:

There you have it! I can confirm that this software works. I have transferred my pictures, music and files this way.

I've read somewhere about an application that can do this via wireless (like Kies for windows) but haven't tried it yet. When I do, I will make a tutorial for it as well. 
Hope I've helped you and if you have any questions, please use the comments.

Device: Samsung Galaxy S3
Hardware: Lenovo Z580
OS: Kubuntu 12.04



  1. Replies
    1. Sorry to hear that, I've never used Note2 or any pad with ubuntu. This guide is only tested with Samsung Galaxy S3 smartphone. Although I don't think it should be much different with other android devices. Let me know if you figure it out.

    2. i got gmtp to work on samsung s4. you first have to put the device in developer mode and activate usb debugging and use the usb cable that came with the pone. It wont work with other USB cables. i dont know why. To unlock the Dev Options menu, go to Settings -> About Device and scroll down to the "Build Number." Now, tap on your "Build Number" five times, and you should see a toast notification pop up saying "Developer mode has been enabled." Now go to dev options and enable usb debugging. plug your device in you should get a notification that the device is connected as installer. tap the notification to get to other usb options and select media device (MTP). then start gmtp and click connect. if you have a memory card installed gmtp will give you a choice, sd card or phone. select one. transfer away!

    3. Thanks for the info, Freeride120. Keep helping.

  2. For step 6 it took my computer about a minute rather than a few seconds. I was able to view the file folders and files that I had downloaded via my phone (music, vids, pics), however I could not access my pictures taken via phone camera on the device and therefore couldn't download pics and vids I had taken with my phone. I'm using an HP Pavilion dv6 Notebook PC. An explanation would be most helpful as to why I can't access those files.

    1. Charles, you must do the step for either Phone's memory, or SDcard. Once you selected the target, then you should connect to it and view the files. I have successfully transferred photos, videos and voice memos I've taken with my phone. I might do an updated version of this tutorial as it seems a lot of people are still having problems with ubuntu and android.

    2. It took me a few tries but I eventually got it to work. I never had to select a target on Ubuntu. I'm not sure what the issue was before but it is working now where I can access my files and not just the folders. I'm using Ubuntu 12.04 LTS. Thanks again for your help with the tutorial Joro!

    3. You are very welcome, Charles! I'm so glad that my frustration with this some time ago is helping others now :) Share it so more people can have it fixed as you did. I'm thinking of doing a wireless connection and sync for ubuntu and galaxy s3 very soon. Stay tunded.

  3. hey man , i just ran it on ubuntu 12.04 , and this method aint working, it doesnt detect any devices attached to the computer tho my samsung galaxy s4 is hooked up.Ive done all the steps you stated above but it just not working as it should an error poped up 'Detect:unable to open raw device', not sure whats the problem with it..also the gtmp is force quiting when i hit the connect button.

    1. Hey bro, I haven't played with S4 (this tutorial is confirmed to be working with S3) and *nix. But by the sound of error you're getting it's either ownership problem, locked usb bus or a device rules. Any reason to be with 12.04 (except it's a LTS)?

  4. I can confirm that this method works on the S4 (i9505 XXUBMF5 - rooted). After pressing "Connect" it took several minutes for the "drive selector" to appear, but everything look OK after that.

  5. Thank you Lurifaxe for confirming it.

  6. Thank you so much for posting how to do this! I'm finally able to add files to my Galaxy S4

    1. I'm glad everything is working for you. Spread the word :)

  7. Hello, what about the battery indicator for the galaxy S3 when you connect it to the PC? It would be a nice to have feature like. It works with Iphone!

    1. Oh I'm afraid I can't help you with that. But sure, it sounds nice.

  8. Hi. When I connect my S3 and then click Connect in gmtp (ran from terminal), I see the following in terminal;
    "Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note.
    PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
    LIBMTP libusb: Attempt to reset device"

    It tries to attempt a few times before eventually failing with a pop in gmpt
    "Detect: Unable to open raw device?"

    1. Problem solved. It's an issue with the gvfs packages in Ubuntu 12.04. Just add the backported repo as described at the end of and gmpt works a treat. Thanks very much.

    2. Gled you got it working, Jason.

  9. I've finally made ti, so thanx. But I've had to install manually libusb and gmtp, because the ones from the repositories are outdated. And I've also had to do as freeride120 said: "you first have to put the device in developer mode and activate usb debugging and use the usb cable that came with the pone." My phone is a Samsung S3 Mini and my system is regular ubuntu 12.04.3. Thanks for the tips. I couldn't make it without 'em. Cheers!

    1. I'm very happy you managed to make it work. Keep helping others!

  10. Dear Joro,
    I just installed Ubuntu 13.10. I have a Motorola Moto G with Android 4.3.
    I tried everything but GMTP does not recognize my phone. it just appears: "No device attached".
    When I run in terminal the following command: " sudo mtpfs -o allow_other /media/Moto_G" I get the following messages:
    Unable to open ~/.mtpz-data for reading, MTPZ disabled.Listing raw device(s)
    Device 0 (VID=22b8 and PID=2e76) is UNKNOWN.
    Please report this VID/PID and the device model to the libmtp development team
    Found 1 device(s):
    22b8:2e76 @ bus 2, dev 15
    Attempting to connect device
    Android device detected, assigning default bug flags
    Listing File Information on Device with name: (NULL)

    This tells me that the computer found the phone, correct? But GMTP still does not find it. And when I try to access on Nautilus, it brings me the message: "Error when getting information for file ‘/media/Moto_G’: Transport endpoint is not connected"
    Can anyone help me?

  11. anyone knows if this method works on the Note 3?


Please do not spam. Don't use abusive language.

Subscribe to RSS Feed Follow me on Twitter!