Sunday, January 23, 2011

How to install Debian or Ubuntu in Android

New Version


An updated version of this guide is posted here: http://www.nerd65536.com/2011/07/installing-ubuntu-in-android-version-2.html

Choosing Debian or Ubuntu

Ubuntu does not support earlier ARM CPUs like the ones used in the T-Mobile G1 and Motorola Cliq. You need a at least an ARMv7 CPU like the kind found in the Motorola Droid, T-Mobile G2 or most newer phones (Hummingbird, Snapdragon, Tegra2, etc.) 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)".

Debian will work on practically all Android devices, so if you want to run Debian or you can't run Ubuntu, simply replace any instance of "ubuntu" with "debian" in the instructions to follow.

Requirements:


You will need to root your device.

Required Files:

Either android-ubuntu-maverick.7z or android-debian-squeeze.7z.

Required Apps:

BusyBox Installer
A terminal emulator like ConnectBot or Terminal Emulator

Optional Apps:

androidVNC
ConnectBot

Phase 1 - Preinstall:


(Mount the SD card on your computer.)
Extract the .7z file you downloaded to your SD card. You should now have a folder named "ubuntu" on your card.
(Unmount the SD card.)
Open Busybox Installer, and install Busybox.

Phase 2 - Install


Open your terminal emulator. (If using ConnectBot, connect to 'local', not 'ssh'.)
Run the following commands:
su
cd /sdcard/ubuntu
sh install.sh


Ubuntu is now installed.

Phase 3 - Running Ubuntu


Open your terminal emulator.

To start a chroot session
su
ubuntu


To start the SSH server
su
ubuntu 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
su
ubuntu vnc


The first time you run this, 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.
Note: The images come with icewm as the desktop environment. If you wish to replace it, for example, with LXDE
Run the following as root in Ubuntu.
apt-get autoremove icewm- lxde+

Login information:


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

5 comments:

  1. Hey, just wanted to say that your instructions and scripts for this seem to be the cleanest out of all the ones I've tried. I had to modify it slightly for my phone (my phone likes /dev/loopX instead of /dev/block/loopX, and ext4 instead of ext2). Thanks! I like how your scripts are set up for ssh and vnc. I'll probably post a link to this from the XDA board for my phone with my modified startup scripts.

    ReplyDelete
  2. Oh by the way, your ubuntu image has a proxy set up in /etc/apt/apt.conf.d/proxy for http://acme which doesn't exist for most people I think... might want to remove that lol. Still quite helpful though. The ubuntu image actually seems to have much less stuff by default than the debian one. Nice!

    ReplyDelete
  3. I have a motorola Dext, European version of the cliq. I have tried to 'install' both OS, but each time, after running sh install.sh I get
    mount: no such file or directory followed by a whole lot more of the same up to unable to chmod... Install complete. Is there an alternative way around this, or while i never be able to run an OS of this phone?

    ReplyDelete
  4. I had to downgrade my busbox first to 1.7xx.

    Then it finally installed with no problem, but when I type in ubuntu in my terminal, it says not found!

    ReplyDelete
  5. it spits out all kinds of errors saying file or directory not found. i tried both distros and the newer guide and tried busybox 1.7.xx and 1.19. man i wanna get this working so bad. any ideas?

    ReplyDelete