[HOWTO] All-in-one solution for Ubuntu 10.10 Linux on Android

Search This thread

fire314

Member
Jun 3, 2010
29
43
Links to Ubuntu 10.10 Image and Startup Script (around 1.5GB download):

NOTE: YOU NEED SPEEDMOD KERNEL FOR THE GALAXY S FOR THIS TO BOOT

OTHER USERS ENCOUNTERING ERRORS MAY LIKE TO TRY REMOVING "-o noatime" FROM ubuntu.sh OR RE-INSTALLING THE LATEST BUSYBOX


http://www.megaupload.com/?d=L9S70C8V
http://www.megaupload.com/?d=MS1KUUGW
http://www.megaupload.com/?d=YCMNO224
http://www.megaupload.com/?d=H6XZX9JB

MD5 Sums (in case any of the downloads corrupt)
b243ded14a3e7d96c12a752c1480e9f8 ubuntu.zip.001
e01f7934478062172a4c7a0a4a376b92 ubuntu.zip.002
76d69b740bfb2ddb9c0d26abca969b89 ubuntu.zip.003
567c842b8a9433535665353a26368338 ubuntu.zip.004

Open with 7Zip or similar to unzip.

screenshot.png


What is this?
An ubuntu 10.10 maverick (with LXDE window manager) machine in your pocket. Perfectly usable from the phone itself using a VNC client, this allows you to install any ubuntu software onto your phone and have it with you always. Coupled with the (potential) ability for your phone to be hooked up to a television with TV Out (works with the Nokia TV Out cable available on eBay), and for (supposedly any) HID-compliant bluetooth keyboard and mouse to be linked up to the phone (requires Android 2.2), this really does become a PC in your pocket.

Requirements:
- android phone
- superuser + busybox

Included:
- 3.5GB virtual machine image (ubuntu.img) with ubuntu and certain applications pre-installed (listed below). The image is resizable with uec-resize-image, although FAT32 (the most likely format of your SD Card) has a maximum file size of <4GB.

- A script to boot into ubuntu from android (ubuntu.sh)

- A script to start the VNC Server and other startup commands. This is contained within the ubuntu.img file at /root/init.sh, accessible and modifiable once ubuntu.img has successfully booted.

How to boot:
- Place ubuntu.sh and ubuntu.img in the same directory in your SD storage.
- Enter a terminal and enter 'su' to become a superuser (root).
- Navigate to the directory where you placed the files (e.g. "cd /sdcard/external_sd/ubuntu").
- Execute the script by typing "sh ubuntu.sh".

Tip: Some android terminal emulators (e.g. better terminal) allow you to specify an initial command that is run as soon as you launch the application. Multiple initial commands can be defined by pressing return between each command when you define it, so for example the initial command:

su <return>
cd /sdcard/external_sd/ubuntu <return>
sh ubuntu.sh <return>

will boot you into ubuntu and start the VNC server as soon as you launch the terminal application. All that remains is to VNC into it before you can start using it.

Note: I have noticed that some android apps with process/activity management options (e.g. Spare Parts) possibly interfered with the running of Ubuntu and would kill "inactive" shell emulators (even when they were just idling) - thus killing the idling ubuntu environment. Also, I found it to be at its most stable after a fresh reboot of the phone.

How to connect:
Once you have booted the image (see instructions above), you simply need to fire up your VNC client of choice (androidVNC or pocketcloud VNC are good options), and simply add a new VNC server with address localhost, port 5900, and password 'ubuntu' - then hit connect.

- androidVNC has the advantage of pinch to zoom and generally feels nicer - set colour to 24bpp when adding the connection, and Input mode to touchpad once connected (this sometimes resets and needs re-doing at the start of a session).
- pocketcloud VNC has the advantage that no intermediate text input window is required when doing text input and may be preferred by some people.
- It has been suggested that the Dingul hangul keyboard is good for direct access to common command line characters such as / and * etc. It is however in Korean but can be set to use a QWERTY keyboard.


What software is pre-installed?

