[Desire HD Android Development] LeeDroid:
Ububtu for you HTC Desire HD

In June 2010, XDA zedomax got Ubuntu 9.04 running on Nexus One, tutorial is available at this thread:

http://xdaforums.com/showthread.php?t=718952

houzuoguo@XDA then continued studying the tutorial and worked out a way to make Ubuntu 9.04 running better, smoother and cause less errors, here's hes post:

http://xdaforums.com/showthread.php?t=815532

Recently HTC_Linux team has released version 0.3 of their Ubuntu image, compare to the original guide provided by zedomax, the v0.3 release is based on the latest Ubuntu 10.10 and is a WIP, V0.4 is currently undergiong testing.​

What benefits will you get from running Ubuntu 10.10 on your DHD (at least):

1. Fully functional Linux terminal, with all standard Linux command line utilities

2. Fully functional desktop browser Firefox 3.6.13

3. Ability to compile and run native Linux applications

4. Bunch of graphical Internet and utility applications as shown in the screenshots

As promised, here is a little guide to get Ubuntu Desktop running on you DHD, The image used is a WIP and has been built for use with the HTC HD2. the scripts, from the above threads modified by my self to work with the DHD

Credits:

Thanks to the great XDA-developers community.

Thanks to Zedomax for providing the original tutorial of running Ubuntu on Nexus One.

Thanks to HTC_Linux team for creating the optimised Ubuntu 10.10 image file.

Basic requirements

A Rooted HTC Desire HD (Ace)

A MicroSD with minimum 3GB free space

A Custom kernel wit LoopBack support (I have attatched mine :) )

The Below Ubuntu.rar which contains ubuntu.img & the required scripts (modified by my self)

An android terminal emulator -from the market

Android VNC - from the market

If you're using Froyo App2SD, move all your applications which are on SD card back to Internal Storage and ensure FroYo A2SD install location is set to internal(1) by typing #"pm setInstallLocation 1" into your android terminal. If you fail to do so, you won't be able to enter Ubuntu.

LeeDrOiD V2.0.6 custom Kernel - 21/02/11 5:25pm GMT(MultiUpload)

(2.46mb)

MD5# ba511a40ef17352b9a8a35013eb16674

Ubuntu.rar (Torrent)

​

How to​

1. Extract the Ubuntu.rar that you have just downloaded to an "ubuntu" folder on the root of your SD card.

2. Open your Android Terminal Emulator

3. Type “cd sdcard/ubuntu” (enter)

4. Type su to go to superuser mode

3. Type “sh ubuntu.sh

4. If you see “Type 'bootubuntu' to boot Ubuntu”, then you're almost there!

5. Type “bootubuntu” (enter)

6. You should now see “"root@localhost:/#"” Congratulations! Now you're running Ubuntu 10.10

Whenever you want to enter Ubuntu again, simply cd to the ubuntu directory and type “bootubuntu” (enter) in your Android Terminal.

To properly exit Ubuntu, you must type exit from the Ubuntu terminal.

If your Android terminal application gets killed by Android system (i.e. you lost Ubuntu terminal), you need to go back to Android terminal, type “exit” (enter), that will properly unmount Ubuntu.

Very often you can get “loop device busy” error when exiting from Ubuntu, in that case, type “exit” (enter) multiple times (it's harmless to run the“exit” script multiple times, don't worry). If still you get “loop device busy”error, don't worry, just ignore it.

Loading the GUI :D (Gnome desktop) ​

1. Install “android-vnc-viewer” from Market (free)

2. Enter Ubuntu terminal

3. Make sure that you have network connection (Wi-fi recommended)

4. type “apt-get update” (enter), and wait till it finishes

5. type “apt-get install tightvncserver” (enter) and answer “y” to the question

6. After you have installed tightvncserver, type “cd /bin” (enter)

7. Type the following commands (all are case-sensitive!):

“cat > x” (enter)

“rm -r -f /tmp” (enter)

“mkdir /tmp” (enter)

“chmod 777 /tmp” (enter)

“export USER=root” (enter)

“export XKL_XMODMAP_DISABLE=1” (enter)

“vncserver -geometry 1024x800” (enter)

(enter)

(At this point you will need to configure "vol-" as Ctrl in Android terminal emulator preferences)

(Now hold volume down and press D on your keypad)

“chmod 777 x” (enter)

8. The above procedure makes a script named “x”, whenever you want to start GUI, you need to type “x” (enter).

Notice that the first time (only the first time) you run “x” script you'll be prompt to enter a password for VNC connection, then you'll be asked whether to create a “view-only” password, since it is not necessary, answer “n” to the question.

9. Start “android-vnc-viewer”, create a new connection with the following settings:

Nickname: (anything you like to identify the connection)

Password: the VNC connection password that you created when ran the “x”script

Address: localhost

Port: 5901

Color format: 24-bit color (4 bpp)

Click “Connect” button, and in about a minute, you'll see your Ubuntu 10.10 desktop!

10. We still need to create one final script called “s”, now go back to your Ubuntu terminal and type:

“cd /bin” (enter)

“cat > s” (enter)

“export USER=root” (enter)

“vncserver -kill :1” (enter)

“vncserver -kill :2” (enter)

“sudo reboot” (enter)

“sudo halt” (enter)

(enter)

(press and hold Vol- & click “D” on keyboard)

“chmod 777 s” (enter)

11. If you have GUI running, you * MUST * type “s” (enter) to stop VNC server before you exit from Ubuntu terminal!

In case that your Android kills your Android Terminal application and you still have VNC server running, do the following steps:

a. Start Android Terminal

b. type “bootubuntu” (enter) to bring back Ubuntu terminal

c. type “s” (enter) to stop VNC server

d. type “exit” (enter) to exit from Ubuntu terminal

Fail to do so you will have problem with VNC connection next time you use it.

What's not currently working in Ubuntu:

1. Sound

2. Some applications may not run (I guess, due to Android memory management mechanism)

A little trick to access SD card from your Ubuntu:

1. Install “SwiFTP” from Market (freeware)

2. Set up FTP server using SwiFTP

3. In Ubuntu, “Places → Connect to Server” then:

Service type: FTP (with login)

Server: localhost

Port: (port number specified in SwiFTP, default is 2121)

Folder: /

User Name: (user name specified in SwiFTP)

Then press “Connect” and enter your password specified in SwiFTP. Now feel free to access your phone's file system!

This is a rough guide for the time being, I will hopefully continue work on this in the future (time permitting of course)

ENJOY!! :D​