HowTo - USB connection to Ubuntu

Search This thread

Angralon

Member
Feb 21, 2009
27
12

Edit: Have a look at this thread: (MSC Mode for XPS). It could be a good workaround for your problem. MSC mode is kind of oldschool, but fine for copying things around.


If you want MTP support on Ubuntu, try this:

  1. Connect Xperia S to an USB2 port.

  2. Use the "lsusb" command to list your devices in a terminal
    One of the lines should look like this:
    Code:
    Bus 002 Device 012: ID 0fce:5169 Sony Ericsson Mobile Communications AB
  3. Note your vendor- and product id. Usually this is "0fce" for the vendor and "5169" for the product id. If you have USB debugging disabled, product id will be "0169".

  4. unplug your phone

  5. read this thread: humans-enabled.com
    Install the newest Version of "libmtp" and copy the 69-libmtp.rules file to /etc/udev/rules.d as described

  6. Edit: This step may not be necessary for you!
    Xperia S support is implementet in the libmtp-1.1.3. release. If you use the newest version from sourceforge.net
    skip this and go to step 7.


    type following to edit the copied file as root:
    Code:
    sudo gedit /etc/udev/rules.d/69-libmtp.rules
    Add the following text somewhere around the sony ericsson devices that are in this file. You can find them by searching for "0fce". Remember to set the correct vendor and product id:
    Code:
    # Sony Xperia S
    ATTR{idVendor}=="0fce", ATTR{idProduct}=="5169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
    ATTR{idVendor}=="0fce", ATTR{idProduct}=="0169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

  7. reboot, or use
    Code:
    sudo udevadm control --reload-rules
    to actualise.

  8. Plug in your device to a USB2 port, it will mount automatically. Use nautlius to copy files around.



Please let me know if it worked for you.
 
Last edited:

memfel

Member
Jul 29, 2009
19
0
I tried the solution u proposed, but I can only see 1.1 gb and if I go on storage on the phone settings, it says the external storage is mounted, but nothing about the 26gb or so of the internal storage, which in fact I can't see at all in my ubuntu nautilus.
don't really know how to deal with this...which version of ubuntu do u have?
 

Angralon

Member
Feb 21, 2009
27
12
Hi memfel

I just tried it on another laptop and noticed my tutorial was not complete.
Please read my edited Tutorial again. I am quite sure it will work like that.

Thanks for your response
 

memfel

Member
Jul 29, 2009
19
0
hi, thanks. now the difference is that it asks me if I want to use rhythmbox to see the connected device...nonetheless, still I can only see 1.5 gb partition, and not the all drive of the phone...that is, I can't move any file, because of those 1.5 gb most are already occupied... really don't know how to manage this, it's kinda crazy...
I found an app that seems to work, but the free version allows only to move 1 file or so...I can see 25gb there, through the web browser, but I find it so incredible that I'd need to pay for an app to do such a simple thing such as being able to connect the phone to my laptop and move files around...
 

Angralon

Member
Feb 21, 2009
27
12
Did you copy the libusb file to the right path?

Does it change something, if you enable the usb debugging mode?


If you don't succed with a USB connection you could still use airdroid. It works with wifi tethering or over a wlan router.
 

memfel

Member
Jul 29, 2009
19
0
nope USB debugging doesn't seem to make any difference.
what I'm trying now is to force a copy of some gb of files, also if it shows no space. I realized after making a video that when the space that get showed up is full, then it shows more, so it went from 1.5gb to 4.4...don't know why such a move, but seems like there's a bug perhaps somewhere.
'Funny' thing is, to copy 2gb it's taking 1h....do u also need all this time?
 

Angralon

Member
Feb 21, 2009
27
12
Just tested it: It took me about 3 minutes to copy a 2 GB video to the phone.

Did you flash a newer Firmware? Do you have root access?
I have rooted my XPS, but i don't see why this should make a difference...
 

memfel

Member
Jul 29, 2009
19
0
not rooted still, and no firmware change...really have no idea why it works this way...it's really weird I think.
Forcing copy didn't work, I got errors at one point, and all got blocked. Also, some files were copied on the phone, but when I tried to open the directory I copied, nautilus continued to crash all the time, so I am also not able to access the files that I copied...
I guess it's something broken with my ubuntu installation...perhaps going to be solved with 12.04...
 

Angralon

Member
Feb 21, 2009
27
12
Yes, they will hopefully integrate full MTP support into Ubuntu 12.

Just don't try to update your (broken) system from 11 to 12 with the update manager ;)
 

memfel

Member
Jul 29, 2009
19
0
let's hope I have the time to do a new install by the time 12 comes out. but in the meantime, if u have any other idea...let me know.
just to be precise...how many gb do u see when u connect ur phone?

---------- Post added at 09:44 PM ---------- Previous post was at 08:47 PM ----------

