Objective
I want to mount my "iPhone 5s" like any external disk-drive on my Linux Mint 18.2 "Sonya" to access my photos and videos. The "out-of-box" solution stopped working since my upgrade to iOS 10.3.
Motivation
Since iOS 8, I was used to install
libimobiledevice
with my package-manager (usually synaptic
or "apt-get install libimobiledevice"
from the Mint repository, to have access to my "iPhone 5s".Until now, this was a very convenient way, to exchange photos and videos between my iPhone and a my Laptop with Linux Mint. Recently I updated my Linux installation to Linux Mint 18.2 "Sonya" and my iPhone to iOS 10.3.3. After that, I recognized that
libimobiledevice
didn't work reliable anymore.First, I couldn't really find out, whether the newer version of Linux Mint or the newer version of iOS was in charge for the decline of service. After a while reading posts on the subject on the internet, I really suspect, that the main reason was the upgrade to iOS 10.2 and later 10.3. In iOS 10.2 I already, only sporadically, could connect my phone, but mostly just to see the "Documents" folder mounted, but not the "Photo" folder. Rarely the "Photo" folder appeared, too. If I was lucky and it was mounted, I wasn't asked whether I will trust the connection to the computer by my phone.
However, without the confirmation of this question (which didn't even appear) the "Photo" folder always was displayed as empty. Bummer!
Prerequisites
- Linux Mint 18.2 Sonya
- iPhone 5s with iOS 10.3.3
Solution: Compiling most of the sources yourself
On the internet, I found a manual, that promised to make the connection between an "iPhone" and Linux Mint work again [1]. This manual was written originally for users of Ubuntu in the first place. Still with Linux Mint, it did mostly work as described, but was kind of incomplete.
After you follow this description, the tools, to mount and unmount your phone, will be installed in the home account for the current user, just only one library
usbmuxd
must be installed as root in the system, otherwise mounting would not work.Install necessary software for building the source packages
To check-out and compile the needed packages from source, you have to install some additional software first.
Therefore, open a
bash-command-shell
and install git
to be able to check-out the source code repository to be compiled.$> sudo apt-get install -y git
Then install the compiler suite via the meta-package
build-essentials
including gcc
and such...$> sudo apt-get install -y build-essential
In contrary to the original manual at [1], I had to install some additional build tools.
$> sudo apt-get install -y libtool m4 automake
I also needed the package
libfuse-dev
from the Mint repository, this seems maybe not to be necessary on Ubuntu.$> sudo apt-get install -y libfuse-dev
Setup the shell environment to build the software
If you don't want to install the new commands directly into your system (which also would additionally need
sudo
for all "make install"
commands, which is not recommended), you have to setup your shell environment.As for this tutorial, all new commands to mount and unmount the file-system of your iPhone, will be installed in the sub-directory
"${HOME}/usr/bin/"
. Create the sub-directory to store the source files of the packages to be compiled:
$> mkdir -p "$HOME/usr/src"
Set all required environment variables to ensure to build the packages from source as desired:
$> export PKG_CONFIG_PATH="${HOME}/usr/lib/pkgconfig:${PKG_CONFIG_PATH}"
$> export CPATH="${HOME}/usr/include:${CPATH}"
$> export MANPATH="${HOME}/usr/share/man:${MANPATH}"
$> export PATH="${HOME}/usr/bin:${PATH}"
$> export LD_LIBRARY_PATH="${HOME}/usr/lib:${LD_LIBRARY_PATH}"
$> export CPATH="${HOME}/usr/include:${CPATH}"
$> export MANPATH="${HOME}/usr/share/man:${MANPATH}"
$> export PATH="${HOME}/usr/bin:${PATH}"
$> export LD_LIBRARY_PATH="${HOME}/usr/lib:${LD_LIBRARY_PATH}"
Make the path to your new tools permanent
It is recommended, to put the last two export statements into your
.bashrc
, to be loaded every time you open a new command shell, otherwise you must type$> export PATH="${HOME}/usr/bin:${PATH}"
$> export LD_LIBRARY_PATH="${HOME}/usr/lib:${LD_LIBRARY_PATH}
$> export LD_LIBRARY_PATH="${HOME}/usr/lib:${LD_LIBRARY_PATH}
in every newly opened command-shell to mount and unmount the file-system of your iPhone, because the first export is needed to find the new commands and the second is needed to load the correct run-time for the commands.
Clone all needed repositories from Github
$> cd ~/usr/src
$> for x in libplist libusbmuxd usbmuxd libimobiledevice ifuse; do git clone https://github.com/libimobiledevice/${x}.git;done
$> for x in libplist libusbmuxd usbmuxd libimobiledevice ifuse; do git clone https://github.com/libimobiledevice/${x}.git;done
You should see something similar to the following output:
Cloning into 'libplist'...
remote: Counting objects: 3767, done.
remote: Total 3767 (delta 0), reused 0 (delta 0), pack-reused 3767
Receiving objects: 100% (3767/3767), 1.13 MiB | 727.00 KiB/s, done.
Resolving deltas: 100% (2304/2304), done.
Checking connectivity... done.
Cloning into 'libusbmuxd'...
remote: Counting objects: 382, done.
remote: Total 382 (delta 0), reused 0 (delta 0), pack-reused 382
Receiving objects: 100% (382/382), 123.94 KiB | 0 bytes/s, done.
Resolving deltas: 100% (209/209), done.
Checking connectivity... done.
Cloning into 'usbmuxd'...
remote: Counting objects: 1954, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 1954 (delta 0), reused 1 (delta 0), pack-reused 1949
Receiving objects: 100% (1954/1954), 604.44 KiB | 424.00 KiB/s, done.
Resolving deltas: 100% (1191/1191), done.
Checking connectivity... done.
Cloning into 'libimobiledevice'...
remote: Counting objects: 8095, done.
remote: Total 8095 (delta 0), reused 0 (delta 0), pack-reused 8095
Receiving objects: 100% (8095/8095), 2.47 MiB | 617.00 KiB/s, done.
Resolving deltas: 100% (5666/5666), done.
Checking connectivity... done.
Cloning into 'ifuse'...
remote: Counting objects: 499, done.
remote: Total 499 (delta 0), reused 0 (delta 0), pack-reused 499
Receiving objects: 100% (499/499), 92.37 KiB | 0 bytes/s, done.
Resolving deltas: 100% (242/242), done.
Checking connectivity... done.
remote: Counting objects: 3767, done.
remote: Total 3767 (delta 0), reused 0 (delta 0), pack-reused 3767
Receiving objects: 100% (3767/3767), 1.13 MiB | 727.00 KiB/s, done.
Resolving deltas: 100% (2304/2304), done.
Checking connectivity... done.
Cloning into 'libusbmuxd'...
remote: Counting objects: 382, done.
remote: Total 382 (delta 0), reused 0 (delta 0), pack-reused 382
Receiving objects: 100% (382/382), 123.94 KiB | 0 bytes/s, done.
Resolving deltas: 100% (209/209), done.
Checking connectivity... done.
Cloning into 'usbmuxd'...
remote: Counting objects: 1954, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 1954 (delta 0), reused 1 (delta 0), pack-reused 1949
Receiving objects: 100% (1954/1954), 604.44 KiB | 424.00 KiB/s, done.
Resolving deltas: 100% (1191/1191), done.
Checking connectivity... done.
Cloning into 'libimobiledevice'...
remote: Counting objects: 8095, done.
remote: Total 8095 (delta 0), reused 0 (delta 0), pack-reused 8095
Receiving objects: 100% (8095/8095), 2.47 MiB | 617.00 KiB/s, done.
Resolving deltas: 100% (5666/5666), done.
Checking connectivity... done.
Cloning into 'ifuse'...
remote: Counting objects: 499, done.
remote: Total 499 (delta 0), reused 0 (delta 0), pack-reused 499
Receiving objects: 100% (499/499), 92.37 KiB | 0 bytes/s, done.
Resolving deltas: 100% (242/242), done.
Checking connectivity... done.
Additionally to the original manual [1], I also had to compile
libplist
from source.Build and install the packages in the following order
Build libplist
$> cd ~/usr/src/libplist
$> ./autogen.sh --prefix="$HOME/usr"
$> make && make install
$> ./autogen.sh --prefix="$HOME/usr"
$> make && make install
Build libusbmuxd
$> cd ~/usr/src/libusbmuxd
$> ./autogen.sh --prefix="$HOME/usr"
$> make && make install
$> ./autogen.sh --prefix="$HOME/usr"
$> make && make install
Build libimobiledevice
$> cd ~/usr/src/libimobiledevice
$> ./autogen.sh --prefix="$HOME/usr"
$> make && make install
$> ./autogen.sh --prefix="$HOME/usr"
$> make && make install
Build usbmuxd
The package
usbmuxd
must be installed with administrative rights, because it needs write access to "/lib/udev/rules.d"
and "/lib/systemd/system"
.$> cd ~/usr/src/usbmuxd
$> ./autogen.sh --prefix="$HOME/usr"
$> make && sudo make install
$> ./autogen.sh --prefix="$HOME/usr"
$> make && sudo make install
Build ifuse
$> cd ~/usr/src/ifuse
$> ./autogen.sh --prefix="$HOME/usr"
$> make && make install
$> ./autogen.sh --prefix="$HOME/usr"
$> make && make install
Test if everything works
It's assumed that you put the two exports into your
~/.bashrc
as mentioned above.Open a new bash command-shell.
Connect your iPhone
Create a mount point, where you want the content of your iPhone to appear.
$> mkdir -p ~/usr/mnt
Check which command executable will used, just in case you also have
libimobiledevice
additionally installed from the Mint repository, to avoid confusion.$> type -p ifuse
/home/csch/usr/bin/ifuse
$> type -p idevicepair
/home/csch/usr/bin/idevicepair
Pair your iPhone with your computer
Now, grab your lightning-usb-cable and connect your iPhone to the computer.
Try to pair the iPhone with your computer.
$> idevicepair pair
ERROR: Could not validate with device 45ad6a77ae03f2d03f14a68fae178e45e70e7a04 because a passcode is set. Please enter the passcode on the device and retry.
Ooops, what's that? What happened? Again...
$> idevicepair pair
No, worry ... the ERROR just tell you that you forgot to confirm that you trust the connected computer on your phone, by entering your PIN on your phone and accept the trustworthy question.
cschmidt@pippin:~/usr/src/ifuse$ idevicepair pair
ERROR: Please accept the trust dialog on the screen of device 45ad6a77ae03f2d03f14a68fae178e45e70e7a04, then attempt to pair again.
ERROR: Please accept the trust dialog on the screen of device 45ad6a77ae03f2d03f14a68fae178e45e70e7a04, then attempt to pair again.
After doing so, you finally can mount your iPhone (All good things come by in threes, therefore again)
$> idevicepair pair
SUCCESS: Paired with device 45ad6a77ae03f2d03f14a68fae178e45e70e7a04
Mount the file-system of your iPhone and check the content
Finally, mount the file-system of your phone.
$> ifuse ~/usr/mnt/
$> ls ~/usr/mnt/
$> ls ~/usr/mnt/
AirFair com.apple.itunes.lock_sync iTunes_Control Photos Radio
Books DCIM MediaAnalysis PublicStaging Recordings
CloudAssets Downloads PhotoData Purchases Safari
Books DCIM MediaAnalysis PublicStaging Recordings
CloudAssets Downloads PhotoData Purchases Safari
Unmount and disconnect
To safely disconnect your iPhone, you have to unmount the file-system in
~/usr/mnt
first with fusermount
.$> fusermount -u ~/usr/mnt
Now, you can plug-off your iPhone again.
References:
- gist: samrocketman/libimobiledevice_ifuse_Ubuntu.md
- Github repository
https://github.com/libimobiledevice/
type
command reference
Really appreciate your tutorial. I was finally able to access my iPhone 8 running iOS 11.2.1 from Ubuntu 17.04.
ReplyDeleteGlad to hear, that I could help!
DeleteI just upgraded to mint 18.3 32-bit and successfully connected my iPhone 6S without any software tweaks. However, I had to do the following: 1)Connect phone to USB, 2)Open Caja, 3)Open phone and "trust" computer, 4)Go back to Caja and unmount and allow to remount automatically several times until the DCMI folder appears
ReplyDeleteYes, that was exactly what I experienced. Sometimes, the DCIM folder appeared, sometimes not. Most of the times, only the "Documents" folder appeared. Therefore I compiled the sources myself and wrote the blog entry to remember how to do it next time (as kind of a reminder to myself).
DeleteHi,
ReplyDeleteThanks ever so much, worked fine for me, but I had to install a few more things (on Linux Mint 18.3 64 bits Cinnamon)
sudo apt-get install cython
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install libusb-1.0-0-dev
Regards,
Laurent (from France)
Bonsoir Laurent,
Deletegreat to hear, that my post was of use to you. Yes, the process might slightly differ, if another version of Linux is used (or different components are already installed) or even might not work with all iOS versions, unfortunately.
Regards,
Christian (from Germany)
I have the same version (Linux Mint 18.3 64 bits Cinnamon), still doesn't work for me .Here is the message :
DeleteCould not load the folder
Failed to get folder list: No such file or directoru
Hello Milan,
Deleteafter which step/command does the error message appear?
Is the text of the message exact, because I couldn't find anything emitting this message. Also, you iOS might be newer than mine.
when using type, the output is different for me:
ReplyDelete/usr/bin/ifuse
/usr/bin/idevicepair
in /home/user/usr/bin there isn't any ifuse or others... y? Maybe because i did all the work from root user?
yes
DeleteYes, you should not be root. I never tested what happened if the tutorial is done with the root account and I never will.
DeletePS: still can't mount. Also i would maybe suggest how to remove all the stuff before compiling, so the problem of which executable is bee used is simply avoid (or not?) however thanks for the article!
ReplyDeletejust delete it
DeleteSorry for the late reply, Francesco.
DeleteAs you have done everything as root, "just delete all" is kinda dangerous. If you follow the tutorial correctly as user (not root), you just have to delete the target folder, where all installation is done, before you finally did "make install " (and maybe remove all installed packages again, using "sudo apt-get remove ".
Anyway, I hope you could fix your problem already ...
Thank you!
ReplyDeleteThank you!
ReplyDeleteCongratulations it works perfectly, but it has a detail. When I copy a photo to the iphone (pc to iphone), I can not see the photo, which I copied, by the iphone photos application. Do you know what the problem is?
ReplyDeleteHi,
ReplyDeleteI was able to pair my iphone 5 with my linux mint 18.3, but when I try to mount I get the following error:
GnuTLS error: Error in the pull function.
Failed to connect to lockdownd service on the device.
Try again. If it still fails try rebooting your device.
Could anyone help me out?
Hello!
ReplyDeleteLinux Mint 19
iOS 10.3.3
At the "Build libplist" point, I had to include the command "bash" before "./", just like this:
From: ./autogen.sh --prefix="$HOME/usr"
To: bash ./autogen.sh --prefix="$HOME/usr"
It doesn't work in anyway else, even with "sudo".
So I got the following:
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
configure.ac:29: installing './compile'
configure.ac:6: installing './missing'
cython/Makefile.am: installing './depcomp'
./autogen.sh: line 21: ./configure: Permission denied
Just the samething I sold including the "bash" command... but, how to include this in the line 21 of the script(autogen.sh)???
can i use the same code on peppermint 10? if there are any adjustments i need to make may you please advise. Thank you in advance
ReplyDeletethanks for your tutorial, I can finaly read content from my iphone on my computer. I just wander, why it must be all so complicated with linux ...
ReplyDelete