HOW TO ] Mount Nexus 5 in Arch Linux - Nexus 5 General

Heyho, I tried to set up a stable mtp base connection between Manjaro (an arch linux fork) and my nexus 5.
1. simply downloaded and installed libmtp from the official repositories
$ sudo pacman -S libmtp
2. use lsusb (list USB) to find he connected phone after connecting the phone via usb to your pc
$ lsusb
if all is working correct you get something similar like this:
Bus 008 Device 009: ID 18d1:4ee1 Google Inc. Nexus 4 / 10
(don't know why it displays nexus 4, maybe same binaries? - never mind)
18d1 and 4ee1 are important!
3. edit /etc/udev/rules.d/51-android.rules via an editor your choice, e.g.
$ sudo nano /etc/udev/rules.d/51-android.rules
then, use the editor to type in this:
SUBSYSTEM=="usb", ATTR{idVendor}=="[vendorid]", ATTR{idProduct}=="[productid]", MODE="0666", OWNER="[yourusername]"
replace [vendorid] with the value given at 2. (in my case 18d1)
and [productid] also with the value given at 2. (in my case 4ee1)
4. reload the udev interface
$ sudo udevadm control --reload
5. detect the mtp device
$ mtp-detect
6. use thunar file manager to access the nexus 5 storage. unmounted and mounted is automatically be done, so in my case, that's all to get a working connection!
comments and ideas are welcome!

admin, sorry the xda app posted it about 5 times
Sent from my Nexus 5 using XDA Premium 4 mobile app

mtp sucks on linux. used to not working for me, now it is quite ok with crashes sometimes. i prefer using adb push/pull or some other os on virtual machine

I got it mounted on archlinux from AUR repositories just type
Code:
yaourt -S gvfs-mtp-git
thats all

Noob way and much easier xD
gMTP
It s a gui
Inviato dal mio Nexus 5 utilizzando Tapatalk

kylon said:
Noob way and much easier xD
gMTP
It s a gui
Inviato dal mio Nexus 5 utilizzando Tapatalk
Click to expand...
Click to collapse
yes you are right it's on of the most easiest way, but the mtp base used in gmtp, didn't work for me :/ had an connection error everytime I tried to connect :/

Working fine here, maybe your linux box is missing something
Inviato dal mio Nexus 5 utilizzando Tapatalk

Related

[GUIDE] ADB/FASTBOOT Ubuntu Maverick 10.10 (N1 only!)

After searching and having a headache for 5+ hours I wanted to make an easy how to for noobs running ubuntu 10.10.
I found a ton of information on a ton of sites, and after a lot of cross post referencing I finally figured it all out, so I will lay this out in as simple a way possible so nobody has to have the same issues I had.
Pre-requisites: latest android sdk, ubuntu 10.10, general knowlege of linux
Step 1. Obtaining and making fastboot/adb executable
Download THIS package containing the fastboot binary and the 70-android.rules file
extract files anywhere (remember for later use)
copy fastboot binary to your /android-sdk-linux_86/tools/ folder
open terminal and execute
Code:
chmod +x <path to>/android-sdk-linux_86/tools/fastboot
chmod +x <path to>/android-sdk-linux_86/platform-tools/adb
Step 2. Adding your tools and platform tools directories to the path
in teminal execute
Code:
gedit .bashrc
at the end of the file insert
Code:
# enable android tools directories in path
export PATH=${PATH}:~<path to>/android-sdk-linux_86/tools
export PATH=${PATH}:~<path to>/android-sdk-linux_86/platform-tools
Step 3. Getting ubuntu to recognize your phone in adb and fastboot
in terminal execute
Code:
sudo cp <path to>/70-android.rules /etc/udev/rules.d/70-android.rules
sudo chmod a+rx /etc/udev/rules.d/70-android.rules
sudo reboot
Step 4. Make sure it works
after reboot open terminal and execute
Code:
adb devices
as long as it returns a device with HTXXXXXXXXXX you should be golden
There's a typo in the Android SDK paths in your message. You're missing the x in _x86. Was wondering why adb wasn't in my path after I copy pasted that into my .bashrc.
Here's the correct forms.
Code:
chmod +x <path to>/android-sdk-linux_x86/tools/fastboot
chmod +x <path to>/android-sdk-linux_x86/platform-tools/adb
Code:
# enable android tools directories in path
export PATH=${PATH}:~<path to>/android-sdk-linux_x86/tools
export PATH=${PATH}:~<path to>/android-sdk-linux_x86/platform-tools
Another thing that puzzled me was that there appears to be a hard coded username in the udev rules file. Should that be edited too?
Yes, you need to update your udev rules:
http://forum.xda-developers.com/showthread.php?t=640158
I cant seem to find the path to /70-android.rules /etc/udev/rules.d/70-android.rules.
Not sure what you mean?
Try this method
Rogoshin said:
I cant seem to find the path to /70-android.rules /etc/udev/rules.d/70-android.rules.
Click to expand...
Click to collapse
Dude, I put these instructions together sometime in 2010, and should be easy enough to follow. Following all those other instructions used to have me trying for hours to set up adb & fastboot, so when I got a little more familiar with Linux I made my own, with root permissions, so you don't have to sudo anything. You can have adb & fastboot up and running in 5 minutes, if you follow the instructions step by step. http://forum.xda-developers.com/showthread.php?t=820122
blas4me said:
Dude, I put these instructions together sometime in 2010, and should be easy enough to follow. Following all those other instructions used to have me trying for hours to set up adb & fastboot, so when I got a little more familiar with Linux I made my own, with root permissions, so you don't have to sudo anything. You can have adb & fastboot up and running in 5 minutes, if you follow the instructions step by step. http://forum.xda-developers.com/showthread.php?t=820122
Click to expand...
Click to collapse
Well it did not work for me. In step 2 when you have to add auto prompt I get this error "Can't create user application configuration folder /home/rogoshin/.local/share/applications: Not a directory".
What i was looking for is the 70 android rules file.
You create the 70 Android rules file yourself...
danger-rat said:
You create the 70 Android rules file yourself...
Click to expand...
Click to collapse
I thought it was in the link, but the link does not work for me.
If I create the file myself, where do I get the content?
Sendt fra min Galaxy Nexus med Tapatalk
Talderon said:
As stated by DEEsx1 the following is correct:
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
However, it has been a mystery as to why the following location/file does not work for everyone:
Code:
/etc/udev/rules.d/51-android.rules
I am running Ubuntu 9.10 on my laptop with nothing special, just a straight load. the 51-android.rules code did not work for me.
I searched around on a few linux/android forums and found that some people had luck with creating the following file:
Code:
/etc/udev/rules.d/90-android.rules
However, that did not work for me. I had to create the following file:
Code:
/etc/udev/rules.d/99-android.rules
Now, if you are still getting the error, you don't need to reboot, you just need to restart udev:
Code:
sudo /etc/init.d/udev restart
You may also need to restart the adb daemon:
Code:
adb kill-server
adb start-server
adb devices
Now, worse case that I have seen, make sure the phone is not plugged into the computer, reboot the system AND the phone then try again (I have only seen this once).
Hope these tips help!
Click to expand...
Click to collapse
rotohammer said:
Welcome to Linux!
Actually, the more you use it, you'll find that you'll pickup these bits along the way, just like this.
The files are processed in order of their name so 51-xxx is mid-way through, 99-xx is at the tail end of the processing order. Sometimes, the order is important.
Also, after posting the wrong info to you earlier, I deleted the entry I posted. But, it turns out, the Nexus one poses as both id numbers. While in Android its VendorId=18d1, but in the bootloader (waiting in fastboot usb), the VendorId=0bb4.
So, I put both lines in one file today and all is well again.
I.e:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
and I changed my filename to 99-android.rules
then ran:
sudo restart udev
and now I can access the phone as a non root user again, either from adb or fastboot-linux.
Click to expand...
Click to collapse
This should be sufficient...
The auto script creates it for you, but up must have your phone connected for it to add your device id
Sent from my Nexus One using xda premium
blas4me said:
The auto script creates it for you, but up must have your phone connected for it to add your device id
Sent from my Nexus One using xda premium
Click to expand...
Click to collapse
auto script i am not sure i follow
It's a script that automates the process...
danger-rat said:
It's a script that automates the process...[/QUO
Where is this script?
Sendt fra min Galaxy Nexus med Tapatalk
Click to expand...
Click to collapse
The link is in my first post, pay attention!!!!!!!!!!
Sent from my Nexus One using xda premium
blas4me said:
The link is in my first post, pay attention!!!!!!!!!!
Sent from my Nexus One using xda premium
Click to expand...
Click to collapse
After i have completed all the steps, i tried the last command and got "no such command". I tried android rules 99, but maybe with Ubuntu 11.10 i should try a different number.
Sendt fra min Galaxy Nexus med Tapatalk
Try restarting udev, or enter root session on your fs, and make adb and fastboot executables, then restart udev.
Sent from my Nexus One using xda premium
blas4me said:
Try restarting udev, or enter root session on your fs, and make adb and fastboot executables, then restart udev.
Sent from my Nexus One using xda premium
Click to expand...
Click to collapse
This might be the root of the problem, because in usr/local i cant find adb or fastboot.

[GUIDE] How to transfer files in Linux

Now works on 32bit and 64bit Linux
Just a quick guide on how to configure Linux for file transfers using MTP. I wrote the instructions and config for Ubuntu Natty 32bit and 64bit, though the same process will work on other platforms - the only real difference being the package manager commands and possibly the config file locations.
The attached files are for the Galaxy Tab 10.1v but should work for the 10.1g / 10.1 as well. See the end of the post to learn how to modify this config to work for other devices.
How to configure for gMTP and other Media Sync tools
1) Install aptitude
Code:
sudo apt-get install aptitude
2) Install mtp-tools and mtpfs
Code:
sudo aptitude install mtpfs mtp-tools
3) Download the attached file ( View attachment 98-gtab.zip for 32bit Linux or View attachment 98-gtab.rules-AMD64.zip for 64bit Linux ) to your desktop.
4) Extract the 98-gtab.rules file to your desktop
5) Copy the rules file to /etc/udev/rules.d/
Code:
sudo cp ~/Desktop/98-gtab.rules /etc/udev/rules.d
6) Reboot
7) Connect your Tab
8) Run the following command to confirm it is working:
Code:
ls /dev | grep gtab
...which should return "gtab" if successful. If not, follow the "Modifying" guide below.
9) Download / install gMTP
Code:
sudo apt-get install gmtp
10) Open gMTP and select "connect" from the menu
11) Hit the thanks button
12) Go nuts!
Setting up for Automount (Optional, but recommended)
***You must have completed Steps 1-8 above before proceeding***
1) Edit your fstab file to add your gtab:
Code:
sudo gedit /etc/fstab
2) Add this to the end of the file:
Code:
#gtab
mtpfs /media/gtab fuse user,noauto,allow_other 0 0
3) Save and exit
4) Open fuse.conf for editing:
Code:
sudo gedit /etc/fuse.conf
5) Find the following line and remove the #
Code:
#user_allow_other
6) Save and exit
7) Open and edit the groups file:
Code:
sudo gedit /etc/group
8) Find the details for the group 'fuse' and append your username to the end of the line eg.
Code:
fuse:x:104:<YOUR USER NAME>
9) Save and exit
10) Create the folder to mount your Tab:
Code:
sudo mkdir /media/gtab
11) Take ownership of the folder:
Code:
sudo chown <YOUR USER NAME>:users /media/gtab
12) Reboot
13) Plug in your Tab.
14) Click on the Places menu and click gtab.
15) You're in business!
Modifying for other devices
If the above doesn't work immediately on the 10.1g / 10.1 (I have only tested on the 10.1v), you can easily edit the rules file to support your device.
1) Install lsusb
Code:
sudo apt-get install lsusb
2) Run lsusb
Code:
lsusb
3) Check the output of this command to find your device. The 10.1v is shown like this:
Code:
Bus 001 Device 010: ID 04e8:6860 Samsung Electronics Co., Ltd
4) Make a note of the Vendor and Product IDs. In the example above, the vendor ID is 04e8 and device ID is 6860 (note 04e8:6860 in the output).
5) Open the rules file for editing (if it's not already in /etc/udev/rules.d, copy it there now)
Code:
sudo gedit /etc/udev/rules.d/98-gtab.rules
6) Find this line:
Code:
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", MODE="0666" SYMLINK+="gtab"
7) Replace the Vendor ID (04e8) and Product ID (6860) with the ones that you got from step 3 above.
8) Save and exit
9) Reboot
10) Follow step 7 onward in the first guide above
11) Hit the thanks button
If you modify it for a particular device, please post the contents of your new 'rules' file here.
32bit RULES FILE:
Code:
ACTION!="add", GOTO="gtab_rules_end"
SUBSYSTEM!="usb|usb_device", GOTO="gtab_usb_end"
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", MODE="0666" SYMLINK+="gtab"
LABEL="gtab_usb_end"
LABEL="gtab_rules_end"
64bit RULES FILE:
Code:
ACTION!="add", GOTO="gtab_rules_end"
SUBSYSTEM!="usb|usb_device", GOTO="gtab_usb_end"
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", MODE="0777" SYMLINK+="gtab"
LABEL="gtab_usb_end"
LABEL="gtab_rules_end"
Tested, walked through the steps to my friend (Skype ). Works 100% on Linux Mint too
Everything worked for me up to the GMTP part - I can grep through /dev and I can see the "gtab" device there. But GMTP insists "Detect: No raw devices found."
I'm still running Maverick, but I added the maverick-backports repo, which has gmtp, so I would think it would work.
This is a Samsung Galaxy Tab 10.1v (from Google I/O). Any ideas?
EDIT: I also tried the automounting option with FUSE. Attempts to cd into it with bash or open it from the Places menu in GNOME both give the message "Transport endpoint is not connected".
EDIT again:
OK, I disabled USB Debugging and now have a different set of problems. mtp-detect sees the device now, but the message upon running it is:
Code:
libmtp version: 1.0.3
Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Found 1 device(s):
04e8:6860 @ bus 2, dev 26
Attempting to connect device(s)
ignoring usb_claim_interface = -16ignoring usb_claim_interface = -22PTP_ERROR_IO: Trying again after re-initializing USB interface
inep: usb_get_endpoint_status(): Device or resource busy
outep: usb_get_endpoint_status(): Device or resource busy
usb_clear_halt() on IN endpoint: Device or resource busy
usb_clear_halt() on OUT endpoint: Device or resource busy
usb_clear_halt() on INTERRUPT endpoint: Device or resource busy
LIBMTP PANIC: Could not open session! (Return code 767)
Try to reset the device.
Unable to open raw device 0
OK.
Konklone said:
Everything worked for me up to the GMTP part - I can grep through /dev and I can see the "gtab" device there. But GMTP insists "Detect: No raw devices found."
I'm still running Maverick, but I added the maverick-backports repo, which has gmtp, so I would think it would work.
This is a Samsung Galaxy Tab 10.1v (from Google I/O). Any ideas?
EDIT: I also tried the automounting option with FUSE. Attempts to cd into it with bash or open it from the Places menu in GNOME both give the message "Transport endpoint is not connected".
Click to expand...
Click to collapse
Can you post the output from 'lsusb' ?
re the "Transport endpoint is not connected" - I just got this same error on 64bit Natty. Will try and see if I can find out why..
Ah, just saw your reply. I edited my post up above, but the gist is - you can't do this while USB Debugging is enabled. The Tab has to be running its "MTP Application".
Now I'm getting the stranger errors above. I'm going to try mounting it with FUSE now to see if that helps for some reason.
EDIT: For the record, I'm using the correct vendor and product IDs in my rules file:
Code:
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", MODE="0666" SYMLINK+="gtab"
Konklone said:
I edited my post up above, but the gist is - you can't do this while USB Debugging is enabled.
Click to expand...
Click to collapse
You may be right. When I wrote this guide, I was using a VM. It is possible that the fact that I was using both MTP and ADB at the same time has something to do with how VMWare presents the devices to the guest OS.
Now I am using 'bare metal' Natty 64 bit and have the same problem as you.
I have to go out for a while but will look at it again when I get back.
EDIT: Just tried mtp-detect and it is finding the device. I suspect USB Debug is not the issue, but I'll leave it in your capable hands - really got to go now
EDIT2: See here http://www.usb.org/developers/devclass_docs/MTP_1.0.zip OK - Im really REALLY going now. Back online in a few hours
I couldn't get anywhere until I turned off USB debugging. When USB debugging is enabled, I *can* use adb to get into the shell, see files, install apps, etc. I can even transfer files over adb, through the command line! Can you get MTP to detect it with USB debugging enabled?
With USB debugging off, I have once in a great while (only twice in all my attempts) while gotten mtp-detect to connect to the device and print sane output describing the device. Even when those happened, running the command immediately again didn't connect correctly, and gave me the same error messages I was getting before. Both times I got it to connect, it was soon after plugging in the cable, but it doesn't happen every time.
Intermittent heisenbugs are the worst, yet I don't think I have a busted cable, given that adb works perfectly consistently.
Maybe I should try this again after updating to Natty...I'd been meaning to do it anyhow...
EDIT: One thing I notice is that on the Tab, when the "MTP Application" is running after plugging in, the 5-dot "in progress" animation is extremely choppy, as if the device were very very busy. If the device were very very busy for some reason, this could explain why a successful connection can happen only once in a great while. I'll try rebooting the device, I guess.
EDIT2: I rebooted the device, and I removed the USB extension cord I was using, but neither helped, still getting the same intermittent success. (I got mtp-detect to connect to it a few more times - all soon after plugging in the cable, and none were repeatable without unplugging and replugging it in.) The animation actually wasn't choppy before, that's just how it looks - 5 discrete animation frames, one for each dot.
Something interesting though: this time I had the Tab resting on my knee, and I felt a haptic buzz after running mtp-detect on one occasion. I looked down and saw the MTP Application restart itself. Then I ran mtp-detect again and I felt 3 haptic buzzes in quick succession, followed by a successful detection and output. But when running mtp-detect *again*, no dice.
This is messed up.
Messed up indeed.
Konklone said:
Can you get MTP to detect it with USB debugging enabled?
Click to expand...
Click to collapse
Yes, both work simultaneously on 32bit Natty
Note that you have to unmount the gtab for mtp-detect to work. I compared the output from mtp-detect on the 32bit working VM and the 64bit non-working 'bare metal' machine and the output was identical. I suspect this means that mtpfs is not where the problem is
Re the strange problem with haptic feedback - I have had mine power off all by itself when testing some different parameters in the rules file.
[64bit working]
OK. Problem solved... kind of. There seems to be some kind of bug in fuse which requires the filesystem to mount with higher permissions to run properly (at least on Natty AMD64)
If you use the new 64bit rules file I have attached, it should work. Basically it uses 777 permissions instead of 666. Not great, but working nonetheless.
New rules file for 64bit:
Code:
ACTION!="add", GOTO="gtab_rules_end"
SUBSYSTEM!="usb|usb_device", GOTO="gtab_usb_end"
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", MODE="0777" SYMLINK+="gtab"
LABEL="gtab_usb_end"
LABEL="gtab_rules_end"
EDIT: If someone wants to experiment with lesser permissions and see what the minimum is and post back, that would be helpful for all.
Sigh, thank you for taking so much time to help me so far, but I wonder if I'm a lost cause.
I spent a bunch of today finishing my upgrade to Natty, including a full wipe and reinstall. (I have a 32-bit machine, btw.) Now I can't even get it to detect my MTP device at all (mtp-detect says "No raw devices found."), with or without debugging enabled.
One possibly important topic - it's really surprising to me that yours works either way, because lsusb shows that a different product ID is exposed to the host, depending on whether debugging is on or not. With debugging disabled, it's 6860, like your example. With debugging enabled, it's 685e. When I run lsusb, only one of those will show up, never both. So if yours is the same device, I have no idea how your rules file could be agnostic to debugging being enabled. If yours is not, then that might explain our different experiences.
Anyway, I've Thanks'd all your posts in this thread, solved or not. I appreciate your help.
Konklone said:
With debugging enabled, it's 685e. When I run lsusb, only one of those will show up, never both
Click to expand...
Click to collapse
You're more than welcome.
I noticed that in Windows, both devices appear in device manager. That is a very strange problem you have discovered.
I just posted instructions and files to give you root access! Might take your mind off the MTP issues for a while
Who knows... the problem might just go away
Konklone said:
One possibly important topic - it's really surprising to me that yours works either way, because lsusb shows that a different product ID is exposed to the host, depending on whether debugging is on or not. With debugging disabled, it's 6860, like your example. With debugging enabled, it's 685e. help.
Click to expand...
Click to collapse
Are you sure? On my device its the other way around. Without debugging its 685e and with debugging its 6860?
ajvogel said:
Are you sure? On my device its the other way around. Without debugging its 685e and with debugging its 6860?
Click to expand...
Click to collapse
Ok I got it working on my device, I switched on usb debugging in settings. lsusb now returns 6860 and I am able to mount the galaxy tab using the process outlined above.
This is craziness. Is my Galaxy Tab a rare mutant piece of hardware who had its USB numbers switched?
Also - I noticed that Ubuntu somehow automounts my tablet and can read/write to its disk, through a Nautilus plugin. But I still get nothing with mtp-detect. I don't understand how the world works.
I've also got an I/O tablet (updated to 3.1) and I followed this tutorial, so thanks for the help you provided! I managed to copy some files to the device but it ended up freezing my computer (running Ubuntu 10.10).
So I unplugged the tablet, and saw that effectively those few pictures and pdf files had been copied to the device successfully. Pictures are in the Gallery, pdf can be read with Aldiko... but the funny thing is that when I mounted again the tablet -using Ubuntu again- it shows all folders as empty!
That is, 0 files in all tablet folders.
I tried "showing all hidden files" with Nautilus. No luck, nothing is shown. Went to the folder using command line, did an ls -la (just in case who knows! maybe it would show something!). No luck either, directories are apparently empty and have "1 January 1970" as modification date... if it helps.
I can see the files inside the folders using ADB but it's obviously not ideal, specially compared with simply using Nautilus.
Does it happen to you too?
Anyone get this working? I'm having the same exact issues as Konklone. I'm on Maverick and tried the different udev rules and it still doesn't work. I'm gonna be pissed if I have to buy the stupid Samsung USB adapter just to get USB mass storage.
[ASK]Noobs need solution
gMTP tells me that there is no device. Any ideas?
I'm having the same issue. First try I was able to plug in and mount to my netbook. Tried to plug into my mac and it didn't work. Hasn't worked since then, i'm considering doing a factory reset.
I'm running Ubuntu 10.10 64-bit. Note that you do have to enable backports to install gmtp.
Edit /etc/apt/sources.list, uncomment the lines with:
Code:
deb (http-url) maverick-backports main restricted universe multiverse
deb-src (http-url) maverick-backports main restricted universe multiverse
Run
Code:
sudo apt-get update && sudo apt-get install gmtp
I had to unplug the device and replug it back in a couple of times before gmtp would connect to it properly. It seems to be pretty flaky.
Wow...........
This is nonsense ..... is there a way to enable USB Mass Storage or are we completely hosed with MTP?

