How to Connect Your Galaxy Nexus to Ubuntu And Enable File Transfer

While Android is based on the Linux kernel, that doesn’t mean it plays well with Linux distro. If you are a proud owner of the Galaxy Nexus, you will find that it doesn’t come with a micro SD-card slot where you can transfer files to and when you connect your phone to your Ubuntu, it doesn’t show up in the File Manager. In short, you are not able to transfer files into and out from the phone.

Why is this so?

Most older Android phones are using the USB block mode to connect to your computer. In this mode, the computer will see your phone’s SD card as a USB device and mounts it as one. The bad thing about this USB block mode is that once your SD card is mounted in the computer, it won’t be functional in the phone. Any app that depends on the SD card will fail to work during the time when your device is connected to the computer.

The Galaxy Nexus (and several other Android tablets) uses the Media Transfer Protocol (MTP) which has several advantages over the USB block mode. The greatest benefit is that it allows you to use the whole (internal) partition for apps, music, media, photos, etc and not have the hardware manufacturers allocate for you the storage amount for your apps and photos.

Ubuntu doesn’t come pre-installed with support for MTP, that’s why you can’t get your computer to see the phone after you have plugged it into the USB port.

gMTP is a simple MP3 and Media player client for MTP-based device. It provides a GUI for you to mount your Galaxy Nexus and transfer files in/out of it. We will need to compile some code in the process. Follow the steps below and you will be fine.

1. Open a terminal. Install libusb-dev

sudoapt-get install libusb-dev

2. We are going to need a copy of the libmtp file. The version in the Ubuntu repo is outdated, so we need to download the latest version of libmtp here. (For your info, I am using libmtp-1.1.2.tar.gz).

3. Extract the libmtp file to your Home folder. Back to the terminal:

cd libmtp-1.1.2
./configure --prefix=/usr
makesudomakeinstall

This will compile and install the libmtp file.

4. Lastly, install gMTP

sudoapt-get install gmtp

Now, plug in your Galaxy Nexus and open gMTP. Press the Connect button. If successful, you should see the SD card folder of your Galaxy Nexus. You can now transfer files using the Add/Download button.

Note:

1. Even if it is connected in gMTP, your device won’t appear in the File Manager. You can manage your files transfer only in the gMTP GUI.

2. When attempting to download files from your phone, it will return an error saying the file is not found. This is because the default Download path has been to set to “/” (root) and you have no permission to write to the root folder. To change this, simply open the Preferences and change the Download path to “/home/username” or any other path that you desire.

That’s it.

Is this article useful?

Related Ebooks

26 comments

Itlsays

I’ve tried about a half dozen of these G-Nex MTP how-to’s, and none of them work. I end up with stuff like copying a directory, and all the files that were inside it end up outside of it. Then I can’t delete the stuff which copied incorrectly. And that’s If the phone mounts at all. Fortunately There’s FTP servers available for Android. I installed Swift FTP, which once it’s started allows me connect to the phone with Nautilus through my Wifi. I copied over about 25g of music that way.

Somebody needs to fix the MTP thing though. The phone should just show up in the file browser without having to mess around. The Linux community needs set up a system where people can donate money towards solving the problems they run into. When enough money has been donated towards a given problem, some hacker can get the money by solving the problem. Theres a couple of issues which I would gladly donate $100 towards seeing solved.

The gMTP method has been working for me all the while, so I am quite surprised that you can’t get it working. While not as intuitive as the native file manager, the gMTP does get the work done, at least for me.

yeah well, I have had another experience, the goddamn mtpfs, go-mtpfs, gmtp don’t work for me. I’m using an optimus L5 so PTP is out of the question and I’m using a 3G internet dongle so I can’t use the Airdroid or Swift FTP.

Get your shit together Ubuntu, It’s supposed to just work out of the box.

this was very useful – thank you. I do however get the following error message each time I attempt to load a song onto the galaxy: “Error creating or updating album.” I can click ok, and it works fine then, but it seems I’d have to click ok for each of the thousand or so songs I’d like to transfer.

I am getting the same error that TAOCHOK named. Initially the program installed and I had it in the dock but it would not connect to the phone and after a couple of times trying, it would not load at all. I had followed the instructions in this post. I then went into the Ubuntu s/w center and did an auto uninstall, rebooted and installed the program from there. The error remains the same. I am going to have to find someone with a freaking windows install and transfer my music using their machine. This officially sucks. Regardless of how much Google wants me to use their cloud service, this phone NEEDS a microSD slot. That is what stops this from being a perfect device for me.

The problem with these instructions is that you’re compiling a custom version of libmtp, but then installing the Ubuntu version of gmtp, which will pull in the compiled Ubuntu libmtp9 package as a dependency. Who knows which version any given gmtp is invoking?

If you’re going to build libmtp from source, I think you have to build gmtp from source as well, and make sure that the Ubuntu binary libmtp9 package isn’t installed.

First thank you for giving the time to write the article. It was really helpful and I was able to connect to my Samsung Galaxy S3. But connection is WAY too slow every time I click on an item I have to wait for 5 to 20 seconds… Anyway I’m glad I read the comments, I’m going to go for the FTP solution. Again thank you

I’m trying to connect to a Nexus 7 from Ubuntu 12.04. tried gMTP and keep getting the “Failed to get storage parameters from the device – need to disconnect.” message on the last song in an album. gMTP then dies and needs to be re-started. I also cannot copy more than a single album at a time. Major bummer! Is there anything better out there?