When attaching an Android device to a Linux machine, you may see a popup with the message:
Unable to open MTP device "001,104"
The numbers may vary depending upon device and port:
# tail -f /var/log/kern.log
May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.564694] usb 1-1: new high-speed USB device number 105 using xhci_hcd
May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714863] usb 1-1: New USB device found, idVendor=18d1, idProduct=4ee1, bcdDevice= 2.23
May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714865] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714866] usb 1-1: Product: Nexus 6
May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714867] usb 1-1: Manufacturer: motorola
May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714868] usb 1-1: SerialNumber: ZX1G22MGK2
Further diagnostics generate:
# mtp-detect
libmtp version: 1.1.17
Listing raw device(s)
No raw devices found.
root@nuc8i7hvk01:/home/rpb# mtp-detect
libmtp version: 1.1.17
Listing raw device(s)
Device 0 (VID=18d1 and PID=4ee1) is a Google Inc Nexus/Pixel (MTP).
Found 1 device(s):
Google Inc: Nexus/Pixel (MTP) (18d1:4ee1) @ bus 1, dev 103
Attempting to connect device(s)
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
Unable to open raw device 0
OK.
On my system, the culprit is the gvfs filesystem packages:
# dpkg -l |grep gvfs
ii gvfs:amd64 1.46.2-1 amd64 userspace virtual filesystem - GIO module
ii gvfs-backends 1.46.2-1 amd64 userspace virtual filesystem - backends
ii gvfs-common 1.46.2-1 all userspace virtual filesystem - common data files
ii gvfs-daemons 1.46.2-1 amd64 userspace virtual filesystem - servers
ii gvfs-fuse 1.46.2-1 amd64 userspace virtual filesystem - fuse server
ii gvfs-libs:amd64 1.46.2-1 amd64 userspace virtual filesystem - private libraries
# systemctl |grep gvfs
run-user-1000-gvfs.mount loaded active mounted /run/user/1000/gvfs
# ps aux |grep gvfs
rpb 1886 0.0 0.0 241436 4036 ? Ssl Mar29 0:00 /usr/libexec/gvfsd
rpb 1891 0.0 0.0 753756 3364 ? Sl Mar29 0:26 /usr/libexec/gvfsd-fuse /run/user/1000/gvfs -f
rpb 2009 0.0 0.0 501008 4632 ? Ssl Mar29 0:00 /usr/libexec/gvfs-udisks2-volume-monitor
rpb 2041 0.0 0.0 237900 4828 ? Ssl Mar29 0:00 /usr/libexec/gvfs-mtp-volume-monitor
rpb 2061 0.0 0.0 239776 3052 ? Ssl Mar29 0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
rpb 2069 0.0 0.0 237500 3052 ? Ssl Mar29 0:00 /usr/libexec/gvfs-goa-volume-monitor
rpb 2073 0.0 0.0 315992 3160 ? Ssl Mar29 0:41 /usr/libexec/gvfs-afc-volume-monitor
rpb 2135 0.0 0.0 391244 6824 ? Sl Mar29 0:02 /usr/libexec/gvfsd-trash --spawner :1.8 /org/gtk/gvfs/exec_spaw/0
rpb 178920 0.0 0.0 315892 3956 ? Sl Mar30 0:01 /usr/libexec/gvfsd-network --spawner :1.8 /org/gtk/gvfs/exec_spaw/1
rpb 178946 0.0 0.0 317528 3172 ? Sl Mar30 0:01 /usr/libexec/gvfsd-dnssd --spawner :1.8 /org/gtk/gvfs/exec_spaw/3
rpb 179014 0.0 0.0 206540 5372 ? Ssl Mar30 1:29 /usr/libexec/gvfsd-metadata
The file browser known as pcmanfs does not seem to be able to access the filesystem
Solution: Dolphin, as a substitute for Nautilus, can be used to access the virtual filesystems.
The command gio can be used to access the file system:
# gio
Usage:
gio COMMAND [ARGS…]
Commands:
help Print help
version Print version
cat Concatenate files to standard output
copy Copy one or more files
info Show information about locations
list List the contents of locations
mime Get or set the handler for a mimetype
mkdir Create directories
monitor Monitor files and directories for changes
mount Mount or unmount the locations
move Move one or more files
open Open files with the default application
rename Rename a file
remove Delete one or more files
save Read from standard input and save
set Set a file attribute
trash Move files or directories to the trash
tree Lists the contents of locations in a tree
Use “gio help COMMAND” to get detailed help.
Background info via Wikipedia, which comes with a set of back-ends, including trash support, SFTP, FTP, WebDAV, SMB, and local data via Udev integration, OBEX, MTP and others.
- Don't know why this has to be so difficult on Debian, why all the competing applications which lock each other out?
- Remember: on Android, once connected, select transfer files
- May need to open a new dolphin window to actually get at the files
- And then in Dolphin, the actual right-click/copy/paste doesn't actually work -- need to load a file and then save it.... just painful .. I hope other's experience is less painful ... maybe I have to rebuild my machine