[Guide] How to install Ubuntu Linux on your phone [1.0 Coming Soon]

What Kernels did you get Ubuntu to run on?


  • Total voters
    25
Status
Not open for further replies.
Search This thread

unCoRrUpTeD

Senior Member
Mar 22, 2010
1,707
238
Fort Worth, TX
Ok - I've been wanting to up the size of the ubuntu.img - and here's what I found on how to built it -

http://androlinux.com/android-ubuntu-development/how-to-build-chroot-arm-ubuntu-images-for-android/

Guess I'm going to pop open a virtual machine on a spare PC, install a sandboxed Ubuntu, see if I can decompose ubuntu.img (so as to retain the changes I have), then simply re-assemble into a larger ubuntu.img file.

If anyone's done this and has any tricks to share, please lay 'em on me! :)

Otherwise, I'll keep you all posted - sure wish I'd found this yesterday when I had the time to goof off more! :p

PS - Left questions at the dev's site asking for tips.

Do it from your phone

Code:
adb reboot
adb shell busybox df -h /dev/block/mmcblk1p1 <-----[make sure you have enough free space]
adb shell
cd /sdcard/ubuntu
mv ubuntu.img oldubuntu.img
dd if=/dev/zero of=ubuntu.img bs=1024000 count=XXXX <-----[XXXX is the size in MB you want]
mke2fs ubuntu.img <------[answer "y" if it ask if you want to proceed]
losetup /dev/block/loop1 ubuntu.img
losetup /dev/block/loop2 oldubuntu.img
mkdir ubuntu
mkdir oldubuntu
mount -t ext2 /dev/block/loop1 ubuntu
mount -t ext2 /dev/block/loop2 oldubuntu
cp -a oldubuntu/* ubuntu
umount ubuntu
umount oldubuntu
reboot

Now check and make sure you can access ubuntu
If so then you can delete oldubuntu.img
 
  • Like
Reactions: EarlyMon

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,297
Do it from your phone

Code:
adb reboot
adb shell busybox df -h /dev/block/mmcblk1p1 <-----[make sure you have enough free space]

(snipped for brevity)

Now check and make sure you can access ubuntu
If so then you can delete oldubuntu.img

Completely straightforward, obvious and elegant. Very well done, sir! :)

I see that /dev/block/mmcblk1p1 is correct - but I am most curious how you swam upstream and found that?

Was is just just obvious that all internal was mmcblk0 then the SDcard had to be mmcblk1 and the first partition was up next?
 

evilvoice

Senior Member
May 4, 2008
923
569
Conyers GA
I noticed we are using 9.10, would it be better to upgrade to 10.10 at least or maybe getting 11.04? There is a post about 10.10 running on galaxy s and an hd2, and 11.04 for xoom and thunderbolt. Just wondering if it is better to stay with an old version or use a newer one (sometimes newer consumes more space for not a huge benefit)
 
  • Like
Reactions: EarlyMon

unCoRrUpTeD

Senior Member
Mar 22, 2010
1,707
238
Fort Worth, TX
Completely straightforward, obvious and elegant. Very well done, sir! :)

I see that /dev/block/mmcblk1p1 is correct - but I am most curious how you swam upstream and found that?

Was is just just obvious that all internal was mmcblk0 then the SDcard had to be mmcblk1 and the first partition was up next?

In this case yes. I have been working on some things and need the actual block address for the sdcard. Once I knew eMMC was at /dev/block/mmcblk0, the sdcard had to be at /dev/block/mmcblk1. And its easier than typing in /dev/block/vold/179:65.
 
  • Like
Reactions: EarlyMon

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,297
In this case yes. I have been working on some things and need the actual block address for the sdcard. Once I knew eMMC was at /dev/block/mmcblk0, the sdcard had to be at /dev/block/mmcblk1. And its easier than typing in /dev/block/vold/179:65.


Cool. :)

OK - so here's the thing - it's my memory. Truth is - it pretty much sucks. Between that and copy and paste, I'm liable to screw up just about anything.

So - I've decided to script all of this.

I just couldn't wrap my head around using the fat32 SDcard for the unix mount points - even if that works, it just made me all ooogly to go that route. So I took your instruction and made the mount points on /data/local/ubuntu (just like bootubuntu) and cleaned my way out when done.

So, here's the deal:

  • Back up your ubuntu.img to your PC before starting (along with anything else)
  • run the script as a bash script, not as shell
  • I put mine in /sdcard/ubuntu
  • You can put yours somewhere in /system in your path and then just execute when you want - be sure that the first line is pointing to your bash and that you chmod the file correctly in the first place

What it does:

  • Asks if you've really just rebooted
  • Checks your free /sdcard space
  • Sets the minimum size at 2150 MB
  • Reduces the available free size by 500 MB (just for safety)
  • Prompts you for the size you want
  • Answer not Y for the boot question, or give it any grief over the size of the new image file, and it bails on you
  • Runs unCoRrUpTeD instructions and automagically answers the mke2fs question for you

Here's the script, I called mine /sdcard/ubuntu/ubuntu_sizer.sh
Code:
#! /system/bin/bash

# bash script to resize the ubuntu.img file used for Ubuntu on Android
#
# Real work on how to do this by unCoRrUpTeD at XDA
#    (http://twitter.com/#!/unCoRrUpT3d) - see:
# http://xdaforums.com/showpost.php?p=16455543&postcount=101
#
# Interactive stuff added by EarlyMon (XDA, Android Forums) 2011 Aug 9

clear
echo "Ubuntu image resizer - Please be root!"
echo
echo "It is imperative that you ONLY run this immediately AFTER rebooting!"
echo -n "Tell the truth - did you just now reboot? [y/N] "
read rebooted

if [[ !( "$rebooted" =~ [Yy] ) ]]; then
   echo "OK, try again after reboot, exiting."
   exit
fi

cd /sdcard/ubuntu

sd_free=`df /sdcard | awk '{print $6}' | sed s/K$//`
# Convert to MB
sd_free=$[$sd_free/1000]
# Reserve 500 MB as a safety measure
sd_free=$[$sd_free-500]

ubuntu_size=`ls -l ubuntu.img | awk '{print $4}'`
ubuntu_size=$[$ubuntu_size/1000000]

# Pick a lower limit here for the image size
minimum=2150

echo  "Existing Ubuntu image size: $ubuntu_size MB"
echo  "Free space on SDcard: $sd_free MB"
echo -n "Target size in MB? (minimum: $minimum) "
read target

if [[ "$minimum" < "$target" && "$target" < "$sd_free" ]]; then

   echo "Resizing ubuntu.img to $target MB"
   echo
   echo "Beginning resize - will reboot when done."
   echo "Test ubuntu.img when complete - discard oldubuntu.img if happy"
   echo
   echo "Please be patient - image creation will take several minutes"
   echo
   echo "mke2fs prompt will be answered automagically"
   echo

   if [ ! -d /data/local/ubuntu ]; then
      mkdir /data/local/ubuntu
   fi
   MOUNT=/data/local/ubuntu

   mv ubuntu.img oldubuntu.img
   dd if=/dev/zero of=ubuntu.img bs=1024000 count=$target

# DO NOT modify the indentation of the following herefile
#   DO NOT allow trailing spaces after either use of the word
#   END_HEREFILE -- be especially cautious of this with copy/paste

   mke2fs ubuntu.img << END_HEREFILE
y
END_HEREFILE

   # Strictly cosmetic
   echo "y"

   losetup /dev/block/loop1 ubuntu.img
   losetup /dev/block/loop2 oldubuntu.img
   mkdir $MOUNT/ubuntu
   mkdir $MOUNT/oldubuntu
   mount -t ext2 /dev/block/loop1 $MOUNT/ubuntu
   mount -t ext2 /dev/block/loop2 $MOUNT/oldubuntu
   cp -a $MOUNT/oldubuntu/* $MOUNT/ubuntu
   umount $MOUNT/ubuntu
   umount $MOUNT/oldubuntu
   rmdir $MOUNT/ubuntu
   rmdir $MOUNT/oldubuntu
   reboot

else
   echo "$target is not a good size"
   cd -
   exit
fi

How to run:
Code:
cd /sdcard/ubuntu
su
bash ubuntu_sizer.sh


How it looks after it's run:
Code:
# cd /sdcard/ubuntu
# bash
bash-4.1# bash ubuntu_sizer.sh

Ubuntu image resizer - Please be root!

It is imperative that you ONLY run this immediately AFTER rebooting!
Tell the truth - did you just now reboot? [y/N] y
Existing Ubuntu image size: 2147 MB
Free space on SDcard: 2964 MB
Target size in MB? (minimum: 2150) 2500
Resizing ubuntu.img to 2500 MB

Beginning resize - will reboot when done.
Test ubuntu.img when complete - discard oldubuntu.img if happy

Please be patient - image creation will take several minutes

mke2fs prompt will be answered automagically

2500+0 records in
2500+0 records out
2560000000 bytes transferred in 614.510 secs (4165920 bytes/sec)
mke2fs 1.41.11 (14-Mar-2010)
ubuntu.img is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
156480 inodes, 625000 blocks
31250 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=641728512
20 block groups
32768 blocks per group, 32768 fragments per group
7824 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912

Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[COLOR="Blue"]EarlyMon$ <---this is the kickout to my machine after reboot[/COLOR]

Hope this helps!

Tested this all the obvious ways, worked for me.

Your mileage may vary. If in doubt, nandroid and then back up entire SDcard to PC.

This takes a LONG while to run. Just trust it, don't baby it. ;)

Cheers!

PS - I always forget about here-strings, so, oh well.
 
Last edited:
  • Like
Reactions: twospirits

donnyevo4g

Senior Member
Jun 25, 2010
179
32
West Caldwell
I need help when i type bootubuntu i get this error message

sh-3.2# bootubuntu
/system/bin/bootubuntu: line 13: mknod: command not found
/system/bin/bootubuntu: line 14: losetup: command not found
mount: Invalid argument
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
/system/bin/bootubuntu: line 20: sysctl: command not found
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
/system/bin/bootubuntu: line 22: /data/local/ubuntu/etc/resolv.conf: No such file or directory
/system/bin/bootubuntu: line 23: /data/local/ubuntu/etc/resolv.conf: No such file or directory
Setting localhost on /etc/hosts
/system/bin/bootubuntu: line 25: /data/local/ubuntu/etc/hosts: No such file or directory
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
/system/bin/bootubuntu: line 29:

chroot: command not found

Shutting down Ubuntu
failed.
failed.
failed.
failed.
losetup: dev/block/loop1: no such device or adress
 

unCoRrUpTeD

Senior Member
Mar 22, 2010
1,707
238
Fort Worth, TX
I need help when i type bootubuntu i get this error message

sh-3.2# bootubuntu
/system/bin/bootubuntu: line 13: mknod: command not found
/system/bin/bootubuntu: line 14: losetup: command not found
mount: Invalid argument
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
/system/bin/bootubuntu: line 20: sysctl: command not found
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
/system/bin/bootubuntu: line 22: /data/local/ubuntu/etc/resolv.conf: No such file or directory
/system/bin/bootubuntu: line 23: /data/local/ubuntu/etc/resolv.conf: No such file or directory
Setting localhost on /etc/hosts
/system/bin/bootubuntu: line 25: /data/local/ubuntu/etc/hosts: No such file or directory
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
/system/bin/bootubuntu: line 29:

chroot: command not found

Shutting down Ubuntu
failed.
failed.
failed.
failed.
losetup: dev/block/loop1: no such device or adress
Did you run ubuntu.sh first.
Then try installing busybox from the market.

Sent from my PG86100 using XDA App
 

donnyevo4g

Senior Member
Jun 25, 2010
179
32
West Caldwell
yes i ran sh ubuntu.sh first and i installed busybox from the market and installed it and then i even installed busybox installer and installed it again im stuck idk whats goin on
 

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,297
yes i ran sh ubuntu.sh first and i installed busybox from the market and installed it and then i even installed busybox installer and installed it again im stuck idk whats goin on

Please feedback the results of the following commands - maybe something will stand out and help resolve this -

Code:
set
ls -l /system/bin/mount
ls -l /system/xbin/mount
 

donnyevo4g

Senior Member
Jun 25, 2010
179
32
West Caldwell
THIS IS WHAT I GOT FROM WHAT YOU TOLD ME TO PUT IN

C:\SDK>cd platform-tools

C:\SDK\platform-tools>adb shell
sh-3.2# set
set
ANDROID_ASSETS=/system/app
ANDROID_BOOTLOGO=1
ANDROID_DATA=/data
ANDROID_PROPERTY_WORKSPACE=9,65536
ANDROID_ROOT=/system
ASEC_MOUNTPOINT=/mnt/asec
BASH=/system/bin/sh
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="2" [2]="0" [3]="7" [4]="release" [5]="arm-none-linux
-gnueabi")
BASH_VERSION='3.2.0(7)-release'
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/bouncycastle.jar:/sys
tem/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.
policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar:/syst
em/framework/com.htc.commonctrl.jar:/system/framework/com.htc.framework.jar:/sys
tem/framework/com.htc.android.pimlib.jar:/system/framework/com.htc.android.easop
en.jar:/system/framework/com.scalado.util.ScaladoUtil.jar:/system/framework/com.
orange.authentication.simcard.jar:/system/framework/android.supl.jar
COLUMNS=80
DIRSTACK=()
EUID=0
EXTERNAL_STORAGE=/mnt/sdcard
GROUPS=()
HISTFILE=//.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOSTNAME=localhost
HOSTTYPE=arm
IFS='
'
LD_LIBRARY_PATH=/vendor/lib:/system/lib
LINES=24
LOOP_MOUNTPOINT=/mnt/obb
MACHTYPE=arm-none-linux-gnueabi
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=linux-gnueabi
PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
POSIXLY_CORRECT=y
PPID=153
PS1='\s-\v\$ '
PS2='> '
PS4='+ '
PWD=/
SHELL=/bin/sh
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:posi
x
SHLVL=1
TERM=dumb
UID=0
_=/system/bin/sh
sh-3.2# ls -l /system/bin/mount
ls -l /system/bin/mount
lrwxrwxrwx root root 2011-08-10 11:58 mount -> toolbox
sh-3.2# ls -l /system/xbin/mount
ls -l /system/xbin/mount
lrwxrwxrwx root root 2011-08-10 11:58 mount -> /system/xbin/bus
ybox
sh-3.2#
 

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,297
Thanks, let's keep looking.

Here are the results I get for two more checks -

Code:
# ls -l /system/bin/sh

-rwsrwxrwx root     shell       82840 2011-05-23 08:32 sh

# ls -l /system/bin/toolbox

-rwsrwxrwx root     shell       81544 2011-05-23 08:32 toolbox

Also - is there any way you've replaced your sh with bash? (The set command results suggest that you have.)

And by the way, I'm running a later bash that I got here -

http://roycormier.net/2010/11/03/how-to-cross-compile-bash-for-android/

I've been running that bash when invoking bootubuntu, and I suppose that matters because bootubuntu doesn't start with a shebang (#!) definition, so it's going to run under your current shell.
 
Last edited:

donnyevo4g

Senior Member
Jun 25, 2010
179
32
West Caldwell
ok now you got me confused alot im almost 100 precent sure i didnt replace sh and i tryed entering ther code you gave me but notthing happened and what is bash im so confused can you walk me threw it please will donate i just want ubuntu on my phone!
 

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,297
ok now you got me confused alot im almost 100 precent sure i didnt replace sh and i tryed entering ther code you gave me but notthing happened and what is bash im so confused can you walk me threw it please will donate i just want ubuntu on my phone!

Think of this as a book with big glowing letters on the front in an unusually friendly font saying "Don't Panic" - and I apologize, I assumed a bit much. No prob, let's try again - please tell me what happens when you execute these two commands (safe to copy and paste now):

Code:
ls -l /system/bin/sh*
ls -l /system/bin/toolbox
 
Last edited:

donnyevo4g

Senior Member
Jun 25, 2010
179
32
West Caldwell
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Donny>cd\

C:\>cd c:sdk\platform-tools

C:\SDK\platform-tools>adb shell
sh-3.2# ls -l /system/bin/sh*
ls -l /system/bin/sh*
lrwxrwxrwx root root 2011-08-10 11:58 sh -> /system/bin/bash
-rwsrwxrwx root shell 82840 2008-08-01 08:00 sh0
-rwsrwxrwx root root 1506792 2011-08-10 12:51 sha1sum
-rwsrwxrwx root root 1506792 2011-08-10 12:51 sha256sum
-rwsrwxrwx root root 1506792 2011-08-10 12:51 sha512sum
-rwsrwxrwx root root 1506792 2011-08-10 12:51 showkey
-rwsrwxrwx root shell 18164 2008-08-01 08:00 shutdown
sh-3.2# ls -l /system/bin/toolbox
ls -l /system/bin/toolbox
-rwsrwxrwx root shell 81544 2008-08-01 08:00 toolbox
sh-3.2#
 

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,297
OK, good news, we are going to get you squared away right quickly.

I just would like to see one more thing:

Code:
ls -l /system/bin/bash
 

danaff37

Senior Member
Mar 14, 2010
2,959
900
Nashville, TN
It looks like the script is looking for those commands (losetup and mknod) in system/bin, but they're in system/xbin. Yet his path when he runs the set command is said to include xbin. So either he needs to source the script, or run bash first instead of using bash in its sh compatibility mode

So do this... Run bash first, i.e.

bash
bootubuntu

If still no go, try this next (while still in bash)

export PATH="/system/xbin:$PATH"
. bootubuntu


Sent from my PG86100 using XDA App
 

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,297
It looks like the script is looking for those commands (losetup and mknod) in system/bin, but they're in system/xbin. Yet his path when he runs the set command is said to include xbin. So either he needs to source the script, or run bash first instead of using bash in its sh compatibility mode

So do this... Run bash first, i.e.

bash
bootubuntu

If still no go, try this next (while still in bash)

export PATH="/system/xbin:$PATH"
. bootubuntu


Sent from my PG86100 using XDA App

Yes, exactly.

Actually, I'm able to recreate his results by running as user, not root.

I was going to direct him to unlink his sh from that older bash and restore it to its rightful place, install a newer bash that I know works, and then have him su into sh and run bootubuntu.

That way, he'll have a bash and an sh that recognizes the commands properly and avoids the path redefinition.

I'm running mount using toolbox in /system/bin and it works without a hitch.

mknod and losetup aren't in /system/bin (or rather, they shouldn't be for us) and his path already includes /system/xbin so he should be able to get them properly once squared away.

I think we need to get donny to a base configuration that makes sense.

Redirecting sh to bash is popular, but causes these sort of errors (and others) when assumptions are made.

I really hate that someone who isn't familiar with bash has this non-standard config in the first place.

My fear is he'll take a shortcut to get it working and then get these sorts of problems will follow him whenever he goes to try the next thing.

Thoughts?
 
Last edited:

donnyevo4g

Senior Member
Jun 25, 2010
179
32
West Caldwell
ok it didnt work but it changed my symbol in terminal from what it was to just # and when i put the command in ln -s /system/xbin/bash-arm bash it says link failed file exists

and i tryed to bootubuntu and i got the same error as i did before so were getting somewere just not there yet
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 26

    Sorry guys this no longer works...
    Ubuntu removed alot of the files needed to run it on a phone off of their website which is why you are getting the errors on the script to try and install it.
    Recapped:
    Here's what I mean the website the script is going to to get the files no longer exists...
    Heres an example to see for yourself: http://ports.ubuntu.com/ubuntu-ports/pool/universe/t/tightvnc/tightvncserver_1.3.9-4_armel.deb

    I will try and find a new link to plug in but for now it DOES NOT WORK!

    Thank you for your patience on the thread,
    StrumerJohn










    ==== How to Install Ubuntu Linux on your HTC EVO 3D / Sensation 4G ====

    Table of Contents

    Post 1
    1: Disclaimer
    2: Pre Requirements
    3: PC Guide to push to phone
    4: MAC Guide to push to phone
    5: Additional Scripts
    6: Credits
    Post 2
    1: FAQs
    2: Recognitions
    Post 3
    1: News and Updates
    2: Additional Notices
    -Disclaimer-
    This has been tested on my phone and runs perfectly fine, I am not responsible for you breaking, bricking, or dropping your phone on the floor and causing the USB cable to fall out and blow up your device.




    Pre Requirements:

    A rooted HTC EVO 3D or Sensation 4G
    A S-off'd HTC EVO 3D or Sensation 4G

    netarchy's kernel (Silverneedle Test5)
    Android SDK
    The USB drivers for your phone. (x32) (x64)
    A microSD Card
    2.3 GB Free of space on your microSD card
    Know how to read to directions


    The intense Procedure:

    1. Download this version of Ubuntu. [Download #1] [Download #2]

    2. Unzip the Ubuntu folder to your desktop and if you want, delete the compressed one you downloaded.

    3. On your phone go to Settings > Applications > Development and turn on USB debugging.

    4. Plug in your USB cable (from your computer to your phone) and mount your (mirco)SD card.

    5. Move or copy over the unzipped / normal Ubuntu folder. This will take a long time unless you have a class10 microSD card.

    6. After moving / copying that file over, tell your phone to unmount the (micro)SD card / Set the phone to Charge Only mode.

    7. Now on your computer, go to where you have Android SDK installed. (Example on my computer: E:\Program Files (X86)\Android\android-sdk )

    8. When in the main SDK folder, hold shift and right click a blank area and then click on "open command window here". It should of opened the command line window with the directory of your SDK already put in. If not type cd "C:\Your directory or location of your SDK"

    9. Now type "cd platform-tools"

    9.5. (Optional) "type adb devices" and check if the computer recognizes your phone. If not you need to reinstall your drivers from the download link above in the requirements.

    10. Type "adb shell"

    11. Type "su" so we have superuser permissions

    12. Type "cd /sdcard" so the directory is changed to the (micro)SD card

    13. Type "cd ubuntu" so the directory is changed to the Ubuntu File

    14. Type "sh ubuntu.sh" so we can install Ubuntu

    15. Type "bootubuntu" to start up Ubuntu. Next time you enter Ubuntu, you just need to type "bootubuntu" from your /sdcard/ubuntu directory, there is no need to run ubuntu.sh again.

    16. If you got "root@localhost" in the command line, you have sucessfully installed Ubuntu. If not make sure you installed netarchy's kernel. If it still does not install correctly please try a different ROM, I have only tested this on SteelROM 1.1. *AFTER INSTALLING ANY ROM, YOU NEED TO REINTALL THE KERNEL.*

    17. Now type "apt-get update" to update Ubuntu to the latest version. Then "apt-get upgrade" to apply the update.

    18. Type "apt-get install tightvncserver" to install the vncserver. (Your telling your phone to read off it self pretty much.)

    19. Type "export USER=root" To make yourself a user / the user

    20. Type "vncserver -geometry 1024×800" to set the screen resolution you want to display on your phone. Remember you can always zoom in by pinching, so you don't need to make this that much smaller. You should also get prompted to set a password, do so. You will need to remember this password to log in.

    21. Download the AndroidVNC Viewer off the Market here.

    22. Open the viewer, and put in a nickname, your PASSWORD FROM ABOVE, and for the IP Address put: 127.0.0.1 :D for the port put 5901. THEN SCROLL DOWN and make the COLOR FORMAT 24-bit colors (4bpp).
    And finally, hit Connect to launch Ubuntu on your phone!

    For Mac users:



    Finder -> Applications -> Utilities (folder) -> Terminal

    When you cd to where your adb is located, cd is lowercase as are most all unix commands.

    If you're unsure where to go, get to adb in your Finder, right-click, get info, the pop-up will show you the path. Note in unix that the folders (subdirectories) are separated by / and not by \ like in Windows.

    Once you're there, the only trick you need to know is to tell unix that adb is located where you are, so you change the adb shell command like this:

    ./adb shell

    That's about it, all other instructions once you're inside the phone shell are the same.

    OBTW - after the unzip of the initial file from the OP, just drag and drop the whole ubuntu folder to your NO NAME drive (normal sd card formatting doesn't get a name at the factory, so by now you know that your sd card mounts like that anyways I'd suppose - just put it here in case).

    Additional Scripts

    Danaff37's

    That's the script catted out.

    I posted a different script a few pages back that I think will help you guys. I modified it so we should have no trouble with apps in sd.. I finally got a bigger sdcard so I can test this stuff and this script works great. Please guys try this script. If you download it in phone it will change the name and add a bin on it I think, so rename it accordingly and make sure it gets into /system/bin with the right permissions (755 or rwxr-xr-x), then run it

    http://db.tt/gin57Gd


    Sent from my PG86100 using XDA App



    Credits:
    Ubuntu Modded and Guide by: Me
    Mac Guide Written by: EarlyMon
    danaff37's Script by : danaff37 (of course)
    Original dev of Ubuntu: Zedomax

    If you have any problems beside the slow downloads because of the blown up servers, let me know below. Also I tried to type this fast, so if there is any typo's or broken links let me know too! Thanks!

    Also feel free to hit the Thanks button or Donate for more Guides :)
    6
    FAQS

    FAQS

    Do I need to have everything in the android-sdk downloaded and installed?
    No, you just need to have the base sdk.

    When I tell the command prompt to adb devices, my phone does not show up!!
    Make sure you have installed the proper drivers for your phone and for your correct operating system

    I'm not getting "root@localhost" when I type / copy-&-paste "bootubuntu"
    Well, this could be for a various amount of reasons, first make sure you have a rooted HTC EVO 3D/Sensation. And by root, I mean a full root, not just a temp root or S-off. If you still do not get "root@localhost", flash your device (or go though your data folder and delete all the ubuntu files, then delete the ubuntu file off of your sd card and clear your caches.), and retry the above steps. If the problem still persists, then please PM me with your exact problem.

    I'm having issues within the VNC, and I get an error message when I hit "connect".
    Make sure you typed your password correctly, the passwords are case sensitive. If you still cannot get in, make sure your IP Adress is set to "127.0.0.1" and your Port(s) are "5901".

    The colors on my screen look all weird and disorientated, how do I fix this?
    Close Ubuntu, and re-open the VNC application, then scroll down to "Color Format" and tap on "24-bit color (4 bpp)".

    The on-screen keyboard does not work and I get a different letter or character for whatever character I type!
    The on-screen keyboard will work now, if you install LXDE.

    I'm not good with reading text! I need a video demonstration!
    For a video head here: http://www.youtube.com/watch?v=YbunTRzEQCI

    How do I close Ubuntu?
    Two options here:
    1.Logout of the server and go to your homescreen and push menu, then go to settings, then Applications, then Running Services and close any remaining open part of the server program. The service may re-open later, do not close it though. It won't use up a noticable amount of RAM, just enough to make sure the application opens quick again.
    2. Logout of the server and use your favorite task killer to close the server process. The service may re-open later, do not close it though. It won't use up a noticable amount of RAM, just enough to make sure the application opens quick again.


    FAQS should be in order chronologically (until the end of them).​

    I would like to give a huge thanks to EarlyMon, for helping out lost members. This thread would not be as peaceful if it were not for him.
    And it seems I have forgotten to list another VERY helpful person here, danaff37. I am really grateful to both of these two for all of the help and work they have done to aid others.



    Am I missing a question that you are pretty sure is asked ALOT (lol)? Then PM me please and I'll get it up here ASAP!
    6
    Upcoming Change log for final release:
    (StrumerJohn's Zedomax Ubuntu Mod)
    Made a launchable .exe for easier updating and installing of Ubuntu
    Default mode LXDE for fixed keyboard
    Pushes Server application to your phone
    Fixed a few problems that caused people to have an error in installing
    Server application updated
    Fixed port issues for log in errors

    News update 11/13/11
    Bad news and Good News:
    Ubuntu was successfully updated
    Update brakes keyboard
    Update breaks Apps2SD
    Update takes up less space (1GB instead of 2GB)
    Update ONLY works on MIUI so far
    Updated script to add work around for those facing issues
    Computer .exe only working on x64 Windows 7 computers ;-;
    Thank you for those of you testing! :) Might make this open Beta...!

    Version as of 12/12/11
    Alpha Build 1.0

    What Doesn't Work so far:
    Boots to latest version only to lock up phone (Unless you are running MIUI)
    Keyboard borked
    Doesn't work on ICS
    Audio Broken
    Apps Saved on SD

    What works:
    Everything else
    3
    EarlyMon, in getting multiple clients, is there a way to do this with lxde and not icewm? Also, what does multiple clients get me? Are you saying you can only run one program at a time in the vnc? or would this allow me to connect to the server with the phone, laptop, desktop, whatever all at the same time? Just wondering if this is a change I need to make.

    Also, I believe you said it, but I wanted to agree with you that this whole thing can be done from Terminal Emulator on the android phone - no need for a pc at all.

    Sorry for the unclear wording. :eek:

    I'm getting a related question at Android Forums, so I'll lay out the whole deal here. Hopefully, this will cover the space for everyone.

    1. Clients

    You can mange to get two vnc clients running - one on your phone and one on a laptop, for example - but the way this is configured, you'll see the same thing in each - they will mirror each other. Because of the limited resources, I wouldn't try to fix this, but it's something you can tinker with.

    But the word client only means something in terms of the server being discussed. So, let's call a vnc client/server running setup a "vnc session" and move on to desktop clients:

    When I complained of missing multiple clients, I was not configured properly - in my vnc session I could launch a terminal client or a web client on my desktop, but not both. danaff37 squared me away.


    2. Desktops and Window Managers

    The default X11 desktop is a gray field where you can see your mouse move and that's it, nothing more. Most people are sunk if that's all they get, so it's best to configure X11 startup to configure a richer, more useful desktop.

    The first thing you need is a window manager, it's not really optional. You have two choices that are easy to get to, and others if you can find and install them. The easy ones are:

    • X Window Manager
    • IceWM

    You need more than a plain gray field with nothing you can interact with, so there are two things you can do:

    • Just declare an X startup that launches at least one useful client, like an X terminal, and that's all you'll see on your plain gray field, and then elaborate from there
    • Go with a more modern desktop that you're probably used to or can adapt to easily

    You want the way described in the second bullet. Again, there are two choices that are easy to get to, and others if you can find and install them. The easy ones are:

    • GNOME
    • LXDE

    GNOME comes with the ubuntu.img distribution here. It's what most people are used to, but it comes at a price - it uses more resources and the touchscreen keyboard won't work.

    LXDE - the Lightweight X11 Desktop Enviroment - you have to install separately. It's not as rich and pretty as GNOME, but everything works, including most touchscreen keyboards. It's stable, it's been around since 2003 and it very much reminds me of the KDE 1.0 or 2.0 desktop, circa 1998~2000 (as best I can remember - that was a ways back ;)).

    While the Evo 3D packs a lot of silicon for a phone, it's not so much compared to a modern laptop, and so because I like things working and know I can trust a lighter desktop, I went with LXDE.

    How to install LXDE:

    • apt-get install lxde

    This will include a basic IceWM and is really all you need.

    If you would like the full IceWM and be able to go town on that - including being able to just run the plain, single-screen, gray X desktop with just some X clients floating on it, then by all means install the full IceWM (but I won't be advising on that configuration, I've not run one of those since something like '93 or '94, so Google is your friend on that). That said, here's your full IceWM install:

    • apt-get install icewm

    But like I said, I didn't bother with that.


    3. How to Configure

    So, I changed my startup file so that it's a usable template, as self-explanatory as I know how to make it. This is on the Ubuntu side, get to the right area after running bootubuntu.

    Here is /root/.vnc/xstart -

    Code:
    #!/bin/sh
    
    xrdb $HOME/.Xresources
    xsetroot -solid grey
    
    # Here's the holdover that will just launch an X terminal on your plain
    # X desktop, it came commented out, just avoid it, but leave it for maybe.
    #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    
    # I don't think using IceWM with GNOME is a good idea, but you can use
    # either one with LXDE.
    # Chose your window manager by uncommenting only one of the following lines.
    
    #x-window-manager &
    
    icewm &
    
    # Chose your desktop, the first will launch GNOME, the second, LXDE.
    # Uncomment only one.
    
    #/etc/X11/Xsession
    
    startlxde &

    I like to be able to just have my vnc server start by running the bootubuntu command from Terminal Emulator. (Note my screen shot of this on Android Forums shows a cd to /sdcard/ubuntu, I hadn't realized at the time that was unnecessary due to it being installed under /system.)

    I added some lines to my .bashrc file. This is on the Ubuntu side, get to the right area after running bootubuntu.

    .bashrc is long enough and I expect people to know how to manage that. Here is the top and only the top of my /root/.bashrc -

    Code:
    # ~/.bashrc: executed by bash(1) for non-login shells.
    # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
    # for examples
    
    # If not running interactively, don't do anything
    [ -z "$PS1" ] && return
    
    export USER=root
    cd /
    rm -r -f tmp
    mkdir tmp
    cd /
    vncserver -geometry 960x540
    
    # don't put duplicate lines in the history. See bash(1) for more options
    #export HISTCONTROL=ignoredups
    
    <rest of stock .bashrc follows from here>

    As you can see, I simply added:

    Code:
    export USER=root
    cd /
    rm -r -f tmp
    mkdir tmp
    cd /
    vncserver -geometry 960x540

    I'm not going to be responsible for other .bashrc changes, sorry.

    I've mentioned earlier in the thread why I chose the native resolution over 1200x800 - and I still recommend that whatever you chose, you're best to consider something with a 16x9 ratio. No disrespect at all to the instructions - I would not be here without StrumerJohn - but his recommendation comes from the original days before we had qHD displays. Besides, he mentioned in the OP that chosing resolution was optional to your needs.


    4. Installation

    If you already grokked what the OP install steps were doing when you read them, you can interject the above steps where appropriate.

    Otherwise, just play it safe and do all of this after you have the OP's stuff working and happy for you.

    ~~~~~~~~

    Note to StrumerJohn - if you think this is in any way worthy, suggest you just quote this or reference it in your original instructions. That way, you retain the righteousness and I'll retain the support for this stuff - but, do as you see fit, after all, it's Open. ;)

    PS, if anyone cares and if you've missed it, I have my screen shots and a relationship diagram beginning at this post over on AF -

    http://androidforums.com/evo-3d-all-things-root/387978-ubuntu-linux-3vo.html#post3040572

    ~~~~~~~~~

    PPS - Guess I just can't pass up showing what an old BSD guy living in the desert uses for wallpaper. ;)

    wallpapered-lxde.jpg
    2
    "Upgrade" Step 17

    Step 17 should be "apt-get update && apt-get upgrade"