[HOWTO] Mount Nexus 4 in Linux

You are unable to just plug in your Nexus 4 in Linux but it is very easy to mount and unmount to move data to/from your sdcard. This is one option that will allow you to utilize Nautilis (or any other file browser) to copy files to/from your Nexus 4. This is written for Ubuntu, but should work the same for other Linux systems. Also, this should work for Nexus 7 and 10.
1. Enable Developer options and enable USB debugging.
2. Install necessary modules to your computer:
sudo apt-get install mtp-tools mtpfs
3. Configure 51-android.rules:
sudo gedit /etc/udev/rules.d/51-android.rules
paste the following at the end of the file (if the file does not exist then just paste):
#LG - Nexus 4
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Samsung - Nexus 7 & 10
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
Save and exit.
4. Make the file executable:
sudo chmod +x /etc/udev/rules.d/51-android.rules
5. Restart udev
sudo service udev restart
6. Create mount point and permissions (will need to do this for other Nexus' if using for the 7 or 10)
sudo mkdir /media/nexus4
chmod 755 /media/nexus4
7. Plug in the Nexus 4 and make sure MTP is enabled.
8. Mount with the following command:
sudo mtpfs -o allow_other /media/nexus4
9. When you have completed your work you must unmount:
sudo umount /media/nexus4
Now each time you need to copy from/to your Nexus 4 to your Linux computer you only need to plug in and run 8, then 9 when you have completed your work.
Good info! I'll try it out on my Ubuntu laptop later.
Thanks!
Awesome. Thanks
sent from my straight out of limbo 2 Nexus 4 using XDA-premium
This isn't so much a Nexus 4 guide as a general Linux mounting guide, but still cool. Thanks!
First, thanks to the OP! Just wanted to add another way for linux.
Just install and run gMTP plug your phone in and click connect. It is in the Ubuntu software center or for other versions of linux at http://gmtp.sourceforge.net/
I prefer adb+qtadb. Better speed and stability compared to mtp i think.
Sent from my Blade using xda app-developers app
Thanks for that write up. On my gentoo box my galaxy nexus worked flawlessly but the nexus 4 did not. Hopefully this will do it!
Sent from my Nexus 4 using Tapatalk 2
Kaar3l said:
I prefer adb+qtadb. Better speed and stability compared to mtp i think.
Sent from my Blade using xda app-developers app
Click to expand...
Click to collapse
Yes QtADB works very nicely also. It requires a little more setup than gMTP, but you are correct that it is a little faster and stable.
Kaar3l said:
I prefer adb+qtadb. Better speed and stability compared to mtp i think.
Sent from my Blade using xda app-developers app
Click to expand...
Click to collapse
the3dman said:
Yes QtADB works very nicely also. It requires a little more setup than gMTP, but you are correct that it is a little faster and stable.
Click to expand...
Click to collapse
Never heard of that. What is it?
Generating random authentication keys
---------- Post added at 07:48 AM ---------- Previous post was at 07:47 AM ----------
Konsyst said:
This isn't so much a Nexus 4 guide as a general Linux mounting guide, but still cool. Thanks!
Click to expand...
Click to collapse
Haven't gotten my N4 yet but I'm gonna try this on my sIII.
Generating random authentication keys
Thanks for your work! very useful..!
Konsyst said:
This isn't so much a Nexus 4 guide as a general Linux mounting guide, but still cool. Thanks!
Click to expand...
Click to collapse
Not such a general Linux guide as a Debian-derivative guide.
Helpful nonetheless marty331 for the correct udev strings, thanks!
I personally think using sshfs and sshdroid is a much more stable solution. MTP support on Linux is... shoddy to say the least.
Thanks given anyway though.
It seems that mtpfs 1.1 is broken. I downgraded to 1.0 and it worked. However, there is usually lag for some reason whenever the screen is off.
I had MTP/PTP crash several sdcards of mine which required me to format them (no write permissions had no way to get that back.)
Ever since that I just use ADB (Android Debugging Bridge) there are several GUI front-ends available in the default deb/rpm repositories, or if you are comfortable with the terminal (and with ADB it's really really simple to master) you can just get the binary and put it in your bin folder and transfer it via that. Highly reliable, speed is about 2-3mb/s -- but it works.
I gave up on this on Debian Testing. My Galaxy Nexus would not mount no matter what udev rules I used and mtpfs is not a solution. Instead, I just use a ftp server on the phone and ftp things to it or push things using adb. I've also tried airdroid a few times. I would not mind trying the sshfs alternative either. Gonna check that one out.
jamcar said:
Never heard of that. What is it?
Click to expand...
Click to collapse
QtADB is just a GUI for ADB and it works very well. Search QtADB on Google and you will find the download page with instructions.
Sent from my Nexus 4 using xda app-developers app
OP's use of udev inspired me to come up with this solution using ADB.
I'll assume you have ADB installed. There's plenty of indepth guides for that elsewhere.
This tutorial will have you playing around in system directories on your Linux install. I tried to make this guide user friendly but you should have at least SOME knowledge of Unix like OSes before you even try this.
Not for the faint of heart.
Get http://https://play.google.com/store/apps/details?id=berserker.android.apps.sshdroid&hl=en from the play store. Enable USB debugging in the developer options on your phone.
Open SSHDroid on your phone and set your port to something other than 22. I use 2222.
Open a terminal window on your computer and elevate yourself to root (Preferably using su -. Otherwise use sudo su -.).
Now that we got that done, try logging into your phone to make sure everything works. It'll be something like
Code:
ssh -p2222 [email protected][yourPhone'sIP]
. If you get asked a password it probably works. Just hit ^C (Ctrl+C) to exit that password prompt since we don't need to go further yet.
Next you'll need to create a passwordless SSH login. Run
Code:
ssh-keygen -t rsa
. Just hit enter to use the defaults on all the questions, we don't need anything more.
Now run
Code:
scp -P2222 ~/.ssh/id_rsa.pub [email protected][yourPhone'sIP]:/emulated/storage/legacy/
. When it asks for the password just type "admin", though it should tell you that anyway.
If the file copied over successfully you should no be able to type
Code:
ssh -p2222 [email protected][yourPhone'sIP]
again and not be prompted with a password at all. Cool!
At this point it's recommended you go into the SSHDroid settings on your phone and untick the "Enable Password" box, though it's not required, especially if you want to ssh to your phone from other devices/computers.
Run lsusb and look for the line that says Google in it. You want to look out for something like
Code:
Bus 001 Device 070: ID 18d1:4ee2 Google Inc.
Copy the two alphanumeric codes before "Google Inc.". The first is your vendor ID and the second is your device ID. You might want to label them so you remember which is which.
Here's the scary part of the tutorial. Use your favorite text editor (preferably command line based) and create a new file at "/etc/udev/rules.d/85-android_mount.rules". Copy and paste this and edit to fit the IDs you got in the previous command.
Code:
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee2", RUN+="/usr/local/sbin/phone-mount -m" SYMLINK+="Nexus_4"
SUBSYSTEMS=="usb", ACTION=="remove", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee2", RUN+="/usr/local/sbin/phone-mount -u" SYMLINK+="Nexus_4"
It should be obvious where you need to put your Vendor and Device IDs now.
Save it and run these commands.
Code:
chmod +x /etc/udev/rules.d/85-android_mount.rules
chmod 775 /etc/udev/rules.d/85-android_mount.rules
chown root:root /etc/udev/rules.d/85-android_mount.rules
Now we need to create another file at "/usr/local/sbin/phone-mount" and paste this inside.
Code:
#!/bin/bash
export PATH=/opt/android-sdk-update-manager/platform-tools/:$PATH
case "$1" in
-m )
adb wait-for-device
adb forward tcp:2222 tcp:2222
# If you have SSHDroid Pro you just need to add "pro" to the "sshdroid".
adb shell am broadcast -a berserker.android.apps.sshdroid.command.START
sshfs -p2222 -o allow_other,idmap=user [email protected]:/storage/emulated/legacy/ /media/nexus4
exit 0
;;
-u )
umount /media/nexus4
exit 0
;;
esac
We need to modify the permissions for this file too.
Code:
chmod +x /usr/local/sbin/phone-mount
chmod 775 /usr/local/sbin/phone-mount
chown root:root /usr/local/sbin/phone-mount
Almost done. If you don't already have sshfs installed on your Linux install then do so now. You'll also need to enable the "allow_other" option. For my distro it's as simple as editing "/etc/fuse.conf" and uncommenting the "user_allow_other" line. Your results may vary.
Now finally we need to create the actual folder you'll be mounting your Nexus 4 at. If you blindly followed my guide that'll be /media/nexus4.
Code:
mkdir /media/nexus4
chown root:users /media/nexus4
chmod 775 /media/nexus4
Now all we need to do is restart udev. Right now you'll want to make sure the phone is unplugged, then restart your udev daemon. For Debian based distros like Mint, Ubuntu, Debian, Crunchbang, etc. you'd run.
Code:
service udev restart
After it's done restarting you can plug your phone in, wait a few seconds, and hopefully have your phone automount to /media/nexus4 .
You may have to improvise in a few spots because all distros are not the same, especially when you compare something like Gentoo to Debian. If you're having problems with sshfs chances are your answer is on Google. You'll honestly get better help there than having me trying to guess your system.
Also note this is a pretty hacky and dirty way to do things. Don't go yanking your phone's USB cord out without unmounting "/media/nexus4" first. You shouldn't have any problems if you're not reading or writing anything, but there is the potential for data loss and crashing udev.
i got this error at the last step
Code:
Attempting to connect device
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
fuse: bad mount point `/media/nexus4': Transport endpoint is not connected
i dont have a nexus 4 and im not on linux. but dermann made a script for this i think.
http://forum.xda-developers.com/showthread.php?p=33499930#post33499930
I've been using AirDroid. Works great for transferring files.

[GUIDE] Nexus 7 MTP with Windows XP (File Transfer from/to device)

As you all might know: There is no support for "Mass storage Device"-USB-Protocol
in Nexus devices. So you can't use your device lika a dumb USB Memory-Stick any more.
Now there is the so called MTP (Media Transfer Protocol) as a replacement.
This is also an advantage for the user, as there is no need to 'unmount' the Device-Storage from the
Android-OS to enable the low-block-level-access to the storage.
And: There is no need for a FAT32 Filesystem on any flash-sotrage on the device - so nobody has to pay
any licence-fees to Microsoft *smile*
Unfortunately there is no support out-of-the-box when you use Windows XP.
When you USB-connect your Nexus then Windows find's a MPT-Device but still
is unable to access is. Bump....
Based on the work of http://forum.xda-developers.com/showthread.php?t=1291293 you
need just to add a simple Text-Line in the file C:\WINDOWS\inf\wpdmtp.inf
Change from:
Code:
[Generic.NTx86]
%GenericMTP.DeviceDesc%=MTP, USB\MS_COMP_MTP
to:
Code:
[Generic.NTx86]
%GenericMTP.DeviceDesc%=MTP, USB\MS_COMP_MTP
[B][I]%GenericMTP.DeviceDesc%=MTP, USB\VID_18D1&PID_4E42&MI_00[/I][/B]
(just add one line which identifies the Nexus 7 device on the USB-Bus)
The next time you plug your Nexus 7 answer 'automatic install' if windows asks
you what to do with the new device. And voilà: You see your files in the Windows-File-Explorer.
It worj .thank you very much
Sent from my Nexus 7 using Tapatalk
thank you very much, been trying to fix this problem
I also had to disable USB debugging to get it to work
I'm in the INF folder, what does it mean if i don't have a wpdmtp.inf file in that folder? I'd really like to get me nexus 4 working with WinXP, thanks.
My Nexus 7 no longer connects to my Sony NSZ bluray as a USB storage device. And there is no option to transfer files between the two.
UPDATE: it never connected as USB storage...was thinking of my old Galaxy tab...
You need to install Media Player 10+
shinobi-wan said:
I'm in the INF folder, what does it mean if i don't have a wpdmtp.inf file in that folder? I'd really like to get me nexus 4 working with WinXP, thanks.
Click to expand...
Click to collapse
If wpdmtp.inf doesn’t exist, it means that you don’t have Windows Media Player 10 or above installed. On a fresh Windows XP install, I had to install XP Service Pack 3 and .Net Framework 3.5 so that Windows Media Player would upgrade to 11.
By the way, for Nexus 4 you have to put the Nexus 4-specific hardware ID into wpdmtp.inf. See Nexus 4 wpdmtp.inf. For future devices, probably search for “<device name> wpdmtp.inf” to see what the hardware ID should be.
I didn't have a wpdmtp.inf file in that folder, so updated my Windows media player to version 11 and modified wpdmtp.inf file.
now everytime i connect my Nexus 7 to PC, Windows find's a MPT-Device but still can't install MTP and i got this error:
"An error occured during the installation of the device. A service installation section in this INF is invalid. "
Any help please? Thanks.
You used a device id that matches your device.? If so try rebooting first.
Sent from my Nexus 4 using Tapatalk 2
paiom said:
I didn't have a wpdmtp.inf file in that folder, so updated my Windows media player to version 11 and modified wpdmtp.inf file.
now everytime i connect my Nexus 7 to PC, Windows find's a MPT-Device but still can't install MTP and i got this error:
"An error occured during the installation of the device. A service installation section in this INF is invalid. "
Any help please? Thanks.
Click to expand...
Click to collapse
I know I'm a little late but I have the same problem..
Any fix found yet?
K55V said:
I know I'm a little late but I have the same problem..
Any fix found yet?
Click to expand...
Click to collapse
Yes! I found
issue on my own!!! I use the google toolkit and restored my nexus 7 it was very easy and it works great. Only restored with toolkit that's it and you should be straight. Good luck!!!
Sent from my Nexus 7 using Tapatalk HD
xROID-RAGEx said:
Yes! I found
issue on my own!!! I use the google toolkit and restored my nexus 7 it was very easy and it works great. Only restored with toolkit that's it and you should be straight. Good luck!!!
Sent from my Nexus 7 using Tapatalk HD
Click to expand...
Click to collapse
Google web toolkit?
K55V said:
Google web toolkit?
Click to expand...
Click to collapse
Yes, go to xda
Download Google Nexus 7 Toolkit, check youtube video!!!
Sent from my Nexus 7 using Tapatalk HD
xROID-RAGEx said:
Yes, go to xda
Download Google Nexus 7 Toolkit, check youtube video!!!
Sent from my Nexus 7 using Tapatalk HD
Click to expand...
Click to collapse
Thanks!
I'll try it now
Wow been trying to figure this out for a while, I can't believe it was so simple!
microzee said:
Wow been trying to figure this out for a while, I can't believe it was so simple!
Click to expand...
Click to collapse
Nice huh???
Sent from my Nexus 7 using Tapatalk HD
oli.henning said:
As you all might know: There is no support for "Mass storage Device"-USB-Protocol
in Nexus devices. So you can't use your device lika a dumb USB Memory-Stick any more.
Now there is the so called MTP (Media Transfer Protocol) as a replacement.
This is also an advantage for the user, as there is no need to 'unmount' the Device-Storage from the
Android-OS to enable the low-block-level-access to the storage.
And: There is no need for a FAT32 Filesystem on any flash-sotrage on the device - so nobody has to pay
any licence-fees to Microsoft *smile*
Unfortunately there is no support out-of-the-box when you use Windows XP.
When you USB-connect your Nexus then Windows find's a MPT-Device but still
is unable to access is. Bump....
Based on the work of http://forum.xda-developers.com/showthread.php?t=1291293 you
need just to add a simple Text-Line in the file C:\WINDOWS\inf\wpdmtp.inf
Change from:
Code:
[Generic.NTx86]
%GenericMTP.DeviceDesc%=MTP, USB\MS_COMP_MTP
to:
Code:
[Generic.NTx86]
%GenericMTP.DeviceDesc%=MTP, USB\MS_COMP_MTP
[B][I]%GenericMTP.DeviceDesc%=MTP, USB\VID_18D1&PID_4E42&MI_00[/I][/B]
(just add one line which identifies the Nexus 7 device on the USB-Bus)
The next time you plug your Nexus 7 answer 'automatic install' if windows asks
you what to do with the new device. And voilà: You see your files in the Windows-File-Explorer.
Click to expand...
Click to collapse
You are the man. After several failed attempt trying to have a nexus 7 connected to windows XP, this is what actually worked for me. Adding that just one line did the magic. I'm even able to use the device as a thumb drive by dropping pictures in the DCIM folder and was able to view it in the device gallery.
very good tips and help
i try to detect my nexus 7 in XP for 2 days..you have post the tips who give me help
very nice add in inf file now i can, browse my tablet *
thanks for your help dude
I find that if an XP machine can't read ab MTP device, installing Windows Media Player 11 fixes it. This is true for a Nexus 4 and Nexus 7 in my experience.
Sent from my HTC One using Tapatalk 2
Nexus 7 2013 Instructions
oli.henning said:
As you all might know: There is no support for "Mass storage Device"-USB-Protocol
in Nexus devices. So you can't use your device lika a dumb USB Memory-Stick any more.
Now there is the so called MTP (Media Transfer Protocol) as a replacement.
This is also an advantage for the user, as there is no need to 'unmount' the Device-Storage from the
Android-OS to enable the low-block-level-access to the storage.
And: There is no need for a FAT32 Filesystem on any flash-sotrage on the device - so nobody has to pay
any licence-fees to Microsoft *smile*
Unfortunately there is no support out-of-the-box when you use Windows XP.
When you USB-connect your Nexus then Windows find's a MPT-Device but still
is unable to access is. Bump....
Based on the work of http://forum.xda-developers.com/showthread.php?t=1291293 you
need just to add a simple Text-Line in the file C:\WINDOWS\inf\wpdmtp.inf
Change from:
Code:
[Generic.NTx86]
%GenericMTP.DeviceDesc%=MTP, USB\MS_COMP_MTP
to:
Code:
[Generic.NTx86]
%GenericMTP.DeviceDesc%=MTP, USB\MS_COMP_MTP
[B][I]%GenericMTP.DeviceDesc%=MTP, USB\VID_18D1&PID_4E42&MI_00[/I][/B]
(just add one line which identifies the Nexus 7 device on the USB-Bus)
The next time you plug your Nexus 7 answer 'automatic install' if windows asks
you what to do with the new device. And voilà: You see your files in the Windows-File-Explorer.
Click to expand...
Click to collapse
For those of you who have the Nexus 7 2013 device, the instructions are:
Change from:
Code:
[Generic.NTx86]
%GenericMTP.DeviceDesc%=MTP, USB\MS_COMP_MTP
to:
Code:
[Generic.NTx86]
%GenericMTP.DeviceDesc%=MTP, USB\MS_COMP_MTP
[B][I]%GenericMTP.DeviceDesc%=MTP, USB\VID_18D1&PID_4EE2&MI_00[/I][/B]
The change is in the PID identifier.

Windows terminal not finding adb device

I'm attempting to flash android M on my nexus 6. I've installed the proper drivers from google, after checking in device manager it says the proper drivers are installed. When I enter "adb devices" into the terminal nothing shows up in the list. I've searched through forums and tried the universal adb installer which isn't compatible with Windows8x64, so I used the 15 second installer which worked but didn't change the result. Am I doing anything wrong?
Sent from my Nexus 6 using Tapatalk
semenick96 said:
I'm attempting to flash android M on my nexus 6. I've installed the proper drivers from google, after checking in device manager it says the proper drivers are installed. When I enter "adb devices" into the terminal nothing shows up in the list. I've searched through forums and tried the universal adb installer which isn't compatible with Windows8x64, so I used the 15 second installer which worked but didn't change the result. Am I doing anything wrong?
Sent from my Nexus 6 using Tapatalk
Click to expand...
Click to collapse
Are you using the usb cable that came with your phone? That's the only one that will allow my PC to recognize my N6.
Yes I am
Sent from my Nexus 6 using Tapatalk
I use wug's toolkit which includes easy setup for adb and has worked with both Windows 7 and Windows 10. You might try that.
Otherwise, you didn't say whether your device is recognized by the computer when you plug it in. Windows should recognize and try to install drivers for the device automatically when plugged in via USB. If it's not, there's probably something wrong with the cord you're using. If it is recognized, then it might be the drivers of you might not have debugging enabled on your phone.
Sent from my Nexus 6 using XDA Free mobile app
The computer recognizes the phone and USB debugging is enabled
Sent from my Nexus 6 using Tapatalk
Forget about adb since you don't use it for flashing anyway. Boot into the bootloader.and type "fastboot devices". That's all that matters. Check drivers and device manager in bootloader too.
Uninstall the device if you have to and set up as per my thread.. Nexus 6 general > sticky roll-up thread > adb and fastboot.
danarama said:
Forget about adb since you don't use it for flashing anyway. Boot into the bootloader.and type "fastboot devices". That's all that matters. Check drivers and device manager in bootloader too.
Uninstall the device if you have to and set up as per my thread.. Nexus 6 general > sticky roll-up thread > adb and fastboot.
Click to expand...
Click to collapse
I followed your guide and restarted my windows 8 computer accordingly. When I open the command window and type "fastboot devices" it says that is not recognized as an internal or external command, operable program or batch file
Sent from my Nexus 6 using Tapatalk
semenick96 said:
I followed your guide and restarted my windows 8 computer accordingly. When I open the command window and type "fastboot devices" it says that is not recognized as an internal or external command, operable program or batch file
Sent from my Nexus 6 using Tapatalk
Click to expand...
Click to collapse
That means you didn't do the environment variables correctly or it didn't take after the reboot.
Confirm the location you have fastboot in is the location in environment variables.
danarama said:
That means you didn't do the environment variables correctly or it didn't take after the reboot.
Confirm the location you have fastboot in is the location in environment variables.
Click to expand...
Click to collapse
How do I check the location of fastboot?
Sent from my Nexus 6 using Tapatalk
semenick96 said:
How do I check the location of fastboot?
Sent from my Nexus 6 using Tapatalk
Click to expand...
Click to collapse
What part of my thread did you follow? How did you put fastboot on your.computer?
danarama said:
What part of my thread did you follow? How did you put fastboot on your.computer?
Click to expand...
Click to collapse
Is that the platform-tools? I'm sorry if these are stupid questions! I'm still learning aha
Sent from my Nexus 6 using Tapatalk
semenick96 said:
Is that the platform-tools? I'm sorry if these are stupid questions! I'm still learning aha
Sent from my Nexus 6 using Tapatalk
Click to expand...
Click to collapse
Yes, if you followed my thread and installed the sdk, the fastboot.exe should be in there. The full path is mentioned in my thread. Go.and check that and if it is, go onto the next step about environment variables.. Remember, the variable must be the location of fastboot and MUST start with ;
To be honest, I cheat and simply drop adb and fastboot into c:\windows\system32 as that is already and environment variable.
danarama said:
Yes, if you followed my thread and installed the sdk, the fastboot.exe should be in there. The full path is mentioned in my thread. Go.and check that and if it is, go onto the next step about environment variables.. Remember, the variable must be the location of fastboot and MUST start with ;
To be honest, I cheat and simply drop adb and fastboot into c:\windows\system32 as that is already and environment variable.
Click to expand...
Click to collapse
I redid all of the steps, but my computer is taking a long time to do the restart. Is that normal?
Sent from my Nexus 6 using Tapatalk
semenick96 said:
I redid all of the steps, but my computer is taking a long time to do the restart. Is that normal?
Sent from my Nexus 6 using Tapatalk
Click to expand...
Click to collapse
No.
danarama said:
No.
Click to expand...
Click to collapse
Alright, I'll look into it. Thanks for all the help!
Sent from my Nexus 6 using Tapatalk

Categories

Resources