Friday, June 22, 2012

Install Ubuntu / Debian on any Android Phone




This is a Tutorial to install Ubuntu/Debian in any Android mobile.

* Installing Ubuntu or Debian Linux does not format your Android OS or change anything to your phone. The Operating Systems run over the underlying Android OS which continues to function as normal :)

Choosing your Linux OS:                                                             

There are few things you must be aware of before installing Ubuntu/Debian on youe Android Phone
Ubuntu does not support earlier ARM CPUs like the ones used in the Motorola Cliq. Samsung Galaxy Fit (ARMv6), Samsung Galaxy Y, etc.

( Reason behind this is , 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. )

 You need at least an ARMv7 CPU like the kind found in the Motorola Droid, Samsung Galaxy S,HTC EVO 3D, Sony Experia Play, etc. most newer phones (Hummingbird, Snapdragon, Tegra2, etc.).So you can Install Ubuntu if you have  ARMv7 or newer Processor.

If you have ARMV6 or any other moderate Processor don't be sad, because Debian supports the CPU on practically all Android devices, so if you prefer Debian, or you can't run Ubuntu, choose the Debian download link.



* If you're not sure what CPU your device has, look up your device on http://pdadb.net/, click the link under CPU, and read the line for "Supported Instruction Set(s)".

e.g. : My Phone which is a " Samsung Galaxy Fit"  uses ARMV6 Instruction Sets.


Pre-Requirements:                                                                           

Hardware Required:

an Android Phone
SD Card with more than 2GB of free Space

Android root environment:

Most important! Your Android device should be “rooted” because you need root access to run Ubuntu/Debian off your Android. If your device is not rooted you have to root your device.

Linux Operating System:

 Download suitable OS from the following Link:

 
 Ubuntu 11.04 (Natty Narwhal)




  

Ubuntu 11.10 Oneiric Ocelot

     


 

Debian 6.0 Squeeze






Applications Required:
                                                          

A terminal emulator like       Better Terminal Emulator ( Recommended )   or Terminal Emulator.


Optional Apllications:

  
ConnectBot

Procedure:                                                                                         

Step 1:

(Mount the SD card on your computer.)
Extract the .tar.bz2 file you downloaded to your SD card. You should now have a folder named "linux" on the root of your card.
(Unmount the SD card.)
Open Busybox Installer, and install Busybox.
Open Better Terminal Emulator,  and install Better Terminal Emulator.


Step 2:

Open your terminal emulator. (If using ConnectBot, connect to 'local', not 'ssh'.)
Run the following commands:
su

( If Prompt for Superuser Request then allow )



cd /sdcard/linux

sh install.sh



















If you don't see any errors, Linux is now installed.


Step 3:

Open your terminal emulator.

To start a chroot session
su
linux





To start the SSH server
su
linux ssh


You can then use ConnectBot (SSH: user@localhost) on your device, or any SSH client to connect to your device. See Login Information, below.


To start a VNC session

( Firest you need androidVNC to be installed , then type the following in terminal )

su
linux vnc





The first time you run VNC, it will prompt you to create a VNC password.
You can then use androidVNC (host: localhost port: 5901), or any VNC client to connect to your device.


















 Configure The VNC App as follows:



























Note: The default desktop environment is icewm. If you wish to replace it, for example, with LXDE:
Run the following as root in Linux:
apt-get autoremove icewm- lxde+


Secure your Log in Password:

Please remember to change these passwords if you are planning on using the SSH server. Malicious people can do Very Bad things to your device if you don't.
There are two accounts included in the images:
root
Password:cheesecake
user
Password:dessert


After a successful connection to host you will  be able to use Ubuntu / Debian in graphical interface just like in your PC ! It will keep your Android OS as it is and just run in the upper layer over it :)

These are some of the screen shots taken from my Samsung Galaxy Fit!





Linux vs Linux Terminal Emulator :

Terminal Emulator only Emulates Linux terminal, but after Linux Installation you can get full features; more than just the limited commands which runs on Android shell rather than Linux Shell. 

Please Leave your Feedback and Queries below. Thank You  :)

19 comments:

  1. i have galaxy fit too can i use Ubuntu ??????

    ReplyDelete
    Replies
    1. Sorry Bro you can not use Ubuntu as Galaxy Fit uses ARMv6 instruction sets in its ARM Processor.. you have to download the Debian 6.0 Squeeze version to install Linux. ( That's why the post says Ubuntu or Debian )

      Cheers!

      Delete
  2. and i got error in install what can i do ??

    ReplyDelete
  3. should I have to modify my kernel,or install a custom rom if I have to install debian in galaxy fit?

    ReplyDelete
    Replies
    1. You Don't have to update Kernel or Install custom ROM, but u need to root your Device to install Debian in your Galaxy Fit. Cheers !

      Delete
  4. should I have to modify my kernel,or install a
    custom rom if I have to install debian in galaxy
    fit?

    ReplyDelete
    Replies
    1. No need to modify Kernel or Install Custom ROM, but you need to root your Device & you are ready to install Debian. How ever if you are already using Custom ROM it means you are already rooted ;-)

      Delete
  5. hey, i have a Samsung Galaxy Fit... I'm trying to install Debian.

    when i run: sh install.sh in root, i get errors like cannot copy, unable to chmod many files, and cannot create directories. Do you know why this would be happening?

    And thanks for the article! :D

    ReplyDelete
    Replies
    1. You must root your device if you want to do anything.

      So, please first check if your device is properly rooted.

      I think that may be the problem. Check if Debbian 6.0 file is Downloaded properly and copied to your Phone SD. Follow the steps carefully and it will install perfectly!

      Delete
  6. I'am use lenovo s880, can i use ubuntu OS ??

    ReplyDelete
    Replies
    1. Yes you should be able to install Ubuntu, but i haven't tested it in this device so try it out yourself.

      Delete
  7. Hi can i install debian on my galaxy y

    ReplyDelete
  8. Yes! youcan install Debian on your Galaxy Y

    ReplyDelete
  9. When i type
    su
    cd /sdcard/app
    sh install.sh

    it says readfile error or something like that.

    ReplyDelete
  10. My android is young2 s6310
    Rooted
    I cant install ubuntu
    My problem in terminal emulator
    No such file or directory

    ReplyDelete