I have used two approaches: one for using USB MTP (via sys‑usb) and one for accessing Android devices via FTP/SFTP over tethering.
Security Considerations:
- When using USB MTP, disconnect unnecessary USB devices before connecting your phone, then restart sys‑usb afterward to ensure a clean state.
- For FTP/SFTP, running the file access in a dedicated, isolated qube keeps any potential network-based risks away from your core systems.
Choosing Between Methods:
- USB MTP: May offer faster speeds and direct file system access—but can be finicky in Qubes due to USB passthrough issues.
- FTP/SFTP: Provides an alternative that uses the phone’s network interface; though speeds are typically lower (especially if tethering via 2.4 GHz), it benefits from the isolation of using a dedicated qube.
Overview:
The goal is to have your Android device (in MTP mode) work reliably through the sys‑usb qube. This method requires that your sys‑usb’s disposable VM (DVM) template has the proper MTP support packages installed.
IMPORTANT PREPARATION (for security):
- Disconnect Extra USB Devices:
To reduce potential conflicts and minimize the attack surface, disconnect any nonessential USB devices (e.g. wireless mice, extra peripherals) before connecting your Android device.
- Restart sys‑usb After the Operation:
Once you’ve finished transferring files, restart sys‑usb to revert any temporary USB assignments.
Fedora‑based DVM Template?
If sys‑usb’s DVM is based on Fedora (for example, a Fedora disposable template), then proceed with Fedora instructions.
Debian‑based DVM Template?
If it’s based on Debian, use the Debian instructions.
Open a terminal in your Fedora template (or update it via dom0) and install:
sudo dnf install gvfs-mtp libmtp
Note: Fedora repositories do not provide a separate “mtp-tools” package. The combination above enables MTP support in file managers (such as Thunar, which is used in Qubes OS).
Open a terminal in your Debian template and run:
sudo apt update
sudo apt install gvfs-backends mtp-tools
Note: In Debian, these packages add MTP support so that file managers can mount and browse your Android device.
After installing the packages, shut down the template and restart sys‑usb so that the changes take effect:
qvm-shutdown sys-usb && qvm-start sys-usb
Make sure the device is unlocked.
Physically Connect the Device:
(Remember: disconnect other USB devices first for safety.)
Verify in sys‑usb:
lsusb
(or check Thunar’s Devices list) to ensure the Android device appears.You should now be able to browse the phone’s storage via MTP.
After You’re Done:
qvm-shutdown sys-usb && qvm-start sys-usb
Overview:
If MTP remains unreliable or you prefer an alternative, you can run an FTP (or SFTP) server on your Android device. By enabling tethering (hotspot) on the phone, you can connect from a dedicated qube (not sys‑usb) and use Thunar to browse files over the network.
Use a dedicated qube (separate from sys‑usb) that will access the phone via its hotspot.
Open a terminal in the Fedora template used by the dedicated qube and install:
sudo dnf install gvfs gvfs-ftp
Note: The “gvfs-ftp” package (or FTP backend integrated with gvfs) allows Thunar to access FTP URLs.
Open a terminal in the Debian template for your dedicated qube and run:
sudo apt update
sudo apt install gvfs-backends
This package includes support for FTP/SFTP access in file managers.
ftp://<phone_ip>:<port>/
sftp://<phone_ip>:<port>/