Skip to content

Troubleshooting

Diagnosis by symptom. Each section lists the most likely cause, how to confirm, and how to fix — with copy-paste commands.

If the device is bootlooping

Jump straight to Bootloop. If you don't have SSH/ADB access, hold power ~10 s to force a reboot; enter recovery (Volume Up + Power) and adb sideload a ROM/factory image if needed.

Symptom index


No root

Symptom: every tool says "no root" or asks you to open Magisk.

Confirm:

su -c id
# if it asks for permission on screen and you denied, it fails

Most likely cause: Magisk hasn't granted access to Termux.

Fix:

  1. Open the Magisk app → Superuser tab.
  2. Find Termux in the list.
  3. Tap the key icon and set to Allow.
  4. (optional) Tap the settings next to Termux and set request timeout: 10 minutes or forever — so cron doesn't hang.
  5. Test again: su -c id should print uid=0(root).

If Magisk doesn't show up in the app:

  • Magisk may be hidden (renamed to something like "com.apple.magisk" or similar). Open via the disguised icon.
  • Or root was removed by an OTA update. Reinstall Magisk via recovery.

Touch unresponsive

Symptom: after touch-ctl off, the screen doesn't react to touches.

This is expected behavior. off removes the /dev/input/eventN node; Android stops reading the touchscreen. The screen still shows an image — only touch is disabled.

Recover (in order of preference):

# 1. via SSH (already connected)
ssh user@ip 'touch-ctl on'

# 2. via ADB
adb shell touch-ctl on

# 3. via physical keyboard (OTG or Bluetooth) — open Termux and type
touch-ctl on

# 4. last resort: reboot
# hold power ~10 s; on boot /dev/input is recreated and touch returns

If touch-ctl on fails with "couldn't recreate the node":

# read the saved state
cat /data/local/tmp/touch-ctl.state
# should show EVENT=eventN DEVNUM=maj:min MODE=660 OWNER=0:1004

# recreate manually (replace the values)
su -c 'mknod /dev/input/eventN c MAJ MIN && chmod 660 /dev/input/eventN && chown 0:1004 /dev/input/eventN'

If you don't remember the device name:

su -c 'for d in /sys/class/input/event*/; do echo "$(basename $d): $(cat $d/device/name 2>/dev/null)"; done'

Look for something like touchpanel, fts_ts, goodix_ts, sec_ts — your touchscreen's name.


Swap/ZRAM won't activate

Symptom: createswap --setup-zram 1G fails, or createswap --status shows "State: ❌ Not active".

Confirm:

cat /proc/swaps          # should list /dev/block/zram0
ls -l /dev/block/zram0   # exists?
cat /sys/block/zram0/disksize   # 0 = not configured

Causes and fixes:

Cause Symptom Fix
ZRAM not supported by kernel cat /proc/crypto doesn't list lz4 See supported algorithms: cat /sys/block/zram0/comp_algorithm
mkswap failed createswap log Run with --verbose if available, or switch algorithm (--algo lzo)
swapon denied (root) "Operation not permitted" Confirm you're root: id -u should be 0
Another swap device already active /proc/swaps shows another entry createswap --clear all first
Not enough free RAM for swapoff createswap --clear aborts Free up RAM (close apps), try again

ZRAM disappears after boot:

  • You didn't run --install-boot. Do:
    createswap --setup-zram 1G --install-boot
    

Boot hook ran but ZRAM didn't come up:

# check the log
cat /data/local/tmp/createswap-boot.log

# force a manual re-execution of the hook
su -c 'sh /data/adb/post-fs-data.d/createswap.sh'

Bootloop

Symptom: device reboots in a loop, never reaches the launcher.

If you have ADB:

# enter recovery (Volume Up + Power)
# then, in recovery, enable ADB sideload or shell
adb shell

# disable the createswap hook
touch /data/local/tmp/createswap.disable
# OR remove the hook file
rm /data/adb/post-fs-data.d/createswap.sh

Reboot. If the bootloop was caused by the hook, it should boot normally.

If you don't have ADB (Magisk is hidden and recovery is stock):

  1. Enter recovery (Volume Up + Power).
  2. Do "Wipe cache partition" (NOT wipe data).
  3. Try reboot. If it persists:
  4. "Reboot to bootloader" → fastboot → reflash stock boot.img (without Magisk).
  5. Reinstall Magisk via patch of the boot.img.

If the bootloop started after appctl --profile minimo:

The minimo profile disables SystemUI. The device is probably not bootlooping — it's waiting for SSH because it has no UI anymore. Connect via SSH/ADB and run:

appctl --profile ui    # re-enables SystemUI, launcher, keyboard
# or
appctl --repair --all

SystemUI gone

Symptom: no status bar, no navigation buttons, no notifications. The screen shows only the wallpaper.

Cause: you (or a profile) disabled SystemUI or one of its components.

Confirm:

appctl --repair
# will show SystemUI as "⚠ fixable"

Fix:

appctl --repair --all
# or, just SystemUI:
pm enable com.android.systemui
am force-stop com.android.systemui
# SystemUI restarts on its own

If the launcher is also gone:

pm enable com.android.launcher3  # or your launcher's package

Screen won't change

Symptom: screen-toggle --off says "screen didn't change even after power button".

Causes:

  1. App in foreground blocks sleep (video, navigation, call).
  2. Stay awake active in Developer options → screen stays on while charging.
  3. Accessibility / kiosk mode preventing KEYCODE_SLEEP.

Confirm (2):

settings get global stay_on_while_plugged_in
# 1 = stays on while charging; 7 = always

Fix:

# disable "stay awake"
settings put global stay_on_while_plugged_in 0

# force sleep
input keyevent KEYCODE_SLEEP   # 223
# or power button
input keyevent KEYCODE_POWER   # 26 (not recommended, toggles)

If an app is blocking, force-stop:

# see who's in foreground
dumpsys activity activities | grep mResumedActivity
# force-stop the app
am force-stop <package>

appctl doesn't list

Symptom: appctl --list shows an empty list.

Confirm:

su -c 'pm list packages -U' | head
# if it comes back empty, pm is broken

Causes:

  • No root and Termux can't see packages: rare, but on Android 13+ Go, pm without root sometimes only lists Termux's own apps.
  • pm binary corrupted: rare.

Fix:

su -c 'pm list packages'   # confirm pm works with root
# if it comes back empty even with root, try:
su -c 'cmd package list packages'

If it persists, appctl likely needs to be re-run with explicit root via su -c 'appctl --list'.


rich won't install

Symptom: pip install rich fails with error: externally-managed-environment.

Cause: PEP 668 — pip refuses to install into a system-managed environment.

Fix:

pip install --break-system-packages rich
# or, if you use a virtualenv:
python -m venv ~/venv
source ~/venv/bin/activate
pip install rich
# but you need to activate the venv before each use

Commands vanish

Symptom: after reboot, appctl etc. say "command not found".

Confirm:

ls -l $PREFIX/bin/appctl
# if the symlink points to a non-existent path, it's broken

Causes:

  1. Clone moved: you moved ~/headless-lab to another folder; the symlinks broke.
  2. Clone in ~/storage: shared storage (FUSE) doesn't allow executing scripts — install.sh warns about this.

Fix:

# move the clone into ~
mv ~/storage/headless-lab ~/headless-lab

# reinstall
cd ~/headless-lab && ./install.sh

If you can't move it (permissions), re-clone:

rm -rf ~/storage/headless-lab
git clone https://github.com/C4-Labs/headless-lab.git ~/headless-lab
cd ~/headless-lab && ./install.sh