How to Connect an Android Phone via MTP on Arch Linux

How to Connect an Android Phone via MTP on Arch Linux

Connecting an Android device to a Linux system for file transfer isn’t always as seamless as it is on Windows or macOS. On Arch Linux, which favors a minimalist, do-it-yourself approach, users need to manually configure and install the required packages to get MTP (Media Transfer Protocol) working properly.

In this guide, we’ll walk through everything you need to connect your Android phone via MTP on Arch Linux, from installing the required software to troubleshooting common issues.


📱 What is MTP?

MTP stands for Media Transfer Protocol, a standardized protocol developed by Microsoft that allows the transfer of media files to and from portable devices. Android phones support MTP mode, which is typically used to copy files between the phone and a computer.

When connected via USB, Android devices usually default to charging only. Users must explicitly select MTP mode on their phone to access the internal storage from their desktop environment.


🧰 Prerequisites

Before diving into the configuration, ensure the following:

  • Your Android phone supports MTP (almost all modern Android devices do).
  • A USB data cable (not just a charging cable).
  • Your Android phone is unlocked when connecting.
  • You’re running a desktop environment or window manager on Arch Linux.

Let’s go step by step.


🔧 Step 1: Install Required Packages

Arch does not come with MTP support out of the box, so we need to install the required packages:

sudo pacman -S libmtp gvfs-mtp mtpfs jmtpfs android-udev

Here’s what each package does:

  • libmtp: Core library for MTP support.
  • gvfs-mtp: GIO module to access MTP devices in GNOME-based file managers.
  • mtpfs/jmtpfs: Filesystem drivers to mount MTP devices manually via FUSE.
  • android-udev: Udev rules to correctly detect Android devices.

If you’re using KDE (Plasma), install kio-extras instead of gvfs-mtp:

sudo pacman -S kio-extras

This ensures support in Dolphin, KDE’s file manager.


⚙️ Step 2: Add Udev Rules for Your Device

Udev rules help the system recognize when your phone is plugged in. The android-udev package already includes a wide range of rules for various Android devices. You can confirm that your device is supported by checking:

cat /usr/lib/udev/rules.d/51-android.rules

If your device isn’t listed or still doesn’t connect, you may add a custom rule:

  1. Find your phone’s vendor and product ID:

    lsusb
    

    Example output:

    Bus 001 Device 008: ID 18d1:4ee7 Google Inc. Nexus/Pixel Device (MTP)
    
    • Vendor ID: 18d1
    • Product ID: 4ee7
  2. Create or edit a rule:

    sudo nano /etc/udev/rules.d/51-android.rules
    
  3. Add this line (replace IDs accordingly):

    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0666", GROUP="users", SYMLINK+="android"
    
  4. Reload udev rules:

    sudo udevadm control --reload-rules
    sudo udevadm trigger
    

📂 Step 3: Connect the Phone

  1. Connect your Android device via USB.

  2. On the phone, a prompt should appear. Select:

    File Transfer / MTP mode
    
  3. If everything is configured correctly, you should now see the phone appear in your file manager (Nautilus, Dolphin, Thunar, etc.).


🔒 Step 4: Unlock the Phone

Sometimes, your phone won’t show up even if everything is installed properly. One of the most common culprits is a locked screen. Make sure to:

  • Unlock your Android device before or right after connecting it.
  • Re-select MTP mode if prompted again.

🗂️ Step 5: Access Files via GUI

Depending on your desktop environment:

  • GNOME (Nautilus): Your phone should appear in the left panel as a mountable device. Click it to browse files.
  • KDE (Dolphin): Your device will be listed under “Devices” or “Removable Devices.”
  • XFCE (Thunar): May require gvfs-mtp to show devices.

If your device doesn’t show up, try killing and restarting your file manager:

nautilus -q && nautilus &

Or simply log out and log back in.


🖥️ Step 6: Access MTP via CLI (Optional)

If you prefer using the command line or need more control, you can use jmtpfs or mtpfs to mount the device manually.

Create a mount point

mkdir ~/android

Mount with jmtpfs

jmtpfs ~/android

After that, you can browse your phone’s internal storage at ~/android.

Unmount when done

fusermount -u ~/android

This is useful when working on lightweight or headless systems without a GUI.


🧪 Troubleshooting

Phone not detected at all?

  • Try another USB cable (some cables are power-only).

  • Try a different USB port.

  • Run lsusb and see if the device is listed. If not, it’s a hardware issue.

  • Check dmesg output:

    dmesg | grep -i usb
    

MTP device not showing up in file manager?

  • Ensure gvfs-mtp or kio-extras is installed.

  • Try restarting the file manager.

  • Check if the device is mounted via:

    gvfs-mount -li
    
  • Restart gvfsd:

    pkill gvfsd
    

Device visible but cannot access files?

  • Unlock the phone screen.
  • Re-select “File Transfer” mode.
  • On some Android ROMs, MTP permissions are more strict. Enable developer mode and check “Default USB configuration.”

🧩 Alternatives and Tools

1. ADB (Android Debug Bridge)

If MTP gives you constant trouble, ADB is a more reliable, though more technical, alternative.

Install:

sudo pacman -S android-tools

Use ADB to pull or push files:

adb devices
adb pull /sdcard/DCIM ~/Pictures
adb push file.txt /sdcard/

ADB requires USB debugging enabled on the phone.

2. Syncthing

Syncthing is a cross-platform P2P sync tool that works over Wi-Fi. Great for syncing folders between your Android and Arch box without cables.

3. FTP Server Apps

Apps like WiFi FTP Server or Solid Explorer FTP Server turn your Android phone into an FTP server. You can then connect via any FTP client.


🧼 Security Considerations

When using MTP:

  • You expose your phone’s file system to your Linux machine, so avoid using untrusted or public systems.
  • MTP does not require file system-level permissions, but it’s still good practice to unmount or disconnect the phone before physically unplugging it.

🏁 Conclusion

While Arch Linux requires a bit more manual setup to get MTP working compared to other distributions, the steps are straightforward once you understand the moving parts. By installing the necessary packages, setting up Udev rules, and ensuring your Android device is properly configured, you can easily transfer files between your phone and Arch system.

If MTP still feels too finicky, consider using ADB or a network-based solution like Syncthing or FTP for a more stable experience.


✅ Quick Summary

TaskCommand
Install packagessudo pacman -S libmtp gvfs-mtp mtpfs jmtpfs android-udev
Reload udev rulessudo udevadm control --reload-rules && sudo udevadm trigger
Mount with jmtpfsjmtpfs ~/android
Unmountfusermount -u ~/android
List USB deviceslsusb
Check MTP modeSelect “File Transfer” on your phone