Rooting Nexus 4
A guide here.
You can make backup images with nandroid.
Useful Apps after Rooting
Android Terminal Emulator
Wi.cap Network Sniffer
Apps for Security
Installing Kali in Your Android
Need to be rooted.
Need to have USB debugging on.
Need to have enough free space (~5 GB) on the SD card.
Apps to be Installed
Open Linux Deploy and choose a new distribution (Kali). Change all the configuration you want.
Clique in "Install". It will take around 10 minutes.
Once it is ready, launch it and log in either from the terminal or from the GUI.
Logging in from the GUI:
Open AndroidVNC and choose a new configuration with
Nickname: android password: changeme address: your android ip port: 5900 username: username chosen from the installation color format: 24-bit local mouse pointer, and force full-screen
Connect and Done!
Logging in from the Terminal
$ ssh android@YOURIP $ sudo su $ df $ apt-get update
Don't forget to close the connection in the Linux Deploy when you are done.