Use adb (android debug bridge) in systemd-nspawn container
1
vote
1
answer
452
views
I would like to use adb inside an systemd-nspawn container. Unfortunately I cannot access the phone inside the container (connected via USB).
pi@debian-buster-64:~ $ export ADB_TRACE=usb
pi@debian-buster-64:~ $ adb devices
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
pi@debian-buster-64:~ $
Here is the container setup /etc/systemd/nspawn/debian-buster-64.nspawn:
[Exec]
PrivateUsers=no
Capability=CAP_NET_ADMIN
[Files]
Bind=/home
Bind=/run/user:/run/host-user/
BindReadOnly=/etc/resolv.conf
[Network]
Private=no
VirtualEthernet=no
Here is the output from lsusb from inside the container:
pi@debian-buster-64:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 009: ID 045e:07b2 Microsoft Corp. 2.4GHz Transceiver v8.0 used by mouse Wireless Desktop 900
Bus 001 Device 010: ID 18d1:4ee7 Google Inc.
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Output of lsusb is identical to the output on the host and the phone (Google Inc.) is visible.
I want to use adb inside the container because the container is 64bit (host is only 32bit). Unfortunately, adb on 32bit has limitations. Access with adb works on the host (with said 32bit limitations). Any ideas how to get this working inside the container?
Asked by alex1452
(11 rep)
Dec 11, 2020, 04:49 AM
Last activity: May 2, 2025, 12:03 PM
Last activity: May 2, 2025, 12:03 PM