Connect iphone to linux

How to Connect iPhone to Arch Linux

Troubles with iPhone and Arch Linux? iPhone and Linux never really go along very well. In this tutorial, I am going to show you how can you use iPhone in Antergos Linux. Since Antergos is based on Arch Linux, the same steps should be applicable to other Arch based Linux distros such as Manjaro Linux.

So, when I bought an iPhone 6S and when I connected it to Antergos Linux to copy some pictures, it was not detected at all. I could see that iPhone was being charged and I had allowed iPhone to ‘trust the computer’ but there was nothing at all detected. I tried to run dmseg but there was no trace of iPhone or Apple there. What is funny that libimobiledevice was installed as well, which always fixes iPhone mount issue in Ubuntu.

I am going to show you how I am using iPhone 6S, running on iOS 9 in Antergos. It goes more in command line way, but I presume since you are in Arch Linux zone, you are not scared of terminal (and you should not be as well).

Mount iPhone in Arch Linux

iPhone mount in Arch based Antergos Linux

Step 1: Unplug your iPhone, if it is already plugged in.

Step 2: Now, open a terminal and use the following command to install some necessary packages. Don’t worry if they are already installed.

sudo pacman -Sy ifuse usbmuxd libplist libimobiledevice

Step 3: Once these programs and libraries are installed, reboot your system.

Step 4: Make a directory where you want the iPhone to be mounted. I would suggest making a directory named iPhone in your home directory.

Step 5: Unlock your phone and plug it in. If asked to trust the computer, allow it.

iPhone allow Arch Linux

Step 6: Verify that iPhone is recognized by the system this time.

This should show you some result with iPhone and Apple in it. Something like this:

[ 31.003392] ipheth 2-1:4.2: Apple iPhone USB Ethernet device attached
[ 40.950883] ipheth 2-1:4.2: Apple iPhone USB Ethernet now disconnected
[ 47.471897] ipheth 2-1:4.2: Apple iPhone USB Ethernet device attached
[ 82.967116] ipheth 2-1:4.2: Apple iPhone USB Ethernet now disconnected
[ 106.735932] ipheth 2-1:4.2: Apple iPhone USB Ethernet device attached

This means that iPhone has been successfully recognized by Antergos/Arch Linux.

Step 7: When everything is set, it’s time to mount the iPhone. Use the command below:

Since we created the mount directory in home, it won’t need root access and you should also be able to see it easily in your home directory. If the command is successful, you won’t see any output.

Читайте также:  Как сохранить конфигурацию linux

Go back to Files and see if the iPhone is recognized or not. For me, it looks like this in Antergos:

iPhone mounted in Arch based Antergos Linux

You can access the files in this directory. Copy files from it or to it.

iPhone iOS 9 mount in Arch Linux

Step 8: When you want to unmount it, you should use this command:

Worked for you?

I know that it is not very convenient and ideally, iPhone should be recognized as any other USB storage device but things don’t always behave as they are expected to. Good thing is that a little DIY hack can always fix the issue and it gives a sense of achievement (at least to me). That being said, I must say Antergos should work to fix this issue so that iPhone can be mounted by default.

Did this trick work for you? If you have questions or suggestions, feel free to drop a comment.

Источник

iPhone tethering

Unless disabled by your provider, it is possible to share your iPhone’s mobile data connection over WiFi, USB or Bluetooth:

  • WiFi requires no additional configuration provided your computer can connect to wireless networks,
  • Instructions for USB and Bluetooth tethering are provided below.

Tethering over USB

Tethering natively over USB is the optimal choice as it provides a more stable connection and uses less batteries than bluetooth or wifi.

To tether your iPhone over USB, you will need to install libimobiledevice and usbmuxd . The libimobiledevice package depends on usbmuxd, which is responsible for performing the low-level connection to iOS devices. The usbmuxd package also includes an udev rule that automatically starts and stops the daemon whenever a device is connected or disconnected. See iOS for more details.

Connect the iOS device and verify that usbmuxd.service is automatically started.

Next enable Personal Hotspot on your iPhone and plug it into your computer. At this point you will have a new ethernet device available and should be able to use any network manager to connect to the internet through the new iPhone ethernet device, just like you would any other ethernet connection.

Using systemd-networkd

If systemd-networkd is used for network management, you can easily configure it to connect to the internet through the iPhone, as you would with any other adapter.

If for example enp0s26u1u2c4i2 is the name of the network device that is created from the iPhone as displayed by networkctl list , create the following .network file:

/etc/systemd/network/30-tethering.network
[Match] Name=enp0s26u1u2c4i2 [Network] DHCP=yes

Troubleshooting

If the iPhone appears in the device list but does not connect, it is possible that you may need to connect your iPhone and pair it with your computer before connecting (iPhones using a PIN unlock?):

Driver missing

If you have followed all the above steps and commands: networkctl list still does not detect the iPhone, the ipheth driver is probably missing. You can check if you have the driver installed by running the modprobe ipheth command. If an error message appears, set the ipheth flag when building the kernel. This problem can occur when building your own kernel.

Читайте также:  Asus tuf linux drivers

Tethering over Bluetooth

Tethering over Bluetooth will drain the batteries relatively quickly, but simultaneous charging from an USB port works well.

Hardware Requirements

  • iPhone running OS 3.0 with tethering enabled. See Settings >General >Network and turn on the tethering option.
  • Bluetooth adapter or similar, preferably with EDR (Enhanced Data Rate) for acceptable speeds. Tested with a Belkin F8T016NE.

Setup

See the main article Bluetooth and setup the bluetooth daemon.

Gnome/XFCE

