|Samsung Galaxy Nexus USB computer connection settings|
When an Android is connected to Ubuntu Linux through Media Transfer Protocol (MTP), Ubuntu will try to mount the Android using gvfs through gphoto2 but because gvfs does not have native support for MTP yet, it doesn't always work properly. You will probably see this error whenever you try to browse the Android device (that seems like it mounted) from Nautilus:
"Sorry, could not display all the contents of "Android": Timeout was reached"When it did work, it work very sluggishly and unreliably.
An alternative is to use mtpfs but that too has been reported unstable lately. Because of this, a Google employee created his own mtpfs called go-mtpfs. I tried go-mtpfs and it works great and fast too.
This is how you can setup your Ubuntu 12.04 LTS to connect your Samsung Galaxy Nexus using MTP:
- Run this commands to install go-mtpfs
sudo add-apt-repository ppa:webupd8team/unstable
sudo apt-get update
sudo apt-get install go-mtpfs
- Configure fuse
sudo chmod a+r /etc/fuse.conf
sudo gedit /etc/fuse.conf
- Un-comment the user_allow_other line in the file. This is to allow Ubuntu to allow non-root users to use fuse to mount the MTP filesystem. This is how the line look like in the file:
# Allow non-root users to specify the 'allow_other' or 'allow_root' mount options.
- To mount, use this command line:
- To unmount, use this command line:
fusermount -u /media/MyAndroid
- Create a mount point
sudo mkdir /media/GalaxyNexus
sudo chmod 777 /media/GalaxyNexus
- Run udev monitoring to get device information
udevadm monitor --environment --udev
- Set your Samsung Galaxy Nexus in MTP mode.
- Plug in your Samsung Galaxy Nexus.
- Wait for a few seconds or until the monitor produce some results when the device is plugged in.
- Un-plug your Samsung Galaxy Nexus.
- You will get results that look like this:
- Create a udev rules file.
sudo gedit /etc/udev/rules.d/99-android.rules &
- Replace all the fields highlighted in red with the values that you get from your Samsung Galaxy Nexus udev values. Take note of the values highlighted in yellow.
- Restart the udev service.
sudo service udev restart
- You can now plug in your Samsung Galaxy Nexus and your Ubuntu 12.04 LTS will auto mount. To unmount, just unplug your Samsung Galaxy Nexus.
To make life easier without using command line, Andrew from WEB UPD8 that helped package go-mtpfs for this installation also wrote a custom Unity-launcher script to mount and unmount.
- To get this custom Unity-launcher script, run this command to install:
sudo apt-get install go-mtpfs-unity
- Search your Dash Home for "Mount Android" and drag the icon to the Unity launcher.
- Right click it for selections of to mount or unmount.
- File copy is limited to 2GB in size.
- Empty file creation is not allowed.