well, I retried to copy files over the allowed and visible size, it worked quite faster, and there I go, there appear some more gb of visible space...around 4.5 now...not all the disk, but still, it might mean the space shows up when needed even if at first it seems it's not there.
 

Angralon

Member
Feb 21, 2009
27
12
gparted and other partition managers do not list the phone, because it's not a mass storage device. So where did you find a size of the volume?
 

memfel

Member
Jul 29, 2009
19
0
when u open nautilus, u will have the phone showing up...u find the name of the device on the left pane, but also on top of the pane where u see files and folders once u click on the device to open it.
if u do right click on the name above this folders and files pane, u select properties, and there u go...u see the size of the disk...;)

hope the description is clear enough!;)
 

Angralon

Member
Feb 21, 2009
27
12
Nice, didn't know that so far.

Here is a Screenshot of what i see
 

Attachments

  • properties.jpg
    properties.jpg
    19.3 KB · Views: 274

memfel

Member
Jul 29, 2009
19
0
I guess u might see all that space perhaps because u have already a lot of stuff on the phone, or because u are rooted and somehow this influenced the connection...nonetheless, interesting that when I connect the phone via that web app that I found, it was showing me 25gb, u seem to have more...
Do u know what all the other space to 32gb is for? apps and system? or what? seems kinda lot of space that can't seem to be accessed.
 

memfel

Member
Jul 29, 2009
19
0
interesting. and rooting doesn't make those gb more available...perhaps we'll see more when roms start coming out!
 

hercule18

Senior Member
Jul 20, 2006
141
6
Hi,

Same as memfel for me.
I only see a 1.8g partition after the installation of libmtp.
can't do anything on it, I straigtly have an error message.

One thing that could explains some others in the first post the phone is identified like this:

Bus 002 Device 012: ID 0fce:5169 Sony Ericsson Mobile Communications AB

whereas mien is seen like this

Bus 001 Device 004: ID 0fce:0169 Sony Ericsson Mobile Communications AB
 

eva_d

Senior Member
Jan 2, 2006
606
11
Zielona Gora (PL)
dawid.lorenz.co
If you are trying to connect an Xperia S to your Ubuntu System, you will usually fail (as i did).
It took me like 4 hours until i found a solution. So let me share how it worked for me:


As I mentioned in the other thread, there is limited support for accessing Xperia S storage out of the box in Fedora 16. Namely, I could browse the files, copy files into XS but couldn't copy any files from it.

So, after applying udev rules you've suggested (btw, no need to reboot,
Code:
sudo udevadm control --reload-rules
will suffice) I can confirm that accessing internal storage is now two-way, hell yeah! I can see 20-odd GB of free space, however gMTP still doesn't recognize the device, as well as Rhythmbox. Banshee only recognizes it after adding ".is_audio_player" file in root of XS, however doesn't find any music in it.

Nonetheless, two-way data transferring via Nautilus is what I care about most, so I'm happy. Thanks for working solution to this!

UPDATE:
Ooops, looks like two-way doesn't exactly work as expected. Not sure what I did wrong but now I can't copy files from XS again. :/ Will need to tinker around it a little bit more...

UPDATE 2:
Some file are copying from XS happily, some don't throwing either "unspecified" or "unsupported" error in Nautilus. Weird..



---------- Post added at 05:34 PM ---------- Previous post was at 05:28 PM ----------

Hi,

Same as memfel for me.
I only see a 1.8g partition after the installation of libmtp.
can't do anything on it, I straigtly have an error message.

One thing that could explains some others in the first post the phone is identified like this:



whereas mien is seen like this

Difference between:

Code:
Bus 002 Device 011: ID 0fce:0169 Sony Ericsson Mobile Communications AB

and:

Code:
Bus 002 Device 012: ID 0fce:5169 Sony Ericsson Mobile Communications AB

is determined by USB debugging mode. Ideally you'd like your udev rules to read:

Code:
# Sony Xperia S
ATTR{idVendor}=="0fce", ATTR{idProduct}=="0169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
ATTR{idVendor}=="0fce", ATTR{idProduct}=="5169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
 
Last edited:
  • Like
Reactions: Angralon

