Install and Run Ubuntu on your Android!! | UbuntuCafe

Install and Run Ubuntu on your Android!!

Before we can start make sure that your Android device is "rooted" because you need root access to run Ubuntu off your Android.

We will be running Ubuntu “chrooted” under Android OS, which just means that we will be running a “virtual” Ubuntu OS that runs on top of the Android OS.  Your Android OS will work fully (e.g. your phone will keep working normally) while the Ubuntu runs on top of it.

your Android OS must support loop devices.  Most newer Android smartphones/tablets come with this support so we can mount our Ubuntu image as a loop device.  If not, you will either have to build your own kernel with support for loop devices or you can try an aftermarket ROM for your phone as most aftermarket ROMs come with support for it.
Install Ubuntu on Android!

First of all you have to download the ubuntu.zip file. After download completes,  extract it your home folder. Then you will get a folder named Ubuntu. Copy that folder to your SD card.
Download ubuntu.zip

(Turn USB storage ON then copy over the Ubuntu folder to the root directory of your SD card.)
 *Note : You must have Android SDK installed on your computer.
Make sure your Android phone is in debugging mode and also USB tethering mode enabled.
Go to Settings->Applications->Development and make sure USB Debugging is checked ON.
Go to Settings->Wireless & network settings-> Tethering & portable hotspot and make sure USB tethering is checked ON.

Connect your Android device to your computer via USB cable and set the USB mode to “Debugging”.

Open your Terminal & type
cd /usr/bin/android-sdk-linux/tools/

(Please note that I have installed Android-SDK in my /usr/bin/android-sdk-linux/ folder)
Type "adb devices"


It should return name of the phone and manufacturer. Otherwise try to reinstall Android-SDK and perform the same.

Type “adb shell” to enter the Android shell.

Then type “su” to enter super user mode, then type “cd /sdcard/ubuntu” to enter the ubuntu directory in your SD card of your Android device.


Next, type “sh ubuntu.sh” to run the script which will basically get your Ubuntu image ready to run on your Android smartphone.


It will shows some error messages, no matter... keep going
Then type "bootubuntu".



If you got “root@localhost” at this point, congratulations!  This means your Android OS comes with loop device support and Ubuntu is now running “chrooted” on top of your Android OS!!!

Next time you enter Ubuntu, you just need to type “bootubuntu” from your /sdcard/ubuntu directory, no need to run ubuntu.sh again.

****************************************************************************
Once you’ve got Ubuntu running on your Android device, it’s time to install some Ubuntu packages.

Type “apt-get update” to update, this is the first thing you will need to do before installing any new programs.

Install openssh-server on your Android

If you want to connect to your Android Ubuntu via an IP address (and SSH into it), you will need to install this.


apt-get install openssh-server

This will install openssh-server on your Android.

Next if you want to access the GUI of your Android Ubuntu, you can install TightVNCServer, which allows you to access the Android Ubuntu via Android VNC app on your Android or even access it remotely from your desktop computer.


#apt-get install tightvncserver 
Once you have finshed installing , start the VNCserver.
Type
#export USER=root
#vncserver -geometry 1024x800 (This will set the screen resolution)
Now you will be prompted for the password. Choose an 8 character long password and press Enter.
Now your TightVNCServer is ready to accept any incoming connections from your phone or computer.  Just point to the correct IP address and use port number 5901 to connect.

Now I am going to connect Android-Ubuntu with my PC.
(I am using ubuntu 12.04 in my PC).

Before connecting with VNCserver, we need to check what is the Ip address of Ubuntu on the Android.
Open a Terminal (Alt+ctrl+T) on your PC.
Then type "ifconfig" , it will display the Ip address of Android ubuntu. (USB0)

Next connect to the VNCserver.
Open Dashboard and search for "Remote Desktop client"
Open the application and set the ip address that we go from the ifconfig.
Set the port to 5901
Then press connect...
It will asked for the VNCserver password. Enter it..!
Finished.. You've got Ubuntu running on your Android..enjoy....!!!!!!!!
  
To shutdown the Ubuntu, just type "exit" in the Terminal and press Enter.