Base System (with all updates as of 19/02/11:
Ubuntu 10.10 (Maverick) Core
LXDE (Lightweight Windows-like GUI) with tightvnc server.

Applications (with all updates as of 19/02/11):
Firefox, Thunderbird, openoffice.org suite, GIMP Image Editor, Emacs Text Editor (geared towards programming), C and C++ build-essential, Java JDK, Python, TeXlive and TeXmaker LaTeX editor, Transmission BitTorrent Client, eVince PDF Viewer, File Manager, Terminal, Image Viewer, Leafpad Text Editor, Synaptic Package Manager and Ubuntu Software Center with all repositories enabled (Ubuntu Software Center is pretty and well organized - but bloated and slow), SSH server, Gnash (GNU flash player/plugin for Firefox - as there is no official generla flash pluging for armel CPUs)..

Obviously, you are free to add and remove apps as you see fit (through Synaptic or Ubuntu Software Center)..


I hope people find this useful, and that it works without too many problems.

Martin Rhodes (martin.rhodes@gmail.com, fire314 @ XDA).

Note: If anyone ends up creating a custom ubuntu.img using rootstock, remember to create the directory /data/local/tmp within it as this is where the linux system will be expecting to find its temporary directory if booted (chroot'd) from android - and it is not there by default.
 
Last edited:

syntex123

Member
Jul 2, 2009
21
0
Ok so say I want to call my girlfriend or text her. Will it include GSM/3G, or do I have to use regular Android for that? And Android won't be gone? I have a Galaxy Tab. Really want something different than Android on it, but I want it to function as a phone aswell, since it's my primary phone:)
I'm from Norway btw:p Don't know if that matters.
 

scimitar14

New member
Apr 5, 2009
2
0
I am also very interested in this but am also unable to download the fourth file. I checked out the link provided by ttf above but that version will take a little too much work for me.

Thanks
 

legolas93

Senior Member
Jul 13, 2010
644
1,267
"Please wait while booting ubuntu.img this can take some time..."

I'm stuck.

EDIT: Sorry..But this is my error. I'm waiting for a confirmation message but there isn't. After i tried to connect VNC and it works!.
How can i shoutdown Ubuntu now?
 
Last edited:
  • Like
Reactions: DanWilson

fire314

Member
Jun 3, 2010
29
43
@Syntex123 - You VNC (Remote Desktop) to the Ubuntu FROM your android device, so basically, you access it through a VNC Client on your android, just like any other app - you can switch back and forth between android apps (including of course the one that you make calls from etc.)

I believe there are numerous threads on ubuntu for the galaxy tab, just search "ubuntu on galaxy tab" in the forum search bar.

@Legolas - the file is 3.5GB, but can be resized from within another Linux machine using uec-resize-image. To shut it down, just type 'exit' in the terminal emulator that you started it from and wait.

@ Everyone

The fourth link not working is a general megaupload.com error probably caused due to heavy load. Try again later if you experience it..

Cheers.
 

fire314

Member
Jun 3, 2010
29
43
ubuntu.sh below:

#!/bin/sh
##################################################################
# Ubuntu/LXDE bootscript for Samsung Galaxy S (and others) #
##################################################################
# by Martin Rhodes (fire314)- martin.rhodes@gmail.com #
# compiled with trial and error and help from a number of blogs. #
# credits: coralic, David Jensen, debdroid, blog commenters, XDA #
# Tested on Ultimate 7.0 and Darky 9.3 #
###########################################################################
# to re-enable error output, remove the " > /dev/null 2>&1" from commands #
###########################################################################

echo "WARNING: If you have more than 255 apps installed on the SDCard, then mounting the ubuntu.img will fail!"
echo
echo "Apps on the SDCard associate with an encrypted loop device, and there are only 256 available to the system."
echo
echo "You have to go to Settings -> Manage Applications -> On SDCard, and move some apps back to phone storage in order to free up a loop device for ubuntu. Make sure you reboot the phone after doing this, then try again."
echo
echo "Please wait while booting ubuntu.img.. This can take some time..."
echo
###################################################################################
# export environment variables #
###################################################################################
export HOME=/root
export USER=root
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH
export TERM=vt100
###################################################################################


########################################################
# make directories required by the chroot environment #
########################################################
busybox mkdir /data/local/mnt > /dev/null 2>&1
busybox mkdir /data/local/mnt/proc > /dev/null 2>&1
busybox mkdir /data/local/mnt/sys > /dev/null 2>&1
busybox mkdir /data/local/mnt/dev > /dev/null 2>&1
busybox mkdir /data/local/mnt/dev/pts > /dev/null 2>&1
busybox mkdir /data/local/mnt/sdcard > /dev/null 2>&1
busybox mkdir /data/local/mnt/external_sd > /dev/null 2>&1
########################################################


###########################################################
# create a loop far, far away and mount ubuntu.img on it #
###########################################################
busybox mknod /dev/block/loop255 b 7 255 > /dev/null 2>&1
busybox losetup /dev/block/loop255 ./ubuntu.img > /dev/null 2>&1
busybox mount -o noatime /dev/block/loop255 /data/local/mnt > /dev/null 2>&1
###########################################################


######################################################################
# mount the phone's sdcard storage so it's accessible from ubuntu #
######################################################################
busybox mount -o bind /sdcard /data/local/mnt/sdcard > /dev/null 2>&1
busybox mount -o bind /sdcard/external_sd /data/local/mnt/external_sd > /dev/null 2>&1
#######################################################################


#################################################################
# mount linux system on our chroot environment and chroot to it #
#################################################################
busybox mount -t proc proc /data/local/mnt/proc > /dev/null 2>&1
busybox mount -t devpts devpts /data/local/mnt/dev/pts > /dev/null 2>&1
busybox mount -t sysfs sysfs /data/local/mnt/sys > /dev/null 2>&1
busybox chroot /data/local/mnt /root/init.sh > /dev/null 2>&1
#################################################################


#########################################
# chroot exited: umount everything #
#########################################
echo
echo "Exiting chroot environment and sync'ing memory to storage.."
echo "DO NOT EXIT until finished - doing so may corrupt the ubuntu.img!"
echo
busybox sync
busybox umount -f /data/local/mnt/sys > /dev/null 2>&1
busybox umount -f /data/local/mnt/dev/pts > /dev/null 2>&1
busybox umount -f /data/local/mnt/proc > /dev/null 2>&1
busybox umount -f /data/local/mnt/sdcard > /dev/null 2>&1
busybox umount -f /data/local/mnt/external_sd > /dev/null 2>&1
##########################################
 
  • Like
Reactions: lacik25 and wd5gnr

legolas93

Senior Member
Jul 13, 2010
644
1,267
Yaa...Thank. It's perfectly work :D

Only one problem: i tried to resize the image with the tool said by you.

But every time i try:

uec-resize-image ubuntu.img 2G ubu.img

it gives me an error about "consistency" (or something like this)..Can you help me?.

(Hovewer..Very great work)
 

ttf

Senior Member
Apr 13, 2008
304
71
@fire314

Any chance to perform the same with backtrack distrib or a more minimalistic one?

What about doing the same with another "android rom img" as a virtual environment to test different roms? (i'm actually trying to do so)

Edit:
Thanks for the .sh
 
Last edited:

fire314

Member
Jun 3, 2010
29
43
Yep - it's full blown Ubuntu so Wine will work fine! But because it's using VNC sound doesn't work...
 

mathijs727

Senior Member
Oct 29, 2010
232
18
Badhoevedorp
I just tried to run ubuntu, and i got al the messages within a blink of a eye.
Then tried to connect using 2 VNC programs, and both couldn't connect.

So it's bugged, or it's fake.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 36
    Links to Ubuntu 10.10 Image and Startup Script (around 1.5GB download):

    NOTE: YOU NEED SPEEDMOD KERNEL FOR THE GALAXY S FOR THIS TO BOOT

    OTHER USERS ENCOUNTERING ERRORS MAY LIKE TO TRY REMOVING "-o noatime" FROM ubuntu.sh OR RE-INSTALLING THE LATEST BUSYBOX


    http://www.megaupload.com/?d=L9S70C8V
    http://www.megaupload.com/?d=MS1KUUGW
    http://www.megaupload.com/?d=YCMNO224
    http://www.megaupload.com/?d=H6XZX9JB

    MD5 Sums (in case any of the downloads corrupt)
    b243ded14a3e7d96c12a752c1480e9f8 ubuntu.zip.001
    e01f7934478062172a4c7a0a4a376b92 ubuntu.zip.002
    76d69b740bfb2ddb9c0d26abca969b89 ubuntu.zip.003
    567c842b8a9433535665353a26368338 ubuntu.zip.004

    Open with 7Zip or similar to unzip.

    screenshot.png


    What is this?
    An ubuntu 10.10 maverick (with LXDE window manager) machine in your pocket. Perfectly usable from the phone itself using a VNC client, this allows you to install any ubuntu software onto your phone and have it with you always. Coupled with the (potential) ability for your phone to be hooked up to a television with TV Out (works with the Nokia TV Out cable available on eBay), and for (supposedly any) HID-compliant bluetooth keyboard and mouse to be linked up to the phone (requires Android 2.2), this really does become a PC in your pocket.

    Requirements:
    - android phone
    - superuser + busybox

    Included:
    - 3.5GB virtual machine image (ubuntu.img) with ubuntu and certain applications pre-installed (listed below). The image is resizable with uec-resize-image, although FAT32 (the most likely format of your SD Card) has a maximum file size of <4GB.

    - A script to boot into ubuntu from android (ubuntu.sh)

    - A script to start the VNC Server and other startup commands. This is contained within the ubuntu.img file at /root/init.sh, accessible and modifiable once ubuntu.img has successfully booted.

    How to boot:
    - Place ubuntu.sh and ubuntu.img in the same directory in your SD storage.
    - Enter a terminal and enter 'su' to become a superuser (root).
    - Navigate to the directory where you placed the files (e.g. "cd /sdcard/external_sd/ubuntu").
    - Execute the script by typing "sh ubuntu.sh".

    Tip: Some android terminal emulators (e.g. better terminal) allow you to specify an initial command that is run as soon as you launch the application. Multiple initial commands can be defined by pressing return between each command when you define it, so for example the initial command:

    su <return>
    cd /sdcard/external_sd/ubuntu <return>
    sh ubuntu.sh <return>

    will boot you into ubuntu and start the VNC server as soon as you launch the terminal application. All that remains is to VNC into it before you can start using it.

    Note: I have noticed that some android apps with process/activity management options (e.g. Spare Parts) possibly interfered with the running of Ubuntu and would kill "inactive" shell emulators (even when they were just idling) - thus killing the idling ubuntu environment. Also, I found it to be at its most stable after a fresh reboot of the phone.

    How to connect:
    Once you have booted the image (see instructions above), you simply need to fire up your VNC client of choice (androidVNC or pocketcloud VNC are good options), and simply add a new VNC server with address localhost, port 5900, and password 'ubuntu' - then hit connect.

    - androidVNC has the advantage of pinch to zoom and generally feels nicer - set colour to 24bpp when adding the connection, and Input mode to touchpad once connected (this sometimes resets and needs re-doing at the start of a session).
    - pocketcloud VNC has the advantage that no intermediate text input window is required when doing text input and may be preferred by some people.
    - It has been suggested that the Dingul hangul keyboard is good for direct access to common command line characters such as / and * etc. It is however in Korean but can be set to use a QWERTY keyboard.


    What software is pre-installed?

    Base System (with all updates as of 19/02/11:
    Ubuntu 10.10 (Maverick) Core
    LXDE (Lightweight Windows-like GUI) with tightvnc server.

    Applications (with all updates as of 19/02/11):
    Firefox, Thunderbird, openoffice.org suite, GIMP Image Editor, Emacs Text Editor (geared towards programming), C and C++ build-essential, Java JDK, Python, TeXlive and TeXmaker LaTeX editor, Transmission BitTorrent Client, eVince PDF Viewer, File Manager, Terminal, Image Viewer, Leafpad Text Editor, Synaptic Package Manager and Ubuntu Software Center with all repositories enabled (Ubuntu Software Center is pretty and well organized - but bloated and slow), SSH server, Gnash (GNU flash player/plugin for Firefox - as there is no official generla flash pluging for armel CPUs)..

    Obviously, you are free to add and remove apps as you see fit (through Synaptic or Ubuntu Software Center)..


    I hope people find this useful, and that it works without too many problems.

    Martin Rhodes (martin.rhodes@gmail.com, fire314 @ XDA).

    Note: If anyone ends up creating a custom ubuntu.img using rootstock, remember to create the directory /data/local/tmp within it as this is where the linux system will be expecting to find its temporary directory if booted (chroot'd) from android - and it is not there by default.
    6
    For anyone wondering, this is crazy easy...

    Preinstallation:
    1) Download all the files from here: http://goo.gl/bltOF. (Please add to OP as a mirror)
    2) Put them into a folder called "ubuntu".
    3) Plug your phone in and mount USB.
    4) Drag and drop the whole folder onto your sdcard.
    5) Open the Android Market and download these apps:
    Android Terminal Emulator by Jack Palevich
    chart

    Links: Device | Desktop

    android-vnc-viewer by androidVNC team + antlersoft
    chart

    Links: Device | Desktop

    Installation:
    1) Open "Android Terminal Emulator"
    2) Type in the following commands in order:
    Code:
    $ su
    # cd /sdcard/ubuntu
    # sh ubuntu.sh
    3) Ignore the message and press the home button.
    4) Open androidVNC and enter these settings:
    Nickname:
    Password: ubuntu
    Address: localhost
    Port: 5900
    Color Format: 24-bit color (4 bpp)
    5) Press "connect".
    6) If it did not connect, wait 5 minutes and try again.
    7) Once connected, press the MENU button.
    8) Press "Input Mode" and select "Touchpad"
    9) Enjoy!
    10) When you want to exit entirely, open up Android Terminal Emulator (yes, there will still be text everywhere) and enter the command:
    Code:
    exit


    Everytime after doing this the first time, Ubuntu will boot in seconds (literally, faster than I could find my androidVNC app ;P ).
    2
    You sir, are my hero! I couldn't get those files to work for the life of me until you gave me these AMAZING links. Downloading right now, I hope to get this running today. Thank you so much. :)

    No problem, that's what XDA-Developers is all about.
    2
    ubuntu.sh below:

    #!/bin/sh
    ##################################################################
    # Ubuntu/LXDE bootscript for Samsung Galaxy S (and others) #
    ##################################################################
    # by Martin Rhodes (fire314)- martin.rhodes@gmail.com #
    # compiled with trial and error and help from a number of blogs. #
    # credits: coralic, David Jensen, debdroid, blog commenters, XDA #
    # Tested on Ultimate 7.0 and Darky 9.3 #
    ###########################################################################
    # to re-enable error output, remove the " > /dev/null 2>&1" from commands #
    ###########################################################################

    echo "WARNING: If you have more than 255 apps installed on the SDCard, then mounting the ubuntu.img will fail!"
    echo
    echo "Apps on the SDCard associate with an encrypted loop device, and there are only 256 available to the system."
    echo
    echo "You have to go to Settings -> Manage Applications -> On SDCard, and move some apps back to phone storage in order to free up a loop device for ubuntu. Make sure you reboot the phone after doing this, then try again."
    echo
    echo "Please wait while booting ubuntu.img.. This can take some time..."
    echo
    ###################################################################################
    # export environment variables #
    ###################################################################################
    export HOME=/root
    export USER=root
    export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH
    export TERM=vt100
    ###################################################################################


    ########################################################
    # make directories required by the chroot environment #
    ########################################################
    busybox mkdir /data/local/mnt > /dev/null 2>&1
    busybox mkdir /data/local/mnt/proc > /dev/null 2>&1
    busybox mkdir /data/local/mnt/sys > /dev/null 2>&1
    busybox mkdir /data/local/mnt/dev > /dev/null 2>&1
    busybox mkdir /data/local/mnt/dev/pts > /dev/null 2>&1
    busybox mkdir /data/local/mnt/sdcard > /dev/null 2>&1
    busybox mkdir /data/local/mnt/external_sd > /dev/null 2>&1
    ########################################################


    ###########################################################
    # create a loop far, far away and mount ubuntu.img on it #
    ###########################################################
    busybox mknod /dev/block/loop255 b 7 255 > /dev/null 2>&1
    busybox losetup /dev/block/loop255 ./ubuntu.img > /dev/null 2>&1
    busybox mount -o noatime /dev/block/loop255 /data/local/mnt > /dev/null 2>&1
    ###########################################################


    ######################################################################
    # mount the phone's sdcard storage so it's accessible from ubuntu #
    ######################################################################
    busybox mount -o bind /sdcard /data/local/mnt/sdcard > /dev/null 2>&1
    busybox mount -o bind /sdcard/external_sd /data/local/mnt/external_sd > /dev/null 2>&1
    #######################################################################


    #################################################################
    # mount linux system on our chroot environment and chroot to it #
    #################################################################
    busybox mount -t proc proc /data/local/mnt/proc > /dev/null 2>&1
    busybox mount -t devpts devpts /data/local/mnt/dev/pts > /dev/null 2>&1
    busybox mount -t sysfs sysfs /data/local/mnt/sys > /dev/null 2>&1
    busybox chroot /data/local/mnt /root/init.sh > /dev/null 2>&1
    #################################################################


    #########################################
    # chroot exited: umount everything #
    #########################################
    echo
    echo "Exiting chroot environment and sync'ing memory to storage.."
    echo "DO NOT EXIT until finished - doing so may corrupt the ubuntu.img!"
    echo
    busybox sync
    busybox umount -f /data/local/mnt/sys > /dev/null 2>&1
    busybox umount -f /data/local/mnt/dev/pts > /dev/null 2>&1
    busybox umount -f /data/local/mnt/proc > /dev/null 2>&1
    busybox umount -f /data/local/mnt/sdcard > /dev/null 2>&1
    busybox umount -f /data/local/mnt/external_sd > /dev/null 2>&1
    ##########################################
    1
    I'm very interested.

    How much space i need in the sdcard?

    And..Can you rescue the link from megaupload?

    Thank