Problems connecting Android with Qube

Trying to save the pictures with a specially created offline Qube (Fedora) from my cell phone. Okay, connected via USB, then my cell phone appears in the file manager, but when I click on it to open it, "Failed to mount “Pixel 7 Pro”. Unable to open MTP Device “001,002”.

  • Data transmission is activated in the cell phone
  • gvfs is already installed.

Now before I try to install every package from the internet that it could be and then make my template unsafe, maybe you can help me, maybe someone knows the problem.
It is a Google Pixel 7 Pro.
Thank you

Another (not very good) workaround: is to use the adb command-line tool like in this comment of n0madK on Open Correctly handle USB attach of Android device in USB debugging mode.

In the template dedicated to android (maybe you can create a dedicated template like “android-template”), install the android-tools package. Do the same in the template of sys-usb. With fedora it’s something like that:

dnf install android-tools

Now make sure both templates are shutdown and restart sys-usb and your android AppVM.

On your phone:

  • activate the Developer Options
  • In the Developer Options menu, allow USB Debbuging
  • Plug your phone to the computer, switch to MTP transfert

On sys-usb, run an adb command like:

adb devices

On your phone: allow the connection.

In sys-usb: you should see some result from the adb devices like:

List of devices attached
XXXXXXXXX       device

Now we will allow the android AppVM to connect to adb via sys-usb.

In dom0: the comment say to edit /etc/qubes-rpc/policy/qubes/.ConnectTCP but I think that there is a better solution with a custom file in /etc/qubes/policy.d/30-android.policy. Edit this file like this, replacing your-android-vm by the name of your android AppVM:

qubes.ConnectTCP    *    your-android-vm    @default    allow    target=sys-usb

On the android AppVM, you need to run this command first:

qvm-connect-tcp::5037

Then you can check that your device is available:

adb devices

And now you can copy your files:

adb pull /sdcard/Pictures/... Pictures

If your not familiar with these commands, maybe try the other workaround first?

1 Like

Okay, thank you very much for now. Regarding the first post, it scares me a bit because it was written that other USB devices log off from the sys-USB.
I don’t want to have a secure system on the one hand and then play around with it so that everything gets mixed up and I can no longer guarantee security. As for the 2nd solution, I’ll be honest, it’s too complicated for me.

I thought I could back up my data and pictures on an offline qube.

Does anyone have another solution?
The best thing is that the content of my phone is simply displayed in the file manager. There must be a solution without having to do a master’s degree in IT or without having to override the system just for this one purpose?

Thank you already…
Best regards

Not all devices but only those belonging to the same USB controller (if you have more than one). Also, why do you think it’s a serious problem? You put them back after it’s done. Dom0 is not going to get compromised because of that.

Also, you can perform all actions in sys-usb itself and if it’s disposable (which is recommended), it will be reset after a reboot.

1 Like

Okay, stupid question, but how do I do that? Do I understand correctly, as soon as I restart the PC everything is reset and the USB controller is running in the sys-usb again?

Okay, I have now simply enabled the File Manager for sys-USB in the App tab and expanded the memory from 2 to 10 GB. Now I can access the cell phone directly, copy my pictures to a folder in the VM sys-USB, then move them to another Qube. Then I restart the sys-USB and everything is as before…did I understand that correctly?
I haven’t had Qube that long and am still learning, hence the comprehension question.

Now I have an extra question, can I make a 2nd sys-USB VM that accesses the same USB that I use for this purpose or do I always have to turn off the other one (so that only one is running) or do I then get problems with the mouse or keyboard and possibly other USB devices? According to my entry, I only have one USB controller.

1 Like

Yes, you did it right with the sys-usb.

You can only run one sys-usb with a single controller at a time. If you have a USB keyboard, you have to be extra careful in order to not loose the access to your system.

I can’t edit my post but a better solution is proposed by @warnersmith here:

Don’t install anything related to android in sys-usb, use a second one for android tools.

1 Like