ADB over Network Doesn't Work in Debian LXC

distaste3750

New Member
Apr 20, 2026
3
0
1
im running proxmox ve 9.1.7 with debian 13 guest. im having issue connecting to android device using adb (android debug bridge) over network, but only in lxc, vms work.
repro steps:
  • install new debian 13 unprivileged lxc and new debian 13 vm
    • default settings
    • i use community scripts but also try manual lxc create
    • i also try privileged debian 13 lxc
  • set network to dhcp if static
  • reboot
  • apt install adb -y
  • adb pair [android ip: pair port] [paircode]
    • both lxc and vm report success
  • adb connect [android ip:adb port]
    • lxc result is failed to connect to [android ip:adb port], adb devices list blank
    • vm connects without issue
fuirther information:
  • the lxc and vm are on same lan as the android device.
  • the lxc run nc -vz [android ip:adb port], which report open.
  • the connection attempt is in logs on the android device, there's nothing useful but i have included it at the bottom.
  • neither of the debians have a firewall enabled.
is ther something in default lxc config or how lxc is setup that would prevent this connection? i run multiple of other services on lxcs and none other have any network/connectivity problem.
if there is more log i can provide i will.

android device log
Code:
  562 I adbd    : New TLS connection [fd=28]
16419 I adbd    : host-28: read thread spawning
16420 I adbd    : host-28: write thread spawning
  562 I adbd    : host-28: already offline
16419 I adbd    : host-28: read failed: Success
16419 I adbd    : host-28: connection terminated: read failed
  562 I adbd    : host-28: offline
  562 I adbd    : destroying transport host-28
  562 I adbd    : BlockingConnectionAdapter(host-28): stopping
  562 I adbd    : BlockingConnectionAdapter(host-28): stopped
  562 I adbd    : BlockingConnectionAdapter(host-28): destructing
  562 I adbd    : BlockingConnectionAdapter(host-28): already stopped
 
Last edited:
Hi,

The device sees a TLS connection attempt, immediately reports already offline, then drops it. This isn't a TCP connectivity problem (nc confirms the port is reachable) — it's an ADB TLS handshake failure. The root cause is almost certainly time skew. ADB over network uses TLS mutual authentication, and TLS certificates are extremely sensitive to clock differences. LXC containers don't have their own kernel and inherit time from the Proxmox host, but unprivileged LXC containers cannot use adjtimex() (the syscall for clock adjustment), which can cause subtle drift or sync failures.
 
hi thanks for your message or thanks chatgpt for your emdash message.

thе clοck іs sаmе/vеry clοsе οn bοth lхc аnd vm. і rаn dаtе οn bοth аnd thеy аrе vеry clοsе аlmοst sаmе sеcοnd. і аlsο stаrt nеw οpеnssl lіstеn sеrvеr οn οthеr mаchіnе wіth οpеnssl s_sеrvеr аnd run οpеnssl -stаtе -dеbug οn lхc whіch rеturn Vеrіfy rеturn cοdе: 0 (οk). so is not clοck іssuе and аll οthеr lхc hаvе nο іssuе wіth clοck аnd pаіr wοrk cοrrеct.

АІ аlsο hаvе suggеst clοck tο mе аnd chаngіng lхc tcр bеhаvіοur but nοthіng wοrk.
 
hm so i talked to chatgpt 5.4 thinking and inadvertently discovered that if run strace before adb it connects?
Code:
root@lxc-adb:~/# adb connect [ip]:[port]
failed to connect to [ip]:[port]
root@lxc-adb:~/# adb kill-server && adb connect [ip]:[port]
* daemon not running; starting now at tcp:5037
* daemon started successfully
failed to connect to [ip]:[port]
root@lxc-adb:~/# adb kill-server && strace -f -o ./adb.strace adb connect [ip]:[port]
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to [ip]:[port]
Killed

i had to kill -9 to get it to stop but it stays connect after

the fail log show
04-23 12:32:43.229 639 711 I adb : tls_connection.cpp:215 [client]: Starting adbwifi tls handshake
04-23 12:32:43.232 639 711 E adb : tls_connection.cpp:282 [client]: Handshake failed in SSL_accept/SSL_connect [invalid library (0)]
04-23 12:32:43.232 639 710 D adb : adb_io.cpp:107 writex: fd=13 len=24 53544c53000000010000000000000000 STLS............

the ok log shows
04-23 12:53:28.628 1089 1098 I adb : tls_connection.cpp:215 [client]: Starting adbwifi tls handshake
04-23 12:53:28.663 1089 1098 I adb : auth.cpp:513 adb_tls_set_certificate
04-23 12:53:28.663 1089 1098 I adb : auth.cpp:533 Checking for fingerprint match