I’ve had several people asking me about running Linux on Android in the last few months, but I did not look into it into details, because I thought we would just be able to run server apps. That is until Rohith left a comment on CNX Software Facebook timeline, that it’s possible to run Linux in Android, and access the user interface via VNC (sort of simple, but I did not think of it). You probably need at least 1GB of memory and a multi-core processor to run this sort of setup correctly, so I finally decided to give it a try by running Ubuntu 12.04 with Unity interface in ODROID-X development board.
I mainly followed the instructions available at http://linuxonandroid.org/ and inside the Android app. Most of the steps I followed can also be replicated on other rooted Android hardware platforms. Apart from Ubuntu 10.04 & 12.04, you can also install Debian and Backtrack distributions.
Updating Android, rooting and installing the Play Store on ODROID-X
Since I hadn’t used the board since August, I decided to update Android to the latest version. This step is optional, and if you’re using another device, you can completely skip this section. I’m using an eMMC with my board, if you want to boot from SD card, following the instructions on hardkernel forums.
- ODROID-X_eMMC_image_14-Nov-2012.zip) and extract it
- Enter into fastboot mode.
If you have any, remove your SD-card and make sure JP2 is unconnected.
- If you have the USB-UART kit, press any key within 3 seconds in your terminal software after power on, and enter ‘fastboot’ in u-boot prompt.
- If you don’t have the USB-UART kit, press & hold the “user” button (SW3) of ODROID-X board and power on, and after 6~7 seconds, release the button.
- Connect your board to the host PC with a micro-USB cable.
- If you don’t have it, install fastboot on your host PC . (Instructions)
- Copy the kernel, ramdisk and system images to the eMMC module:
fastboot.exe flash kernel zImage fastboot.exe flash ramdisk ramdisk-uboot.img fastboot.exe flash system system.img
- Reboot and let Android perform the update
In order to run Linux in Android, you’ll need a rooted device and the Play Store app to install relevant applications.
Due to legal reasons, Hardkernel can’t install Google Play Store in the image they provide, but they can provide instructions to do so:
- Copy the file to the /system directory
adb push gapps-ics-20120429-signed\system /system
- Reboot the system to complete the installation
Setting Up Android to Run Ubuntu
This is where the instructions to prepare your rooted Android system to run Ubuntu or another Linux distribution start.
- Install Complete Linux Installer from Google Play.
- Start the application, click on Install Guides, and select your OS (e.g. Ubuntu 12)
- Follow the instructions:
- Download one of the Ubuntu images via http or bittorrent. There are 3 images:
- Core Ubuntu Image – ~200MB to download and 750MB once extracted. It includes the basics without GUI.
- Small Ubuntu Image – ~400MB to download and 2GB once extracted. It includes LXDE desktop
- Large Ubuntu Image – ~1.3GB to download and 3.5GB once extracted. This image features the Unity interface as well as a range of other programs such as Firefox and LibreOffice
However, the http link did not seem to work in Android, and the current version of Android ofr ODROID-X is known to hang during p2p downloads, so I decided to download the “Large Ubuntu Image” (Torrent or http) on my PC.
- Install the Android VNCViewer App.
- Install the Android Terminal Emulator App.
Running Ubuntu in Android
We’ve now got all the required components and are ready to run Ubuntu in Android.
- Go back to Complete Linux Installer main menu, click on Launch, and if the path is OK, you can just click on Start. If you run from SD card in ODROID-X, you’ll need to create a new config or edit the image path to /mnt/ext_sd/ubuntu/ubuntu.img.
- As you click on Start, the app will launch the Android Terminal, and for the very first boot, a script will check the image checksum (it will take a while), ask you to provide a password for Ubuntu user, ask if you want to start VNC and SSH server, request the size screen (1360×720 in my case), and finally ask if you want to save the settings, before entering the Linux shell. At this point, you are already using Ubuntu.
- Start VNC Viewer, enter the connection nickname, password, address (localhost), port (5900) and username (ubuntu). For better looking graphics, I chose 24-bit color depth (4 bpp).
- Click Connect, wait for the Ubuntu to show up and start a few applications.
At first, I ran Ubuntu from a cheap SD Card, and the desktop came very slowly, but I still decided to launch Libre Office 3 Writer… It took over 5 minutes. So I decided to copy the Ubuntu image to the eMMC module. Ubuntu become more responsive, and Libre Office 3 Writer launched within 20 to 45 seconds the few times I tested (after “reboot’ each time).
You can watch the video below to see the step required to start (and stop) Ubuntu in Android, and assess the performance in ODROID-X board.
This method does not offer the great integration or performance that would be available with Canonical’s Ubuntu for Android, but it’s still usable as long as you use a fast storage device, and I can imagine this being useful for people who need to access application not available on Android, such as Libre Office for Android, and edit office files from their phones when they don’t have access to a computer.