Why can I not see my USB connected Android device over SSH?

I have a computer running Mythbuntu 11.04, and it has Banshee 2.0 installed on it. I also have an Android phone that I use as a music player.

I want to get Banshee and Android talking to each other so that I can synchronize my playlists and all that good stuff.

Here's the thing... my Mythbuntu machine is hidden away under a desk, where it acts as a sort of file and media server. It has a screen and remote control attached for watching videos, but no keyboard or mouse.

When I want to use Banshee, I access it from one of my other two machines via this SSH command: ssh -X [email protected] banshee

So far, so good.

Now, I plug in my Android device to a USB port on the Mythbuntu machine, then open up Banshee via SSH on one of my other computers. The Android device does not appear in the Banshee interface.

For a long time I thought I was missing some driver or something, but after some experimentation, I discovered that if I open up Banshee on the computer itself (in other words, I plug in a keyboard and mouse and test out accessing it directly), then the Android device is automagically detected and everything works as expected.

So... the problem seems to be that for some reason, when I am running Banshee from an SSH connection, it can not see the Android device.

But that confuses me... why should the SSH connection matter? Is it that the SSH user is a different user from the one when I log into the machine directly (I use the same user name and password)?

More importantly, is there a way I can convince Banshee that when I open it via SSH and plug in the Android device that it should talk to the Android the same way it talks to Android when I am sitting at the computer itself?

I hope I've explained the situation clearly.

Any advice would be greatly appreciated.


Why you don't see it

Mounting file systems is a privileged operation on Unix systems. The udisks daemon is used to provide a way for non-privileged users to mount volumes (such as the USB Mass Storage service offered by your phone), but will only allow active sessions to perform the operation.

When you are logged on at the console and haven't locked the screen, you are considered to have an active session. When you ssh into the system, this is not the case. The idea is to only let someone with physical access to the system mount removable devices.

If you mount the phone manually, your music player should be able to access the files on it.

How to find it

  1. Run dmesg and look for your device. It should show up as something like /dev/sdb2. "sd" for scsi disk (scsi instructions are standard for disks now), a letter for the disk (a, b, c, etc), and a number for the partition.

  2. Or run sudo fdisk -l to get a list of your disks and partitions. You'll see it here somewhere.

Mount it manually

Once you find the device path (eg, /dev/sdb2), mount it with this command:

mount /dev/sdb2 /mnt

If you want, make a folder and mount it there instead:

mkdir ~/android
mount /dev/sdb2 ~/android