Previous month:
December 2010
Next month:
May 2014

April 2012

Android Playaround : How to install Ubuntu on a Galaxy Tab 10.1 running at the same time with Android?

How much fun would it be if you could run Ubuntu on you Galaxy Tab 10.1 device without any trouble. Nice, right? But how would you feel if you did not have to reboot but run Ubuntu from Linux easily while you are playing Angry Bird or reading news on feedly app? Cool, eh?! You might be thinking we might run Ubuntu on VM ( Virtual Machine )  and that would take a lot of resources and time to boot. Nopes! It would not run from a VM or take up resources. How is that possible? Well it can be done because of a process called CHROOT. Here is a primer.


Since I am a windows user this is quite a big deal, but most Linux users know about CHROOT. Android is a linux based operating system, and Ubuntu is also linux. Here is the wikipedia definition “A chroot on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name (and therefore normally not access) files outside the designated directory tree.”

So once android have booted up, we are already in linux but if we spawn a new process that has the working directory set to Ubuntu distribution then it would run in everything from that installation while the operating system services are already loaded by android. Now if we start the vnc server ( as remote desktop service) and then connect from an android client then we should be able to see Ubuntu screen on android.

Articles on How to

Now there is already a tutorial on the site galaxy tab hacks at this location. (Article 1)

But there are some errors that need to be fixed, you will not be able to run Ubuntu if you follow the tutorial fully. Then following this url would be recommended to fix those issue. (Article 2)

However I am going to merge it down to my experience by putting in correct steps by merging these two.

What we need …

I am assuming that you know what adb is and how to connect via adb. If you do not know please refer to Article 1. I am running ICS on my galaxy tab ( pretty fast ) which is already rooted and have busybox installed. If you don’t have a root just download super one click root and root your tab, and then download the busybox installer from market ( now play) and install.

1. Download this zip file that contains Ubuntu image from here 

2. Extact the zip to a folder in your PC

3. Create a folder in your tab called Ubuntu ( you can create it anywhere, we will create it in /sdcard/ubuntu folder

4. Transfer the contents of the zip to the folder. It has the Ubuntu image a few shell script files that will help us install.

Steps to install CHROOT Ubuntu

5. Connect to the tab via adb by typing “adb shell

6. Go to the folder by typing “cd /sdcard/ubuntu

7. Install by typing “sh”. This will install the shell. Don;t  worry about error messages.

8. Now become the root super user by typing “su”. You might need to do this before step 7, but I don’t remember. If you face issues execute it before step 7.

9. Boot into linux  by typing “bootubuntu”. And instantly you would be in command shell for ubuntu.

10. We want to install vnc server, but for installing we need to update the install catalog. The catalog for update is in a wrong location. Lets update that. The catalog resides in /etc/apt/sources.list Type the following command to delete that list file

rm /etc/apt/source.list

Then create the list file with correct location.

cat > /etc/apt/source.list

Then put the correct location

deb karmic main universe

Now to save file, press control+d twice and then press enter. This will save the above text in the list file.

11. Now update software catalog by typing “apt-get update”. Make sure the tab is connected to the internet.

12. Install open ssh ( optional step, but I did it anyway) “apt-get install openssh-server

13. Now lets setup the vnc server by typing “apt-get install tightvncserver

14. Lets export the user “export USER=root

14. We are almost done, but there is a bug, the keys of the keyboard will be all wrong. So lets fix that. Type “cat > $HOME/.vnc/xstartup” . This will start editing the file. Lets type the following as it is …

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
#x-window-manager &

Just like before press control+d twice and then press enter to save.

15. Start the vnc server by typing “vncserver –geometry 1280x750”. The last part is the screen resolution. You can select any resolution you want.

16. Download android vnc viewer from here. Connect to at 5901 port.You are done.

However if you want to connect to dhcp ( I use static ip on my wireless), type the following

“nmap -p 22 --open -sV”

Connecting from your PC

If we want to connect from your PC, we need to tell it to bind to the static ip.  Use this to start the vnc server “vncserver –geometry 1280x750 –interface x.x.x.x” – replace x.x.x.x with the ip in the wireless. Then connect via any vnc client from to the ip on 5901 port.