Installing Ubuntu on Android - An overview
Created: 2012-12-09 by Chad Clark
Synopses:
This is an overview of how I installed Ubuntu 12.04 inside Android so I could work on Go code while in a train tunnel and outside of network coverage. Please note you will not find a detailed list of all of the commands you will need to run on this page.
My setup is a Nexus S running stock Android 4.1.2.
Steps:
- Install Android Terminal Emulator
- Install Complete Linux Installer
- Run the "Complete Linux Installer" and install just the "core" of Ubuntu 12.04.
- Inside the chroot as root run
apt-get install gccgo
- Inside the chroot as root run
apt-get install git emacs23-nox
- Inside the chroot the user named
ubuntu
has the password ubuntu
.
- I had to run
sudo chmod 666 /dev/tty
. Before doing that I was not able to ssh from a non-root account. I ran into this while trying to install my github ssh key.
- I also had to add the new non-root user to all the same groups that the
ubuntu
user is in (other than the ubuntu
group itself) using vigr
and vigr -s
before my new user could access the network. The socket() system call would return EACCES
until I added the groups.
Tips:
- If you enable sshd the you can ssh from a tablet to your phone when the phone is acting as a wifi access point.
- After connecting your Android device to a linux desktop via USB you can forward port 2222 on your desktop to OpenSSH on port 22 on the Android devices by running
adb forward tcp:2222 tcp:22
. This lets you copy & past commands into the shell.
Resources:
- linuxonandroid.org and the wiki.
- The Go language.
- GitHub setup help.