Home | News | Download | Packages | Forum | Wiki | Github

Connecting Android devices via USB


I have a phone running Android 5.1 and I’d like to be able to mount it in Void.

I have installed the MTP packages (mtpfs, libmtp, gvfs-mtp, etc.) mentioned as being relevant in the wiki and in the docs for other distros.

mtp-detect finds the phone when it is connected via USB, but it never shows up in file managers (Thunar and spacefm) and all attempts to mount the device fail.

Any ideas what I am doing wrong?


Hello “megaflop”,

I have an Android tablet running Android 4.2, after reading your message I tried to connect my tablet to my Void Linux PC and it works for me.

I precise I ONLY have the “libmtp” package installed (surely installed by default by another package).

When I connect my tablet to my PC (with USB cable) my tablet AUTOMATICALLY DETECTS the connection and there is a BUTTON to ACTIVATE the connection to my PC.

When I click on this button then I can see my tablet in the File-Manager of my PC (for me it’s PCManFM File-Manager).

When I want to deconnect my tablet I MUST unmount my tablet in the File-Manager of my PC and AFTER I can close the connection on my tablet.

It’s important to unmount the tablet BEFORE close the connection.

I run Android 4.2 but I think it could be the same in Android 5.1.
Tell me if I am true.


Hi cr6, thanks for the reply.

I have tried with only libmtp. This was the first thing I tried. Only after that package alone did not work, did I successively install the other MTP related packages. No luck so far.

No such button appears for me.

Void can see the device I’ve connected but fails to do anything useful with it:

$ mtp-detect
libmtp version: 1.1.11

Listing raw device(s)
    Device 0 (VID=22b8 and PID=2e82) is a Motorola Moto G (ID2).
   Found 1 device(s):
   Motorola: Moto G (ID2) (22b8:2e82) @ bus 2, dev 9
Attempting to connect device(s)
libusb_open() failed!: Permission denied
LIBMTP PANIC: Unable to initialize device
Unable to open raw device 0

That is with my non-root user. With root/sudo, the device enumerates a bunch of stuff so it suggests there’s a permissions problem somewhere, but I’m not sure where to look.

Tried PCManFM too just now. Just like Thunar and spacefm, nothing is ever auto-detected.


Aarrfff… :unamused:

I think you must activate something in your phone’s settings…

Can you see something related to “USB” or “connections” in your phone’s settings ?


I have used jmtpfs which worked fine, you need compile it yourself though.


Trying to compile jmtpfs and doing a ./configure it claims I don’t have fuse installed (I do, and it’s version 2.9; this seems to want 2.6, if that’s relevant).

Also helpfully suggests that I adjust the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. I don’t compile stuff that often. Do I just set PKG_CONFIG_PATH in my bash profile or something? And what should it be set to?


On Android it’s in Settings -> Storage -> hamburger icon top right “USB computer connections” -> Connect as Media Device (MTP) and this box is checked. The other option is to connect as a Camera (PTP) [unchecked].


Install gvfs-mtp for MTP and gvfs-libphoto2 for PTP to enable fusermount in pcmanfm and caja.
Check out all gvfs-* packages if your file manager uses gvfs to automount.


I’d kind of like to get manual mounting in the console to work first. That said, I have all the gvfs packages installed and no dice.


you need fuse devel packages


TRY this option why not ?


Same behavior, does not work. Nothing is auto-detected and mtp-detect in console gives:

libmtp version: 1.1.11

Listing raw device(s)
   No raw devices found.

@Nokkasiili: I have the fuse-devel packages installed. No change.


I get same error when i delete fuse-devel package

(Pedro Narciso García Revington) #14

Did you make it work? I’m having the same problem

(4130) #15

i have only gvfs-mtp and libmtp installed, i also do not have fuse-devel installed.

mtp works for me perfectly via Thunar, if anyone would like to see the output of any commands from my machine just let me know.

(Pedro Narciso García Revington) #16

none of the previous solutions worked for me so I tried go-mtpfs which did the job.


Nope. Nothing here worked in my case.

I’ve been using sftp with ES File Explorer (Android file manager app), which isn’t ideal, but it’s adequate as a workaround.

(Bradley) #18

Would love to get this figured out. I’ve gotten myself into a few situations where I took a bunch of pictures that my family members want to see, and I don’t really have a good way to get them off my phone anymore with my main machine running Void…


Not sure if linking to a thread in my inbox will work but let’s find out: https://forum.voidlinux.eu/t/try-my-jmtpfs-package/785?u=megaflop_hobo

@cardinal made a jmtpfs package that I eventually got to work. Not sure what I changed (if anything) but this seemed to work:

I built jmtpfs package, download it here:
32bits: http://www.mediafire.com/download/6r6hxqlpenng7kn/jmtpfs-0.5_1.i686.xbps
64bits: http://www.mediafire.com/download/ba5p5an14sq7jll/jmtpfs-0.5_1.x86_64.xbps1
Installing standalone xbps package requires xdowngrade from xtools package.
xbps-install xtools
xdowngrade jmtpfs-0.5_1.x86_64.xbps
Usage instructions: /usr/share/doc/jmtpfs/README

Make sure your system is updated:

xbps-install -Su

Run these commands on your system to verify the same output I receive:
The current version of libmagic on void repos:
[root@voidlinux rj]# xbps-query -s libmagic
[*] libmagic-5.28_1 File type identification library
[rj@voidlinux void-packages]$ sudo xbps-query -f libmagic
/usr/lib/libmagic.so.1 -> /usr/lib/libmagic.so.1.0.0
[rj@voidlinux void-packages]$ sudo xbps-query -o /usr/lib/libmagic.so.1.0.0
libmagic-5.28_1: /usr/lib/libmagic.so.1.0.0 (regular file)

After you have libmagic-5.28_1 on your system you should be able to install jmtpfs
xdowngrade jmtpfs-0.5_2.x86_64.xbps
If you get the same install error after verifying libmagic-5.28 is installed.
Find the packages that depend on libmagic:
[rj@voidlinux void-packages]$ sudo xbps-query -X libmagic
Remove the listed depends,then remove libmagic.
Install jmtpfs-0.5_2.x86_64.xbps which will auto-install libmagic.
Install previous removed packages that depended on libmagic.

You can also use Samba or SFTP in some file managers for Android to get pictures and files off your phone, as I’ve been doing. Set up a shared folder on your PC and then connect to it with ES File Explorer or similar Android app that supports LAN filesharing.

Another one that’s kind of clunky but works if you only need it once in awhile is called Airdroid. On the desktop side, it runs in a web browser. You navigate to the IP address and port of your phone where the app is running (which the app will tell you) and then you can drag and drop files, etc…