How to install Ubuntu on your Nexus One

Original author: NexusOneHacks.net
  • Transfer
image



This guide is for those who want to install Ubuntu as a subsystem on their Nexus One or any other Android device (with open root rights, of course). I tried to make it as simple as possible so that no one would have any questions.
As you can see, I used the Nexus One with root privileges. On other Android devices, the installation process may differ, but slightly. In the end, you won’t try - you won’t know;)
I’m also working on launching Ubuntu on my HTC Evo 4G and a little later I’ll publish the launch guide on HTCEvoHacks.com
You can also try running Ubuntu as the main system on a Nexus One or other Android device, but this will most likely mean that the device cannot be used as a phone, and the camera may stop working. It will be most practical to run Ubuntu on top of Android, which I will show.
Installing Ubuntu will in no way affect Android. Ubuntu will run in the background as an Android VNC application.
Why do I need to install Ubuntu on top of Android? And then, that it will be possible to run Linux applications on your phone! For example, this can be useful to programmers - it is unlikely that someone will compile x86 applications for Android, but under Ubuntu it is quite possible. Yes, and if desired, the phone can be turned into a compact web server.
And there are no reasons why you need to install Ubuntu specifically on the Nexus One, so you can experiment with other OSes and devices. Just keep in mind that most Android devices use ARM processors, which means you cannot run systems under x86 or x86-64 platforms on them.

Translator's note: I did not translate individual pieces of the article, such as “what is chroot?”. I think this is clear to everyone.

So, how do you install Ubuntu on Android?


First of all, download ubuntu.zip ( from here or from here ) and unzip it.
1. You will need root rights on your device. If you don’t know what it is and how to get it, google a little (for Nexus One it is described here ).
2. You will need to install the latest Busybox for this guide .
3. You will need the Android SDK, which you can download from here .
Copy the files from the archive to the phone’s memory card in the ubuntu folder, and then unmount the memory card (Turn off USB storage) on the device.
image
4. Make sure that USB debugging mode is enabled on the device (settings -> applications -> development), and the animal itself is connected to the computer via USB.
5. Now we will need to start the ADB console. Open the directory with the Android SDK in the console, go to the tools directory and run the command “adb shell” (or “sudo ./adb shell” if you have Linux). If you saw the # symbol, then you did everything correctly.
image
6. Enter the “su” command to enter root mode. If it swears and displays an error, it means that you still did not get root rights on your device and you need to google on this topic.
7. Using the command “cd / sdcard / ubuntu”, we will go to our folder with Ubuntu and start the installation with the command “sh ./ubuntu.sh”.
image
8. When the program confirms its operation and you see an empty line with a # sign at the beginning, run the “bootubuntu” command to start Ubuntu.
image
If you see a line like “root @ localhost: / #”, then you did everything right and started Ubuntu! And if something went wrong and you got a whole bunch of mistakes, then do not be alarmed - I had it like this for two days in a row, so you are not alone. Just try to repeat all the steps starting from step 5. True, if you do not have Nexus One, then it may not work (for example, I still can’t get Ubuntu uploaded to my HTC Evo 4G).

How to start X11


In general, I prefer the command line because the GUI eats up too much memory. But the GUI makes it possible to use graphical applications, so we will launch it.
9. First, install Android VNC Viewer (you can download it here ). If you suddenly do not know how to install apk applications, then use the Installer program from the market.
10. For Ubuntu, you also need to install a couple of programs (via the terminal): 11. Set up the graphic mode settings of Ubuntu (also through the terminal): You can specify any other screen resolution. When you are asked for a password, you can specify what you want, it will only be needed to connect to the Ubuntu desktop. 12. Now you just need to write this:
apt-get update
apt-get install tightvncserver lxde

image

image

export USER=root
vncserver -geometry 1024x800



image

cat > /root/.vnc/xstartup
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession

Then press Ctrl-D twice and Enter once.
image
13. On your device, open the Android VNC application. In it, write your password (which you wrote in step 11) and specify port 5901.
14. Click the Connect button and voila! here is the Ubuntu desktop :)
15. In order to be able to start the desktop without additional manipulations with the console, execute these commands in the terminal: Permission, specify again any one you like, and after execution press Ctrl-D twice and Enter once. After that, we execute two more commands: Everything, now the connection to the Ubuntu desktop will always be available if Ubuntu is running.
cat > front
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 1024x800


image

cat front /root/.bashrc > temp
cp temp /root/.bashrc

image


How to start Ubuntu next time


In the terminal emulator for Android, write this:
su
bootubuntu


If you have problems downloading


If you have any problems downloading Ubuntu, then try downloading the updated bootubuntu file and running these commands to install it through the ADB console: Then try to run Ubuntu.
su
cd /sdcard/ubuntu
sh ./ubuntu.sh



Thanks


Thanks to the developers with XDA Developers for the image of Ubuntu ARM for HTC HD2 .
Many thanks to AndroidFanatic for explaining how to run X11 through VNC.
And thank Saurik (Jay Freeman) for the script the G1 the Debian , who helped run Ubuntu on a Nexus One.

Also popular now: