I can't send files from my phone to qubes

I am unable to send Android media files to qubes via USB cable.
Is this due to QubesOS? Or is this because I am using GraphenOS?

I don’t connect to my phone using USB, but sys-usb detects the phone and I can assign it to a qube where it’s detected as a Nexus/Pixel MTP device.

If you have sys-usb and the mtp tools installed you should be able to use the phone.

I just tried connecting to the phone using MTP and PTP, and it also doesn’t work for me. The USB bus does detect the device, but the system fails when trying to connect it.

user@personal:~$ sudo mtp-detect 
libmtp version: 1.1.17

Listing raw device(s)
Device 0 (VID=18d1 and PID=4ee5) is a Google Inc Nexus/Pixel (PTP).
   Found 1 device(s):
   Google Inc: Nexus/Pixel (PTP) (18d1:4ee5) @ bus 1, dev 5
Attempting to connect device(s)
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device 0
OK.

It works in sys-usb, you can open the phone using nautilus in sys-usb, it’s only when you transfer the device to another qube it doesn’t work.

Don’t know if this is an issue with sys-usb, or if it’s something that can be fixed by changing the policies.

This is a known issue.
You may attach the USB controller PCI device to your appvm.

1 Like

Another way of sending files from your phone to your qubes-os is using syncthing.net
Check it out. It is a cool way to sync files between two (or more) computers.

Greetings.

I’m new to QubesOS. I’ve observed it’s been a while since this topic has had replies. Has any other solution appeared in the current version?
I just tried to set an AppVM to have access to a USB device via the MTP, and nothing has been successful so far. It follows a Fedora-based template. gvfs-mtp is installed.

This is what I do, meaning all of these work.

I created two sys-usbs for the same usb controller. Their dvm-templates and top-templates differs. They do not have same firmwares and packages installed. Uninstall in one everything that is not needed for mobile phone to work as expected, and install everything needed.

Same for the other one. Do not install any package regarding mobile phones.

Do not ever attach mobile to the other sys-usb and vice vers.

Start first sys-usb, attach mobile phone, mount it and browse it there and transfer files to the AppVM. If you want to provide internet, check the option in the sys-usb Settings-Advanced, set portable usb-tethering hot spot on the phone, and set other qubes to this sys-usb as netVM. When you finish, disconnect mobile phone, shut down sys-usb, start the other one and attach other devices.

Another solution is to transfer files via bluetooth, or to set bluetooth/wifi portable hot spot.

1 Like

Thank you for your reply!

Right! I see, the Github issue is still open.

I’ve found the following workaround which, in some sense, I like even more than mounting using the MTP (despite slower transfer speeds).

The approach is setting up an SFTP server on the mobile device, enabling wireless tethering, connecting the computer with QubesOS to that portable hotspot & starting the file server, then accessing the server from a dedicated qube.

yet another solution would be to run adb over tcp: adb/server in sys-usb, adb/client in some appvm, qvm-connect-tcp between both (doc).
(this was suggested by @enmus in a similar topic)

1 Like

Just to note, that adb requires you to enable debugging in android which will have security issues.

1 Like