0

I have an Ubuntu docker image and I have installed the following packages

sudo apt install libimobiledevice6 libimobiledevice-utils

I am also running in privileged mode and mounting the /dev inside the docker container

-v /dev/:/dev/ --privileged"

However if I send

idevicepair pair

I get as answer:

"No device found, is it plugged in?"

Invoking "lsusb" inside the container also lists the device correctly.

The same packages and interactions are working fines outside docker where the device is actually found. Any ideas?Thank you!

zambs
  • 21
  • 8
  • A Docker container can't normally access the host hardware devices, and if there are host daemons like udev that do USB setup, the container can't access them. You say the program runs successfully on the host; rather than disabling Docker's isolation features, is simply running the program outside a container a viable option? – David Maze Jan 27 '23 at 14:04
  • Hi thanks for your feedback.Still I don't understand how a similar Android counterpart (Android Debug Bridge) can access and control the phone with no issues inside the container. One would expect the limitation to be the same for Android and iOS devices. I can think of a workaround for my specific use case (collecting syslog from the ios phone) . It consist in pairing and start the syslog utility outside the container and use a a file in a shared volume between the host pc and docker container to access the system logs. But it is unfortunately just a workaround. – zambs Jan 31 '23 at 07:04

1 Answers1

1

Heyo!

I actually was trying this myself, i got it working by doing the following:

docker run --rm -it -v /var/run:/var/run --entrypoint=/bin/bash debian:unstable-slim

apt update && apt install -y usbmuxd libimobiledevice6 libimobiledevice-utils libavahi-compat-libdnssd-dev curl wget

idevicepair pair

Credit/Source: https://github.com/hkfuertes/altserverd/blob/master/docker-compose.yaml#L23

Macley
  • 101
  • 6
  • Yes that totally works , thanks a lot! So what seems to be missing is the "-v /var/run:/var/run" option. Even "-v /dev/:/dev/ --privileged" are not necessary for the command to work inside the docker container – zambs Feb 22 '23 at 13:34