Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What is the correct method to transfer files between Ubuntu running on my Nexus 7 and Ubuntu 12.04 running on my PC using a USB cable?

I am not asking about the Bluetooth or Wifi method for transferring files. I am specifically asking about how to transfer files using a USB cable to mount / auto-mount the connected Nexus 7.

On a side note: I have tried the go-mtpfs method but it does not work when Ubuntu is running on the Nexus 7.

share
1  
This might be duplicate to: askubuntu.com/questions/237664/… askubuntu.com/questions/216246/… –  silentrunner Jan 21 '13 at 8:26

5 Answers 5

One possible solution is using the usbip package. Following link is a tutorial

http://blog.bravi.org/?p=866#more-866

If that works then file on Nexus can be access via scp or even samba.

share
    
As noted by @silentrunner, usbip app is not currently working. (Just confirmed by attempting.) –  david6 Jan 25 '13 at 23:47

I am guessing that this is an mtp problem. I don't have a Nexus but I do have a Samsung Galaxy S3. The problem arises that when you plug in a USB lead and try to view files you can only see the folders - no files. I am guessing that this is the problem you are experiencing.

I would have suggested that you used the go-mtp method, that has proved very successful for me. So, instead you could try the application 'gMTP', from the Ubuntu Software Centre. I had some success with it. It takes a while to operate so be patient when you connect your phone. Start the application first and see what happens.

I wasn't sure what to make of your comment 'when Ubuntu is running on the Nexus 7'. If you are running Ubuntu on the Nexus 7 then, presumably, there is a possibility that the problem you are alluding to might be solved with the forthcoming Ubuntu Phone image for the Nexus in February?

FORGOT TO MENTION: Airdroid - check that out on Google Play and get access to your files via a browser.


Here's a copy of my Tomboy note using the go-mtp method. It may prove useful if it differs from what you have tried previously.

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

nano /etc/fuse.conf Set to:- user_allow_other

sudo apt-get install libmtp-dev git golang mkdir /tmp/go export GOPATH=/tmp/go go get github.com/hanwen/go-mtpfs sudo mv /tmp/go/bin/go-mtpfs /usr/local/sbin/go-mtpfs sudo chmod a+x /usr/local/sbin/go-mtpfs

sudo mkdir /media/s3 sudo chmod 777 /media/s3
(you can change permissions later - just to make sure don't get a permissions problem)


This bit is not really necessary because the info can be gleaned from http://chakra.sourceforge.net/ccr/packages/ud/udev-android-rules/udev-android-rules/51-android.rules Need to get some information about the phone. Can get by starting:- udevadm monitor --environment --udev

Now plug in phone for a few seconds, then unplug. Copy down info.


From: http://chakra.sourceforge.net/ccr/packages/ud/udev-android-rules/udev-android-rules/51-android.rules Get the following:- SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6601", SYMLINK+="android_adb" SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="685d", MODE="0660" SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="68c3", MODE="0660" SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6866", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

Then add to it :- (replace 'brian' with user login)

Google SAMSUNG_Android MTP mode : automatic mount when plugged (all android versions)

ENV{ID_MODEL}=="SAMSUNG_Android", ENV{ID_MODEL_ID}=="6860", ACTION=="add", RUN+="/usr/bin/sudo -u brian /usr/local/sbin/go-mtpfs -allow-other=true /media/s3"

Google SAMSUNG_Android MTP mode : automatic unmount when unplugged (all android versions)

ENV{ID_MODEL}=="SAMSUNG_Android", ENV{ID_MODEL_ID}=="6860", ACTION=="remove", RUN+="/bin/umount /media/s3"

Paste all the above into:- /etc/udev/rules.d/99-android.rules


Now restart udev sudo service udev restart

share

It looks like usbip is broken:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/900384

share

What I understand is, you can connect your Nexus-7 via usb to your PC and you can log in via a Serial Debug Shell according to this page:

https://wiki.ubuntu.com/Nexus7/UsingTheDevice

Further description on that page says "new feature was recently added for 13.04". So I guess just a simple server functionality was added.

In order to send and receive a file you need first a terminal program for serial communication (like screen or GTKTerm) that is able to send and receive files and the functionality has to be added on the server side (what we don't know).

Right now I see only limited opportunity by sending a raw file via GTKTerm that has a content like this:

echo abc > file.txt

in order to create a textfile on the Nexus7. This might could be exended but since there is more functionality added it might be easier to use wifi and nfs.

Update:

I just want to add some comments about this topic. Other answers to this question do not consider that this is a question about connecting two computers both running ubuntu. They are connected via usb while the pc is the host and the Tablet (Nexus 7) is the Device.

There is no networking going between these two machines therefore usbip will definitely not work.

The other two answers might make sense for android on Nexus 7 but not for Ubuntu on Nexus 7.

Probably we will have to continue searching for a proper solution. Does it make sense to think about something like this:

http://ubuntuforums.org/showthread.php?t=1290128

share

Have you tried Adbfs?

From the website;

This variant of adbfs workous even WITHOUT having root access (busybox) on your phone!

Instructions: You will need libfuse-dev. On ubuntu

sudo apt-get install libfuse-dev

Clone the repository

git clone git://github.com/spion/adbfs-rootless.git

cd adbfs-rootless    

Build

make

Copy the binary adbfs to /platform-tools directory. If platform-tools is in your $PATH you can skip this step.

Create a mount point if needed (e.g. in your home directory)

mkdir ~/droid

Before mounting you need to run adb once to make sure that the daemon is started (will be fixed eventually).

From the sdk's platform-tools dir:

./adb shell ls

You can now mount your device (also from the platform-tools dir):

./adbfs ~/droid
share

This site is currently not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .