Fix NH-Terminal (NetHunter Terminal) to reliably launch the Kali chroot on modern Magisk using the Magisk CLI — no su, no Termux paths, no -c: not found.
# from Termux or adb shell
bash scripts/fix-nh.sh
# then open the Kali profile in NH-Terminal- NH-Terminal shows
line 35: -c: command not found (code 127)on launch. - Editing random 'kali' scripts doesn't help because NH-Terminal uses its own launcher.
- Forwarding to Termux's boot-kali fails (
inaccessible or not found) due to app sandboxing. suinside NH-Terminal is missing — modern Magisk exposesmagiskCLI instead.
We replace the app's launcher at:/data/data/com.offsec.nhterm/files/usr/bin/kaliwith a tiny shim that runs:
MAGISK su --mount-master -c "/system/bin/chroot /data/local/nhsystem/kalifs /bin/bash -l"
Where MAGISK is auto-detected (/debug_ramdisk/magisk, /sbin/magisk, or $(magisk --path)/magisk).
bash scripts/fix-nh.sh
cp scripts/kali /data/data/com.offsec.nhterm/files/usr/bin/kali
chmod 755 /data/data/com.offsec.nhterm/files/usr/bin/kali
sed -i 's/\r$//' /data/data/com.offsec.nhterm/files/usr/bin/kali
Open Kali in NH-Terminal → you should be at root@kali.
magisk --path # e.g. /debug_ramdisk
$(magisk --path)/magisk su --mount-master -c id
If that fails, enable Allow external apps in Magisk settings and ensure NH-Terminal/NetHunter are not on DenyList.
- NH-Terminal may restore its original launcher only on a cold start. If so, run
scripts/fix-nh.shagain. - To hide the minimal-login banner inside Kali:
touch ~/.hushlogin
- code 126 "No such file" (file exists): wrong shebang → use
#!/system/bin/sh. su not found: never use plainsu; use the Magisk CLI as shown.Bad system call (159): missing--mount-masteror broken chroot. Reinstall chroot via NetHunter app.- CRLF^M:
sed -i 's/\r$//' /path/to/script.
- Original investigation & fixes by Dylan & thanks to Aravind Potluri (CIPH3R) for his boot-kali script
- License: MIT.