Install linux on android
Contents
Install linux using Andronix
Prerequisite:
- Android Device (Stock unmodified device, no root or custom recovery required)
- These apps :
- Andronix
- termux(An android terminal emulator and linux environment app that works directly with no rooting or setup required.)
- NetHunter-KeX client(connect your kali linux via VNC,can display your kali customing desktop.)
- Hacker’s keyboard
- Caps to Ctrl(Changing your physical keyboard Caps and Ctrl.)
Installation:
- open
andronix
and choose the linux you want to install. - click what you want release linux to install(it auto copy the code)
- open your
terminal
and paste the copy code in step 2. - enter your linux in terminal.
- open the VNC(
vncserver
),enter your vnc passwd - open the app
NetHunter Kex
,choose the connection type UltraVNC, - input the info what you have set in linux.
note:
set your linux:
- set zone
1 2
ls /usr/share/zoneinfo ln -sf /usr/share/zoneinfo/<your Region>/<your City> /etc/localtime
- locale setting
1 2 3 4 5 6
#uncomment:en_US UTF-8,zh_CN UTF-8 vim /etc/locale.gen #create locale locale-gen echo "LANG=en_US.UTF-8" > /etc/locale.conf export LANG=en_US.UTF-8
- set arch locel LANG
open termux ,and then change the file
start-arch.sh
(command=" LANG=C.UTF-8"
tocomand=" LANG=en_US.UF-8"
) - install fonts
1 2 3 4
#english font pacman -S ttf-dejavu #chinese fonts pacman -S wqy-microhei
install some apps:
- login other user vnc
1 2 3 4 5 6 7 8 9 10
useradd -m username passwd username su username vncpasswd //localhost:2 vncserver :2 //search your monitor xrandr --listmonitors //set resolution and scale xrandr --output your-monitor --resulotion ***x*** --scale *x*
some apps
- neovim
1
pacman -S neovim
Install Kali using NetHunter
Prerequisite:
- Android Device (Stock unmodified device, no root or custom recovery required)
- These apps :
- NetHunter store(A installable catalogue of Android apps for penetration testing and forensics)
- f-droid(an installable catalogue of FOSS(Free and Open Source Software) applications for the Android platform.)
- termux(An android terminal emulator and linux environment app that works directly with no rooting or setup required.)
- NetHunter-KeX client(connect your kali linux via VNC,can display your kali customing desktop.)
- Hacker’s keyboard
- Caps to Ctrl(Changing your physical keyboard Caps and Ctrl.)
Installation:
Install the necessary apps from f-droid
- Install the f-droid
- Install the
termux
fromf-droid
- Install the
NetHunter-Kex
fromNetHunter store
- Install the
Hacker's keyboard
fromNetHunter store
- Install the Caps to Ctrl
Install kali linux in termux
open the termux and then execute the following command:
|
|
Usage:
Open termux and type one of following:(nethunter
can be abbreviated to nh
)
Command | To |
---|---|
nh |
start Kali NetHunter command line interface |
nh kex passwd |
configure the KeX passwd(only needed before 1st use) |
nh kex & |
start Kali NetHunter Desktop Experience user sessions |
nh kex stop |
stop Kali NetHunter Desktop Experience |
nh <command> |
run in NetHunter environment |
nh -r |
start Kali NetHunter cli as root |
Tips:
- These commands add
-r
express the nethunter cli as root,eg:nh -r kex kill
:Kill all KeX sessions.- If you run kex in the background (&) without having set a password, bring it back to the foreground first when prompted to enter the password, i.e. via fg
- you can later send it to the background again via Ctrl + z and bg
NetHunter Kex Cli configuration
- Open termux exec the command
nh kex &
, and then keep the output infos in mind. - If you won’t set the kex passwd ,can execute the
nh kex passwd
set the passwd. - open
NetHunter Kex
client app. - New a configuration and input the following configs:
- Connection Type select the
Basic VNC
. - VNC Connection Settings write
localhost:1
,and port5091
(these values in the step 1). - passwd write the passwd that you used the command
nh kex passwd
set. - click the Connect.
- Connection Type select the
- Well Done!
NetHunter Editions:
Please refer to this table for a comparison of the different NetHunter editions.
Tips:
- Run
sudo apt update
&&sudo apt full-upgrade -y
first thing after installation to update Kali. If you have plenty of storage space available you might want to runsudo apt install -y kali-linux-default
as well. - Some utilities like “top” won’t run on unrooted phones.
- Non-root users still have root access in the chroot. That’s a proot thing. Just be aware of that.
- Perform regular backups of your rootfs by stopping all nethunter sessions and typing the following in a termux session:
tar -cJf kali-arm64.tar.xz kali-arm64 && mv kali-arm64.tar.xz storage/downloads
That will put the backup in your Android download folder. Note: on older devices, change “arm64” to “armhf” - Kali Forums
Note:
- If you execute
sudo apt update
&&sudo apt upgrade
orsudo apt full-upgrade -y
,and then maybe cause the following errors:Then you should install tightvncserver to fix it.1 2 3 4
vncserver: No matching VNC server running for this user! vncserver: No matching VNC server running for this user! Error starting the KeX server. Please try "nethunter kex kill" or restart your termux session and try again.
execute tightvncserver:1
sudo apt install tightvncserver
1
tightvncserver
The solution from the reference website.
And then you should replace some comand keyword
kex
with thetightvncserver
.