Top Liked Posts

  • There are no posts matching your filters.
  • 11

    Edit: Have a look at this thread: (MSC Mode for XPS). It could be a good workaround for your problem. MSC mode is kind of oldschool, but fine for copying things around.


    If you want MTP support on Ubuntu, try this:

    1. Connect Xperia S to an USB2 port.

    2. Use the "lsusb" command to list your devices in a terminal
      One of the lines should look like this:
      Code:
      Bus 002 Device 012: ID 0fce:5169 Sony Ericsson Mobile Communications AB
    3. Note your vendor- and product id. Usually this is "0fce" for the vendor and "5169" for the product id. If you have USB debugging disabled, product id will be "0169".

    4. unplug your phone

    5. read this thread: humans-enabled.com
      Install the newest Version of "libmtp" and copy the 69-libmtp.rules file to /etc/udev/rules.d as described

    6. Edit: This step may not be necessary for you!
      Xperia S support is implementet in the libmtp-1.1.3. release. If you use the newest version from sourceforge.net
      skip this and go to step 7.


      type following to edit the copied file as root:
      Code:
      sudo gedit /etc/udev/rules.d/69-libmtp.rules
      Add the following text somewhere around the sony ericsson devices that are in this file. You can find them by searching for "0fce". Remember to set the correct vendor and product id:
      Code:
      # Sony Xperia S
      ATTR{idVendor}=="0fce", ATTR{idProduct}=="5169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
      ATTR{idVendor}=="0fce", ATTR{idProduct}=="0169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

    7. reboot, or use
      Code:
      sudo udevadm control --reload-rules
      to actualise.

    8. Plug in your device to a USB2 port, it will mount automatically. Use nautlius to copy files around.



    Please let me know if it worked for you.
    1
    If you are trying to connect an Xperia S to your Ubuntu System, you will usually fail (as i did).
    It took me like 4 hours until i found a solution. So let me share how it worked for me:


    As I mentioned in the other thread, there is limited support for accessing Xperia S storage out of the box in Fedora 16. Namely, I could browse the files, copy files into XS but couldn't copy any files from it.

    So, after applying udev rules you've suggested (btw, no need to reboot,
    Code:
    sudo udevadm control --reload-rules
    will suffice) I can confirm that accessing internal storage is now two-way, hell yeah! I can see 20-odd GB of free space, however gMTP still doesn't recognize the device, as well as Rhythmbox. Banshee only recognizes it after adding ".is_audio_player" file in root of XS, however doesn't find any music in it.

    Nonetheless, two-way data transferring via Nautilus is what I care about most, so I'm happy. Thanks for working solution to this!

    UPDATE:
    Ooops, looks like two-way doesn't exactly work as expected. Not sure what I did wrong but now I can't copy files from XS again. :/ Will need to tinker around it a little bit more...

    UPDATE 2:
    Some file are copying from XS happily, some don't throwing either "unspecified" or "unsupported" error in Nautilus. Weird..



    ---------- Post added at 05:34 PM ---------- Previous post was at 05:28 PM ----------

    Hi,

    Same as memfel for me.
    I only see a 1.8g partition after the installation of libmtp.
    can't do anything on it, I straigtly have an error message.

    One thing that could explains some others in the first post the phone is identified like this:



    whereas mien is seen like this

    Difference between:

    Code:
    Bus 002 Device 011: ID 0fce:0169 Sony Ericsson Mobile Communications AB

    and:

    Code:
    Bus 002 Device 012: ID 0fce:5169 Sony Ericsson Mobile Communications AB

    is determined by USB debugging mode. Ideally you'd like your udev rules to read:

    Code:
    # Sony Xperia S
    ATTR{idVendor}=="0fce", ATTR{idProduct}=="0169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
    ATTR{idVendor}=="0fce", ATTR{idProduct}=="5169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
    1

    Edit: Have a look at this thread: (MSC Mode for XPS). It could be a good workaround for your problem. MSC mode is kind of oldschool, but fine for copying things around.


    If you want MTP support on Ubuntu, try this:

    1. Connect Xperia S to an USB2 port.

    2. Use the "lsusb" command to list your devices in a terminal
      One of the lines should look like this:
      Code:
      Bus 002 Device 012: ID 0fce:5169 Sony Ericsson Mobile Communications AB
    3. Note your vendor- and product id. Usually this is "0fce" for the vendor and "5169" for the product id. If you have USB debugging disabled, product id will be "0169".

    4. unplug your phone

    5. read this thread: humans-enabled.com
      Install the newest Version of "libmtp" and copy the 69-libmtp.rules file to /etc/udev/rules.d as described

    6. Edit: This step may not be necessary for you!
      Xperia S support is implementet in the libmtp-1.1.3. release. If you use the newest version from sourceforge.net
      skip this and go to step 7.


      type following to edit the copied file as root:
      Code:
      sudo gedit /etc/udev/rules.d/69-libmtp.rules
      Add the following text somewhere around the sony ericsson devices that are in this file. You can find them by searching for "0fce". Remember to set the correct vendor and product id:
      Code:
      # Sony Xperia S
      ATTR{idVendor}=="0fce", ATTR{idProduct}=="5169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
      ATTR{idVendor}=="0fce", ATTR{idProduct}=="0169", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

    7. reboot, or use
      Code:
      sudo udevadm control --reload-rules
      to actualise.

    8. Plug in your device to a USB2 port, it will mount automatically. Use nautlius to copy files around.



    Please let me know if it worked for you.

    huh! after trying tons of guides and ways in xda and plain google searches.

    some very complicated ways, just adding your rules to udev did the trick, i was really surprised this simple method works.

    i have a new xperia z1, with your permission i'd like to copy this small TUT for xperia z1 users with the change of device id to that of the xperia z1.