[Asus Transformer TF700] bjtheone:
This guide was created using information taken from:

http://bernaerts.dyndns.org/linux/247-ubuntu-automount-nexus7-mtp

http://www.webupd8.org/2012/12/how-to-mount-android-40-ubuntu-go-mtpfs.html

http://blog.itsbilal.com/index.php/...d-4-0-phonetablet-to-ubuntu-the-reliable-way/

and others. They show you how to determoine all the id information required to set up mtp mounting. This guide will just focus in on what you need to get your Asus TF700 connected.

Background:

Latest Android devices are using 2 different USB connexion modes : PTP and MTP.

With PTP mode, the tablet is seen as a digital camera. This is working Out Of The Box under Ubuntu 12.04. But, you can only access DCIM directory of your device.

With MTP mode, the tablet is seen as a multimedia device where you can access the complete exported filesystem. But it doesn't work Out Of The Box under Ubuntu. It needs some setup and configuration to work.

Note: Gvfs has been updated in Ubuntu 13.04 Raring Ringtail, bringing a new MTP backend which allows users to access Android 4.0 devices which do not support the USB Mass Storage. So this should work out of the box with Raring.

Even if you can access easily a MTP device thru a program called gmtp, it is not as convenient as a conventional USB mass storage, accessible directly from Nautilus.

This guide explains how to configure your Ubuntu computer to directly access your Asus TF700, exported filesystem in MTP mode as soon as you plug it to a USB port.

Thanks to some udev rules, your tablet will automatically mount when device is plugged in & unmount when device is unplugged.

This guide has been done for Asus TF700, but it should work with any other MTP device (Android phone or tablet, MP4 player, ...) if you adapt the Udev rules according to your device.

The Basic steps are:

1) Allow non root users to access root mounted filesystems

2) Install go_mtpfs

3) Configure udev rules to mount and unmount Android filesystems

Configuring FUSE:

Ubuntu doens't allow normal users to access fuse configuration file. This is a bug, which is quite easy to correct by giving read attribute to /etc/fuse.conf.

By default, fuse does not allow mounted filesystems to be accessed by anybody else that the user who has mounted it. As MTP filesystem will be mounted by root to be used by any user, we need to modify fuse default behaviour to allow it. This is configured by uncommenting the user_allow_other key in /etc/fuse.conf.

# sudo chmod a+r /etc/fuse.conf
# sudo gedit /etc/fuse.conf

/etc/fuse.conf

...
# Allow non-root users to specify the 'allow_other' or 'allow_root' mount options.
user_allow_other

Install go-mtpfs:

There are various programs to add support for mtp to Ubuntu. After trying a number of them I have found go-mtpfs works best for me. You certainly could install a different program and just adjust the guide to suit. Go-mtpfs is available in the WebUpd8 Unstable PPA, for Ubuntu 13.04, 12.10 and 12.04. Add the PPA and install it using the following commands:

# sudo add-apt-repository ppa:webupd8team/unstable
# sudo apt-get update
# sudo apt-get install go-mtpfs

If you are not happy with installing prebuild binaries from repositories, you can easily get the source from github and build it yourself. :D

Once that is done you need to create a mount point for your Android filesystems. I have chosen TF700 under /media. This mount point should be accessible by anybody as you will later mount the device using your user account.

# sudo mkdir /media/TF700
# sudo chmod 777 /media/TF700

Add the udev rules:

This is the core of making the auto mounting work. The first link I reference has all the information on how you discover the Vendor and Product ids. While it is interesting reading, I have just skipped over all that and supplied the TF700 specific values. If you are trying to setup another device you WILL NEED TO read it and get the appropriate values, as they are device specific.

# sudo gedit /etc/udev/rules.d/51-android.rules

# Asus TF700
SUBSYSTEM=="usb", SYSFS{idVendor}=="0b05", ATTR{idProduct}=="4c91", MODE="0666" #MTP media, USB debug on

# Asus TF700 MTP mode under JB 4.2+ : automatic mount & umount when plugged (USB debug on & off)
ENV{ID_MODEL}=="ASUS_Transformer_Pad_TF700T", ENV{ID_MODEL_ID}=="4c91", ACTION=="add", RUN+="/usr/bin/sudo -b -u YOUR_LOGIN /usr/bin/go-mtpfs -allow-other=true /media/TF700"
ENV{ID_MODEL}=="ASUS_Transformer_Pad_TF700T", ENV{ID_MODEL_ID}=="4c91", ACTION=="remove", RUN+="/bin/umount /media/TF700"

You need to change "YOUR_LOGIN" to your username.

Last thing is to restart udev for the new rules to become operationnal.

# sudo service udev restart

Declaration in /etc/fstab:

At this stage, you are able to automatically mount and unmount your TF700. Your device should appear after few seconds in Nautilus computer section.

You can now browse your device straight from Nautilus. You can copy files from and to your TF700, you can rename files, ...

You have to know that you will face some limitations as MTP is not a real filesystem protocol :

* you can not copy files bigger than 2 Gb,

* you can not create empty files,

* you can not move file within the phone with drag & drop

* you cannot open files in write mode directly from TF700

Another problem is that you can not unmount your TF700 straight from Nautilus. If you click on the Eject button, you will get an error message saying :

umount: /media/TF700 is not in the fstab (and you are not root)

To solve that, it has to be declared in /etc/fstab with its fuse caracteristics.

As /etc/fstab is using SPACE as a separator and as our TF700 fuse caracteristics include SPACE caracter, we have to convert them to its octal escape code \040.

# sudo gedit /etc/fstab

/etc/fstab

...
DeviceFs(ASUS\040Transf) /media/TF700 fuse.DeviceFs(ASUS\040Transf) allow_other,rw,user,noauto 0 0

When you will remount it in MTP mode, your TF700 will be seen as a device. In Nautilus, it appears in the device section and you are now able to Eject it ...