Mounting Nexus 7 on Ubuntu 12.04 through USB? [duplicate]
Update: The GVFS-MTP module is included in the default installation since 13.04. For troubleshooting see this anwser.
There have been several projects to bring MTP support to Linux during the recent months. Here is a quick overview:
GVFS
The best solution would be to use GVFS via the recently released GVFS-MTP-backend to mount your Android phone. There are two PPAs with a newer GVFS version.
-
ppa:langdalepl/gvfs-mtp
sudo add-apt-repository ppa:langdalepl/gvfs-mtp sudo apt-get update && sudo apt-get dist-upgrade
-
ppa:webupd8team/gvfs-libmtp
sudo add-apt-repository ppa:webupd8team/gvfs-libmtp sudo apt-get update && sudo apt-get dist-upgrade
Source:
- https://linuxundich.de/de/ubuntu/gvfs-update-ermoglicht-unter-ubuntulinux-endlich-den-bequemen-zugriff-auf-android-gerate-via-mtp/
- http://www.webupd8.org/2013/01/upgrade-to-gvfs-with-mtp-support-in.html
go-mtpfs
You could use go-mtpfs to mount your Android phone.
Install needed packages and get the source:
sudo apt-get install golang-go libmtp-dev
sudo go get github.com/hanwen/go-mtpfs
sudo ln /usr/lib/go/bin/go-mtpfs /usr/local/bin/
Add yourself to the group fuse (after that log out and log in again):
sudo adduser $USER fuse
Create a folder for your Android phone and mount it with go-mtpfs into that folder:
mkdir android
go-mtpfs android
Unmout your Android phone (wait for the end of file operations):
fusermount -u android
Source: https://linuxundich.de/de/android/mit-go-mtpfs-unter-linux-auf-android-handys-via-mtp-zugreifen/
jmtpfs
You could use jmtpfs to mount your Android phone.
Download jmtpfs, unpack and change into directory:
cd /tmp
wget http://research.jacquette.com/wp-content/uploads/2012/05/jmtpfs-0.4.tar.gz
tar -xzf jmtpfs-0.4.tar.gz
cd jmtpfs-0.4
Add yourself to the group fuse (after that log out and log in again):
sudo adduser $USER fuse
Install needed packages, compile and install (for checkinstall questions hit enter) jmtpfs:
sudo apt-get install libmtp-dev libfuse-dev libmagic-dev checkinstall build-essential
./configure
make
sudo checkinstall
Create a folder for your Android phone and mount it with jmtpfs into that folder:
mkdir ~/android
jmtpfs ~/android/
Unmout your Android phone (wait for the end of file operations):
fusermount -u ~/android
Source: https://linuxundich.de/de/ubuntu/mit-jmtpfs-mtp-gerate-wie-das-galaxy-nexus-oder-das-samsung-galaxy-siii-in-ubuntu-mounten/
It's not worth it. Use something like SSHDroid and then connect over ssh. There are also FTP servers and even Droid NAS that gives CIFS access. MTP does not work well, and likely will continue to not work well for the near future.
If you really want to get MTP working then make sure you set your Nexus to NEVER lock the screen or power off the screen. Locking the screen with "lock" the MTP protocol as well, causing all manor of data loss and connection issues. Powering off the screen in the stock kernel (might even be hardware) will turn the CPU down as much as it can and enable tons of other strong power saving features, that will result in horrid (but still working) transfers.
MTP is a Microsoft technology and is not officially supported on Linux. I've tried Mtp-Tools many times too, without success. If you consider an alternate method though, I've two recommendations:
- Using FTP, instantiating an FTP server on your tablet via Software Data Cable or other software.
- Using
adb
, which is a tool of Android SDK, to push and pull files from tablets and phones, through USB Debug Mode. To use adb, get it working and runadb push /source/path /destination/path.
Better explanation : http://log.amitshah.net/2012/05/using-adb-to-copy-files-to-from-your-android-device/
This indicates that for Ice Cream Sandwich, Ubuntu file transfer is as simple as ticking the PTP checkbox. In a few seconds you are browsing the filesystem in Nautilus.
Pictures taken directly from: Source