Install the Blueman GTK Bluetooth manager.

A Bluetooth icon should appear in your notification area. Note: the icon may not appear if bluetooth was not turned on at startup. Click it, and search for nearby devices, adding your iPhone (note, you may need to have the Bluetooth setting screen up on your iPhone for discovery to work).

Once the iPhone has been added to the devices list, open the Device menu and select pair. This will require the usual entering of a PIN on the computer then the iPhone. Now open the Device menu again, and choose Network Access > Network Access Point. If everything goes well, blueman reports a success and the status bar on your iPhone should glow blue, indicating a successful tether.

Blueman will have created a new network interface, typically bnep0. To connect to it, run the following as root.

netcfg

This article or section is out of date.

Alternatively, you can create a netcfg network profile to allow easy tethering from the command line, without requiring Blueman or Gnome. Assuming an already paired iPhone with address ’00:00:DE:AD:BE:EF’, simply create a profile in /etc/network.d called — for example — ‘tether’:

CONNECTION="ethernet" DESCRIPTION="Ethernet via pand tethering to iPhone" INTERFACE="bnep0" IPHONE="00:00:DE:AD:BE:EF" PRE_UP="pand -E -S -c $ -e $ -n 2>/dev/null" POST_DOWN="pand -k $" IP="dhcp"

To bring the interface down and un-tether:

Источник

Connect iphone to linux

iOS is an operating system created by Apple Inc. for use in the iPhone series of smartphones. Although connecting iOS devices to Linux is not supported by Apple, the libimobiledevice project provides libraries and tools to connect and transfer data between iOS devices and Linux machines.

Installation

Connecting to a device

Usbmux daemon

The libimobiledevice package depends on usbmuxd , which is responsible for performing the low-level connection to iOS devices. The usbmuxd package also includes an udev rule that automatically starts and stops the daemon whenever a device is connected or disconnected.

Connect the iOS device and verify that usbmuxd.service is automatically started.

$ systemctl status usbmuxd.service
. Active: active (running) since Sun 2020-01-19 19:23:18 UTC; 22s ago . 

Pairing

After connecting your iOS device and unlocking the screen, you should be presented with a «Trust This Computer?» popup on the device. Tap «Trust», then enter your device passcode to complete the pairing process.

If you do not see the popup, you can start the pairing process manually. Connect the device, unlock the screen and run:

SUCCESS: Paired with device d8e8fca2dc0f896fd7cb4cb0031ba249

If you have multiple iOS devices connected —udid ios_udid parameter can be passed to target specific device.

You can verify the pairing has succeeded by running:

SUCCESS: Validated pairing with device 00008030-001D3562367A402E

Transferring data

After pairing, iOS exposes two different filesystems to the computer. One is the media filesystem, containing the device’s photos, videos and music. The second filesystem is used for sharing files directly to certain apps. This is sometimes called «iTunes document sharing». [1] [2]

Читайте также:  Exit status 127 linux

Using a graphical file manager

File managers which use GVFS can interact with iOS devices. To access the media filesystem, install gvfs-gphoto2 . To access the app document filesystem, install gvfs-afc .

Note: When accessing the media filesystem, GVFS will only expose the device’s photos and videos, not music.

Dolphin support for iOS devices is included in the kio-extras package, which is already a dependency for Dolphin. [3]

Manual mounting

Install the ifuse package. You can then run the following command to mount your iPhone’s media filesystem:

You can use this to access the device’s photos inside mountpoint/DCIM .

Note: The device’s music database will also be accessible in mountpoint/iTunes_Control . You cannot add new songs to the device this way, but you can copy songs from the device to your computer.

Warning: Manually editing the databases inside iTunes_Control will result in their corruption, and turn your synced songs into stale data that can only be removed with a system restore.

To access an app’s document filesystem, first you need to identify the app:

"CFBundleIdentifier","CFBundleVersion","CFBundleDisplayName" "org.videolan.vlc-ios","432","VLC" "org.wikimedia.wikipedia","1932","Wikipedia" "org.kde.kdeconnect","2","KDE Connect" [. ]

You can then mount an application’s files using:

$ ifuse --documents APPID mountpoint 

Where APPID is the bundle identifier of the desired application, such as org.videolan.vlc-ios .

After you’re done, unmount the filesystem:

$ fusermount -u mountpoint 

Importing videos and pictures

Both videos and photos can be found in typically in /DCIM/100APPLE .

HTML5 videos

Typically you want to convert MOV files to a HTML5 video format like OGV using ffmpeg2theora . Note that the creation date metadata is not in the converted video, so you need to use a script like:

#!/usr/bin/sh find -name "*.MOV" | while read mov do d=$(gst-discoverer-1.0 -v $mov | awk '/datetime:/' | tr -d \") base=$ if test -f $base.ogv then touch -d$ $base.ogv ls -l $base.ogv else echo $base.ogv missing fi done

And use cp -a or rsync -t in order to preserve the file’s date & time.

Troubleshooting

ifuse fails to mount application directories

When using ifuse to mount application directories, you may run into the following error when trying to list the contents of the mountpoint:

".": Input/output error (os error 5)

This is a known issue that has been fixed in the current development version of libimobiledevice, but has not been released in a stable version yet. A workaround is to install libimobiledevice-git AUR .

Device cannot be redirected to a virtual machine

If you use a Windows virtual machine to sync your device via USB, trying to redirect it may fail with a «device is in use by another application» message. This is due to usbmuxd.service starting automatically when the device is connected. This can be solved by either stopping or masking usbmuxd.service .

See also

Источник

Оцените статью
Adblock
detector