For those of you who want to install Ubuntu on your Android smartphone or tablet device, here’s our universal guide on how to do it. (This guide is based off my original guide at NexusOneHacks.net)
*Note – This guide should work on most “rooted” Android smartphones/tablets with no further modification.
We will be running Ubuntu “chrooted” under Android OS, which just means that we will be running a “virtual” Ubuntu OS that runs on top of the Android OS. Your Android OS will work fully (e.g. your phone will keep working normally) while the Ubuntu runs on top of it.
First of all, you should have your Android device “rooted” because you need root access to run Ubuntu off your Android.
Second, your Android OS must support loop devices. Most newer Android smartphones/tablets come with this support so we can mount our Ubuntu image as a loop device. If not, you will either have to build your own kernel with support for loop devices or you can try an aftermarket ROM for your phone as most aftermarket ROMs come with support for it.
For example, G2 Phone and Nexus One both come with loop device support so there’s no need for us to compile a new kernel for it but for others, you may have to.
How do you know this? Just try installing Ubuntu and if it doesn’t boot, your Android device needs a kernel with loop device support. Otherwise you are fine.
How to Install Ubuntu on Android! (Windows)
First, download the following Ubuntu.zip file (from a preferred mirror), unzip and copy over the whole ubuntu directory to the SD card of your Android smartphone/tablet device:
(Turn USB storage ON then copy over the Ubuntu folder to the root directory of your SD card.)
(What it looks like after copied over to the SD Card)
1) Again, make sure you have your Android smartphone/tablet “rooted”!
2) You must have Android SDK installed or have access to adb.exe.
3) Make sure your Android phone/tablet is in debugging mode. Go to Settings->Applications->Development and make sure USB Debugging is checked ON.
4) Connect your Android device to your computer via USB cable and set the USB mode to “Just Charge”.
5) Your Android device should be recognized as “ADB Device” under Device Manager. If not, install appropriate drivers.
For all HTC Android smartphones/tablets (such as G2 Phone, Nexus One), you can download Windows drivers here:
HTC Windows 64-bit driver download – Click Here to Download Driver
HTC Windows 32-bit driver download – Click Here to Download Driver
6) Open up a command prompt by typing “cmd” under Start->Search programs and files.
7) Browse to your SDK directory where you installed the Android SDK:
Then go into platform-tools directory:
9) Type “adb devices” to double-check your Android device is recognized.
In this example, I used an HTC G2 Phone, which shows up at “HT09SR204261″. This is fine. However, if you get an empty device, that means you didn’t install the drivers for your phone/tablet correctly. (Go back to #5)
10) Type “adb shell” to enter the Android shell.
Then type “su” to enter super user mode, then type “cd /sdcard” and “cd ubuntu” to enter the ubuntu directory in your SD card of your Android device.
11) Next, type “sh ubuntu.sh” to run the script which will basically get your Ubuntu image ready to run on your Android smartphone/tablet.
If you get error messages, don’t worry and keep going.
12) Type “bootubuntu” to enter Ubuntu. (Next time you enter Ubuntu, you just need to type “bootubuntu” from your /sdcard/ubuntu directory, no need to run ubuntu.sh again.
If you got “root@localhost” at this point, congratulations! This means your Android OS comes with loop device support and Ubuntu is now running “chrooted” on top of your Android OS!!!
However, if you failed at this point, your Android OS probably doesn’t support loop devices, try installing another ROM or compiling your own kernel with loop device support.
How to Install Programs on your Ubuntu!
Once you’ve got Ubuntu running on your Android device, it’s time to install some Ubuntu packages(or programs).
Type “apt-get update” to update, this is the first thing you will need to do before installing any new programs.
How to Install OpenSSH-server on your Android Ubuntu!
Type “apt-get install openssh-server” to install OpenSSH-server. What is OpenSSH-server? If you want to connect to your Android Ubuntu via an IP address (and SSH into it), you will want to do this.
How to Install TightVNCServer on your Android Ubuntu!
If you want to access the GUI of your Android Ubuntu, you can install TightVNCServer, which allows you to access the Android Ubuntu via Android VNC app on your Android smartphone/tablet or even access it remotely from your desktop computer.
Type “apt-get install tightvncserver” to install.
How to Fix Language Issues
Above is after I connected to my Android Ubuntu via SSH2. Well, for some reason my default language switched to German. To fix that, just type “export LANG=en_US.UTF-8″:
How to Install LXDE!(optional)
Next, we will install LXDE (Lightweight X11 Desktop Environment). Although we can use Ubuntu’s default GNOME (and trust me I love that), LXDE takes up less memory so our GUI access will be faster.
If you like GNOME, you can skip this step though.
Type “apt-get install lxde”
Next, let’s setup xstartup file so that when TightVNCServer is started, the LXDE runs instead of GNOME:
Type “cat > /root/.vnc/xstartup”
Then type:
cat > /root/.vnc/xstartup
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession
Then hit Ctrl+D twice and enter to save the file.
How to Start TightVNCServer!
Next, let’s start the TightVNCServer and connect to it from our Android phone and my Windows 7 desktop:
Type “export USER=root” and “vncserver -geometry 1024×800″.
Here, you can change the resolution settings 1024×800 to the resolution of your liking.
Now your TightVNCServer is ready to accept any incoming connections from your phone or computer. Just point to the correct IP address and use port number 5901 to connect.
On your Android smartphone, just download the free app “Android-VNC-Viewer” and set the IP address to “127.0.0.1″ and port number 5901 to connect.
And you should be able to get into your Ubuntu like this:
You can also use desktop software like TightVNC Viewer and connect to your phone.
Do “ifconfig” to find out what your IP address is in your Android Ubuntu.
In this example, mine was connected to “192.168.1.131″.
Then connect to “192.168.1.131:5901″ on your TightVNC Viewer:
Here’s LXDE running on my desktop off my G2 Phone’s Ubuntu:
Troubleshooting
Ubuntu not running?
Try typing “cp” under Android shell and if you get an error message, it means you need to install Busybox. Install Busybox and try again.
Getting Following errors?
Err http://ports.ubuntu.com karmic/main Packages
404 Not Found
Err http://ports.ubuntu.com karmic/universe Packages
404 Not Found
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/karmic/main/binary
-armel/Packages.gz 404 Not Found
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/karmic/universe/bi
nary-armel/Packages.gz 404 Not Found
E: Some index files failed to download, they have been ignored, or old ones used
instead.
Try:
cat > /etc/apt/sources.list
deb http://old-releases.ubuntu.com/ubuntu/ karmic main universe
Then hit Ctrl+D twice and Enter.
This will update the Ubuntu sources.
Final Thoughts
As said in the video, there will be a lot of improvements in the speed of Android devices in the near future. This year, there will be a slew of dual-core 1Ghz processor-equipped Android devices being introduced. Which just means our Android Ubuntu will run faster and faster.
Hi,
I just purchased a Panimage Media Tablet powered by Android 1.6 and would like to install Ubuntu on it. Can you point me to the right direction on how to do this please. I would not mind replacing this OS with Ubuntu.
I loved the post, could you please tell me if this trick might work on the Samsung 5 Galaxy?
can this work on galaxy 5
yes you can run it on galaxy s
i have run it successfully on galaxy ace
I have tried this on my G2 with the Bacon Bits 2.6.32.21 & Stock 2.6.32.17 Kernels and they both fail with the following message:
# bootubuntu
bootubuntu
mknod: /dev/loop1: File exists
losetup: /dev/block/loop1
mount: Device or resource busy
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
Setting localhost on /etc/hosts
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
chroot: can’t execute ‘/bin/bash’: No such file or directory
Shutting down Ubuntu
failed.
failed.
failed.
failed.
losetup: /dev/block/loop1: Device or resource busy
Both kernels are supposed to support loop devices and busybox is installed.
by changing loop1 to loop7 in the “bootubuntu” code the issue was resolved
Now how do i fix the keymapping so i can type while vnc’d into ubuntu?
Installed on HTC Desire HD with a custom kernel, works great, the only issue is that the keyboard is way off, how did you fix that?
Try this:
In VNC’s xstartup file: $HOME/.vnc/xstartup
You have to add the line export XKL_XMODMAP_DISABLE=1 before
/etc/X11/Xsession or gnome-session (in case you use GNOME)
I dont understand where to put it…. When I do the cat> /root/.vnc/xstartup it put the code your said above right before I type the lxsession and do ctrl d twice..
Can you please help me the keyboard still isnt working I type one letter I get another.. For example I type test and it puts in nnpd
Thanks,
Zach
Could you help me with the keyboard? Where do I find the xstartup file? I found a xstartup in /data/local/ubuntu/root/.vnc but there’s nothing in it.. As you wrote it, it looks like you have to do this in cmd. How do you do that? please help, its the only thing from making this perfect !
i have a motorola milestone.
and im using The FroyoMOD v2.5.0 .
it seems i dont have loop device support.
what can i do ?
i have a motorola milestone.
i now have the froyomod 2.5 and it seems it does not work when i run bootubuntu (i get all sorts of errors).
the thing is i understant that ubuntu works on the stock 2.1 version.
so what can i do to run ubuntu on my phone with 2.2 or 2.3 ?
from what i understand i cannot recompile the kernel because it need to be signed by motorola, and if not , the bootloader wont load it.
u probably know more than me , so is there i way i can run ubuntu on my phone ?
just wanna ask i read somewhere that i can lose my camera on the phone. is it fixed or still working on ?
Great guide, is it possible for you to upload just your scripts without the .img file for people who choose to build their own image using your other guide? I’ve stumbled my way into getting in mounted and chrooting into it, but I keep catching snags along the way. Would be much appreciated, thanks.
On Nexus S i got it to work by modifying bootubuntu. You have to remove /block/ from the /dev lines and change the loop device to something like 99 rather then 1 or 2:
#modprobe ext2
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
if [ ! -d /data/local/ubuntu ]
then
mkdir /data/local/ubuntu
fi
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
mknod /dev/loop99 b 7 99
losetup /dev/loop99 /sdcard/ubuntu/ubuntu.img
mount -t ext2 /dev/loop99 /data/local/ubuntu
#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
sysctl -w net.ipv4.ip_forward=1
echo “Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4″
echo “nameserver 8.8.8.8″ > $mnt/etc/resolv.conf
echo “nameserver 8.8.4.4″ >> $mnt/etc/resolv.conf
echo “Setting localhost on /etc/hosts ”
echo “127.0.0.1 localhost” > $mnt/etc/hosts
echo “READY TO ROCK AND ROLL BABY! ”
echo “Brought to you by NexusOneHacks.net and the open source community! ”
echo ” ”
chroot $mnt /bin/bash
#After exit command is executed clear it all up
echo ” ”
echo “Shutting down Ubuntu”
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/loop99
Can you let me know what’s the ROM you are using when you make it work on your nexus s, both the original article and your modification fail to work for me.
when I execute “bootubuntu”
it throws errors like below:
mount: mounting /dev/loop1 on /data/local/ubuntu failed: Invalid argument
or as per your modification, it says:
mount: mounting /dev/loop99 on /data/local/ubuntu failed: Invalid argument
I’m running on ROM CM7, just curious whether it’s the ROM cause the problem.
post me a mail, if you saw my comments, thanks very much.
can you provide torrent
apt-get doesn’t work, could not resolve ports.ubuntu.com
hi,
i am trying to install ubunto on Coretex A8 chineese tablet with freescale processor.
Android 2.2 Tablet PC Froyo Cortex Freescale IMX515 A8 800MHz 4GB
I have failed on the step where you write bootubuntu. It writes , that bootubuntu not found.
Can you say exacty how to make a kernel with loop support?
Also is there a way totally to replace Andorid with ubuntu?
I think I’ve got exactly the same tablet you have.
I also had troubles when installing ubuntu or debian on my tablet, but after trying several installers and reading various HOW TOs, I succeded to install debian as chroot (it’s the same way ubuntu would run if using the installer of this page). As Ubuntu is Debian-based, the instructions are very simmilar. In brief, what I did is to use a application called debootstrap on a pc running linux to create an installer on a ext4 external sdcard which I later plugged to my tablet to complete the installation. After that, I installed other programs (just as it is done n this page) including openssh, lxde and tightvncserver.
I based the most important part of my procedure on Saurik’s guide: http://www.saurik.com/id/10, but with some differences: first, instead of using an image file, I used an external sdacard; second, I didn’t have to use those files unionfs.ko and ext2.ko, beacuse my kernel already recognized ext4, which is better; finally, I first installed busybox separately, with an apk downloaded from Android Market called Busybox installer. If my tablet is same model as yours, you should be able to do the same.
In order to use debootstrap and give the necessary format to the sdcard, a computer already running linux is needed, so I burned an ubuntu live cd to boot my windows pc with ubuntu temporarily. Use GParted (it comes with the standard applications in an ubuntu livecd) to create one partition with ext4 filesystem in the sdcard. It should be at least 1Gb if you plan to install a GUI (mine is 5 Gb, to install other applications). It is also possible to create other partitions; in my case I created a Fat32 partition to store data accesible to android also.
Next, to install debootstrap be sure to have an internet connection in ubuntu and type in a terminal:
sudo apt-get install debootstrap
Now to create the “installer” on the external sd, plug it to your pc, navigate inside it and type
mkdir debian
debootstrap –verbose –arch armel –foreign lenny debian http://ftp.de.debian.org/debian
Packages are downloaded and extracted to the newly created debian folder of the sdcard. Notice that I used ubuntu to create the installer for debian. If you want ubuntu, you should instead write
debootstrap –verbose –arch armel lucid
but I’d recommend to install debian, since both distributions are very simmilar. In fact the major difference between them is that ubuntu uses GNOME DE and Debian none by default, but you can install LXDE and it’s gonna run even better in the tablet considering that it is much less hardware exigent tham GNOME.
After that, plug the sdcard to the tablet (it MUST be rooted) and in a terminal type:
su
mkdir /sdcard/debian
cd /sdcard/debian
busybox mount -o noatime /dev/block/mmcblkp0 /sdcard/debian
busybox chroot /sdcard/debian/debian
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/
export USER=root
sh /debootstrap/debootstrap –second-stage
The installation takes place… Most of the instalers in the web didn’t work for me because of the export lines. Be careful, if these lines are not properly written, debootstarp might end up with a “Installation finished succesfully” message and a lot of crucial features not really installed. Then type
/bin/bash
If you get this promp, everything fine, you have debian (or ubuntu) installed:
root@localhost: /
This was the main instalation. Next, I wanted a script to automatize the log in in the future. I created a text file named debian with the following contents:
busybox mount -o noatime /dev/block/mmcblkp0 /sdcard/debian
busybox chroot /sdcard/debian/debian
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/
export USER=root
/bin/bash
and placed it in an accesible folder. Next time, to login debian (or ubuntu), in the terminal emulator navigate to the folder containing this script and type
sh debian
and that’s it, you should get
root@localhost:/
From now, all the rest is installing other useful programs (openssh, lxde, tightvnc, whatever you might want), as described above in this page.
Good luck.
Finally got this working on my myTouch 4G, but for some reason I can’t seem to use “exit”. It just hangs, leaving the cursor right at the end of exit, never giving me a new line..
example:
# exit▌
Rebooting ultimately does the trick, but I’d rather not reboot every time I want to close ubuntu. :/
This is beyond awesome. thanks!
hello..i cannot update why?
Err http://ports.ubuntu.com karmic Release.gpg
Could not resolve ‘ports.ubuntu.com’
Reading package lists… Done
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/karmic/Release.gpg
Could not resolve ‘ports.ubuntu.com’
W: Some index files failed to download, they have been ignored, or old ones used
instead.
Funny ? Not really. I want to be free with my terminal, and Ubuntu inside android is not…
As an alternative to upload to rapidshare.com I’ll be glad you know. Thank you.
Hi Thank you very much for this excellent article on installing Ubuntu on Android tablet, Would you be able to do another article with the video on how to install Ubuntu from inside Ubuntu desktop to Android tablet.
Thank you.
I will be posting the article on my blog as well with your permission.
Regards
Richard
hey thanks! it works on my samsung tab but one quick question…. how do i get it saved to where if i turn my tab off when i turn it back on all i have to do is connect because right now i will restart my tab then go to vnc viewer when i click on it its says ” VNC connection failed” but before i restarted the tab it worked great.
Thanks,
Zach
hello… great work.. im working on this proccess now… im trying to understand in what way the ubuntu is being changed… i would like to apply this to putting a diffrent dist. of linux… opensuse to be exact… im doing this for my Droid 2 global ……. and i would like to run bot open suse and Bactack 4 … if you could help me understand the whole “ARM” of an image proccess that would be most helpful. i am aware of the link on this site but even though i see the command you ran i would like to understand the process better …
thanks a ton … keep up the good work
I also get device or resource busy. I tried changing loop1, loop7, loop9. all the same outcome. losetup shows that imgs are mounted. t-mobile g2 stock rom, but rooted. HELP!
hey everyone when i input text it turns it into numbers and symbols… i tried the code below but didnt work
can someone help me?
export XKL_XMODMAP_DISABLE=1 before /etc/X11/Xsession
this is what i put —->
cat > /root/.vnc/xstartup
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
export XKL_XMODMAP_DISABLE=1 before /etc/X11/Xsession
lxsession
thanks,
Zach
hello again — so i started everything folowing along with the doc and vid provided and i got to the bootubuntu …. and came back with this \\
To enter the Ubuntu Linux console just type ‘bootubuntu’
# bootubuntu
bootubuntu
mount: No such device
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
Setting localhost on /etc/hosts
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
chroot: can’t execute ‘/bin/bash’: No such file or directory
Shutting down Ubuntu
failed.
failed.
failed.
failed.
#
now above i noted some one had the same screen except it came back with this too..
losetup: /dev/block/loop1: Device or resource busy
… so im thinking that the fix applied will not help my situation ….. is this saying that my kernal isnt supporting the loop?
if that is the case Im working with a Droid 2 global — which kernal should i flash it with and .. im a lil nervouse about doing that so if you could either explain or point me to some well writen doc/vid that would be great.
thanks
can I do this to my zte v9?
Hi,
You can install in ZTE V9???
If u can send me howto.
thanks.
I was able to get this to run on my G2x but no internet related application will open. I am able to open anything that doesn’t have to connect to the internet such as OpenOffice, Folders, ETC. Has anybody ran into this and has fixed it? Help?
Following your video succeded to install Ubuntu on Samsung i5500 Galaxy running Android 2.2.Thanks!
Needed 1 day to figure out that Android does not have all Linux commands needed to run installation.
Need to download busybox from android market and install in folder system/xbin.
Then run from PC Android SDK
adb shell
to make folder writable
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
/system/xbin/busybox –install -s /system/xbin
this should create many files with linux commands under
cd system/xbin
Another way to set up Debian or Ubuntu on Samsung I5500 is to use Linux Installer app from Android market.
well I had some trouble and I retried but now I get this. Can someone point a beginner in the right direction?
To enter the Ubuntu Linux console just type ‘bootubuntu’
# bootubuntu
bootubuntu
mknod: /dev/loop1: File exists
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
Setting localhost on /etc/hosts
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
[1] Illegal instruction chroot ${mnt} /b…
Shutting down Ubuntu
losetup: /dev/loop1: Device or resource busy
#
is it possible to do all of this through terminal emulator?
Yes. Assuming your droid’s rooted.
Hello,
Thanks a lot for a wonderful article.
It worked fine on my Android Tablet PC.
But it is not detecting the usb devices attached to the device. It shows nothing after “lsusb” . Can anyone provide solution to my problem.
How I must install the driver for the phone?
please help jaymz so I can get help too. I’m having the same exact issue, but with a t-mobile g2.
Is it possible to access files on the SD card whilst in Ubuntu? If so, how?
I tried this guide. Works perfectly on my Samsung Galaxy S 2. Only problem i have is that vnc and openssh settings are not saved. It works perfectly during the first install. But if i turn the phone off, all the settings are lost and can not connect using androidvnc. How do i save the settings.
Any help would be appreciated.
Hey admin its very important question can the ubuntu run on samsung galaxy 3 with android 2.2. Please answer its urgent. Im already but only thing I want to know is will it function properly on my galaxy 3 with only 667Mhz of processor and 256mb of RAM? Please answer im eagerly waiting. Thanks in advance.
You could do it but would run very slow on 667Mhz processor.
Pingback: Transforma tu Android en Ubuntu | Android Venezuela en Español
Hi.
If I do “bootubuntu” i’m getting this:
# bootubuntu
bootubuntu
mknod: /dev/loop1: File exists
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
Setting localhost on /etc/hosts
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
[1] Illegal instruction chroot ${mnt} /b…
Shutting down Ubuntu
# _
What can i do??
Its possible install ubuntu using terminal emulator.
if Its yes plz describe
Not able to download ubntu.zip
Plz provide another link
Hello.
Q: Is there any way to run ubuntu without running android?
Like in a computer, ill try to install it on a Motorola Xoom (w).
hi when i boot i get a message saying “vncserver: geometry 1024800 is invalid” and on the screen when i go log on it has an X for a mouse with a grey back round. do you know any fix for this?
First of all, great work! Do you think it is possible to use the latest ubuntu release 11.04, which has some new Touch-Screen features?
And has anyone tried to use ubuntu on the Asus EeePad Transformer?
hello I have a ziio 10 is it possible.to run ubuntu on it btw I wanna have libreoffice to do basic document processing.
thanks
rick
Runs really nice and fast on my Galaxy S. Thanks a lot for your work.
Hi. I have a Motorola Atrix and Im thinking of putting Ubuntu on the external sd card. Will ubuntu files (with the apt-get files) actually get installed in the system or on the external sd card? I currently run ubuntu 11.04 off a sd card and hope to do the same for the Atrix whereby I dont have to modify anything.
I did all of the steps, correctly as I believe.
When I login at android vnc, I just get a gray screen with a black x as pointer, here’s a screenshot:
http://img19.imageshack.us/img19/7357/20110619234745.png
I really don’t know if I did something wrong, I followed your video and all commands I sent gave the same results as on your video, I hope you know what the problem is, I might redo it tomorrow, it’s already late here so.
Thanks for the tutorial anyway, I hope much people will use it, ubuntu on a smartphone is just awesome :]
My phone is LG Optimus 2x Speed by the way with Blazingdragon 1.8b ROM and 606 baseband.
Greetz, Jimmy :]
Jimmy, did you find the problem?? I had the same problem and I don’t know how to proceed…
I changed the permissions on the xstartup file in /root/.vnc/ and it worked. I basically gave it executable permission (actually, all permissions) “chmod 777 xstartup”
Just did it again, couldn’t get my mind of it actually, before hand I flashed a new baseband, 502, not that it really matters for this I guess but yeah, also reinstalled my ROM, still the same, Blazingdragon 1.8b, all clean and fresh, deleted Ubuntu folder off my sdcard, put the downloaded one on it again, repeated this process but this time I didn’t install LXDE to see if it would make the difference, but it did not. I still just get a grey screen with black crosshair whereever I touch my screen, guessing my pointer. Hope you can help ASAP cause I really want to get this working on my O2X :]
Thanks in advance, Jimmy
Jummy,
Did u resolve this? I am having the same issue on my Nexus one. Please let me know if u were able to solve this,
Really appreciate any help.
Thanks,
Madhavan
hi ,
i want only to say thank you , and to ask , is this remove Android ?! or it`s only VM over OS ?
sorry , i was busy and i don`t read topic , get my qu. answer
I had some issue, any fix for this?
>> # sh ubuntu.sh
sh ubuntu.sh
modprobe: chdir(/system/modules): No such file or directory
←[H←[Jmkdir failed for /data/local/mnt, File exists
←[H←[JUnable to chmod bootubuntu: Operation not permitted
←[H←[J
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
This process does NOT damage Android OS!
Original Installer by Charan Singh
Modified for Ubuntu Chroot by Max Lee at AndroLinux.com ,G2Hacks.com and NexusOn
eHacks.net
To enter the Ubuntu Linux console just type 'bootubuntu'
>> # bootubuntu
bootubuntu
mknod: /dev/loop99: File exists
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
Setting localhost on /etc/hosts
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
[1] Illegal instruction chroot ${mnt} /b...
Shutting down Ubuntu
>> #
I have the same problem on my htc hero.
I had to make quite a few changes to this to get it to work on my Samsung Galaxy SII but these instructions were very useful.
Firstly, when I used adb to log into my phone, I was logged in as user “shell” but couldn’t su (I got a “permission denied” error) so I installed a ssh server from the marketplace, which solved that problem.
The other issue I faced was the bootubuntu script. I had to change several things about this. Firstly it wouldn’t run so I had to “sh bootubuntu”. The syntax of the “if [ ! -d /data/local/ubuntu ]” line caused problems for my phone so I changed this to “if ! test -d /data/local/ubuntu”, which worked fine. Finally I have loop[0-7] devices already on my phone so I commented out the “mknod loop1…” line and changed all the other references from loop1 to loop7. With these changes, it now seems to work fine.
Now I need to change the default language from German (fortunately my German isn’t too bad so I can at least understand what I’m reading).
Finally, I notice that this is Karmic, which is pretty old now so I shall be having a look to see how to create a Natty Narwhal image.
Thanks for the instructions. I appreciate that it is next to impossible to write a script that works perfectly on every phone but there was enough here to enable me to get this working well.
Hi guys, any help please. im try to install in ZTE V9 and thats happens.
# bootubuntu
bootubuntu
bootubuntu: not found
# sh bootubuntu
sh bootubuntu
mknod: not found
losetup: not found
mount: Invalid argument
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
sysctl: not found
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
Setting localhost on /etc/hosts
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
chroot: not found
Shutting down Ubuntu
failed.
failed.
failed.
failed.
losetup: not found
Any ideas?? I need so much ubuntu in ZTE!!!
I CAN DOIT!!!! just need to install BusyBox!!! Thanks, great tuto!!!
Edit /etc/enviroment 2nd line to “LANG=en_US.UTF-8″ that fixes your ssh language switching.
Nice stuff btw..
The file ubuntu.zip download seem to be unavailable. Can you add some mirrors for it?
Thanx
Hi there,
when i try to do this section (cat > /root/.vnc/xstartup etc) i get the following error
“cat > /root/.vnc/xstartup
bash: /root/.vnc/xstartup: Not a directory”
and i am also unable to start tightvncserver
i get this error
“vncserver
vncserver: Wrong type or access mode of /root/.vnc.”
i also get the “no Such file or directory” error when I type ‘cat > /root/.vnc/xstartup’…
Install Busybox first http://androlinux.com/android-ubuntu-development/how-to-install-busybox-on-your-android/
I got it to work by doing the step after first. type the “export USER=root” then the geometry. then type the lines “cat >………….”
I got this working today on my cheap little Haipad M701-R. Details at AndroidTablets.Net
Running X as root is never a good idea. I suggest creating a user account and put the lxsession script in it’s home directory and run it from there.
can this work on xperia x8..?
Great job
I like to do it on my SuperPad 3. But one question, if i have to do it throw Android SDK? can i use terminal on my tablet to run setup script and bootubuntu?
Thanks
Yes, you should be able to throw it on SDK, haven’t tried but I don’t see why not.
Tried on LG P990(Optimus Speed 2X) on original Firmware.
Seems theres no support for loop devices in it.
How can i add this now whitout having to flash an other rom?
I need to keeo the original one, so i guess i have to change it.
But how?
Thanks for any help
You can compile a kernel with loop device support for your phone if LG has kernel open.
i do it from terminal.
Sript run is OK, i get the same screen as step 11)
But after bootubuntu i get message:
bootubuntu: not found
but this file (i check) exist in \ubuntu directory
what is wrong?
in addition to previose
if i write .\bootubunto i get:
.\bootubunto: permission denied
i also use bootubuntu with update fis from http://nexusonehacks.net/nexus-one-hacks/how-to-install-ubuntu-on-your-android/
the same result
Try bootubuntu, not bootubunto
it sounds like he typed it in correctly if he got that error and just retyped it wrong. i got the same problem, as well as a lot of others including those with chroot and loop problems. the ‘busybox installer’ didn’t work for me that was available on the market, but the link to this guy’s busybox worked with it’s script installer. Using his busybox on my LG Vortex, it fixed the permission problem, chroot problem, ext2 problem I had with other versions, and loop problems that occured.
Hello, Just how well does ubuntu run on smart phones? I’m interested in running audio programs such as puredata and perhaps doing video capture. Besides root access and support for loop devices, are there minimum hardware requirements/recommendations to run it? Is it fairly straightforward to access the hardware of the phone – audio, camera, wireless etc. ? Cheers and thanks for the information.
Probably 1Ghz would do okay.
If we want to access the Android sdcard, it is possible to insert the following code in “bootubuntu”:
(after mounting /data/local/ubuntu)
if [ ! -d /data/local/ubuntu/mnt/android ]
then
mkdir /data/local/ubuntu/mnt/android
fi
mount -o bind /mnt/sdcard /data/local/ubuntu/mnt/android
After this, it is possible to access the Android sd card in:
/mnt/android
Ended up having to SSH in and update my busybox to get it to work but it was relatively painless and smooth. Thanks for the guide!
A not so technical questions from an Ubuntu user that has yet to try Android…..
How does the device function with Ubuntu installed? By that I mean does all the touch screen and other phone/tablet functionality keep working?
If so, is it accessible at the same time Ubuntu is? or is this more like a dual-boot situation? I know you mentioned Ubuntu runs on top of Android….but thought I’d check.
Does any touch-screen stuff work in Ubuntu?
Basically I’m trying to determine if now or some point in the nearish future I’d be able to toss my development laptop and use an Android tablet running Ubuntu (being that we’re seeing dual-core processors in these devices).
For example I’d be running VirtualBox in Ubuntu with all my development tools in it.
Do you think we’re getting close to being able to pull that sort of thing off? or is the processor power still lacking?
Thanks for your thoughts and advice….great post!
Cheers
Yeah we are not there yet I think but maybe when quad-core comes out it should be more usable.
at least i get it working om my SuperPad3
works on my little LG Vortex, and to the guy who asked in comment, I think you can do most if not all of it in the terminal. I had to do massive updates on the java sdk since it was a fresh install and while it was doing that I did most of the access on the phone itself. it’s just annoying as hell typing commands with crazy symbols on a phone. I actually came back to the thread to see if anyone tried attaching devices, like a keyboard, to the phones and if that’d work. Didn’t want to ruin a couple cables for nothing
Didn’t see any mention of this but will sites like Grooveshark.com or Hulu.com know you’re using a mobile version this way? Other than using some apps aren’t ported to Android using sites that restrict mobile use would be my only other reason for installing Ubuntu on my phone.
Is there any way to get sound working?
hi i got all the way though it and all but when i start up the vnc i just get these weird strobing thing and its just a mess what did i do wrong
Hi,
I’m wondering if this tutorial will work on the EVO 3D?
Thanks,
When i run apt-get update it says can’t resolve ‘ports.ubuntu.com’ plus when i try to connect to androidvnc it says connection refused.
I have internet because i’m connected through wi-fi to my router and i tried this connected to other router as well with the same results. Anyone knows how to fix this? Galaxy S xxjvp 2.3.4 speedmod T5 kernel.
I cannot connect the android vnc viewer to 127.0.0.1:5901..
I did everything according to procedure given in your post. It started for the first time as if it was in the failsafe graphics mode(with an error and x cursor) and then started giving an error saying “Connection refused/failed”
Please help..
The error that showed for the first time was “There is a problem with the configuration server(/usr/lib/libconf2-4/gconf-sanity-check-2 exited with status 256)”
Hi there just 2 quick questions is there a faster mirror the download on the page fails halfway through for me or times out.
Also is there a way to resize the system so theres abit more room to play with ?
Alright, this rocks. I had to download from another source (look for ubuntu on nexus 1).
Acer A500 works flawlessly. Can install using terminal app on tablet. USB keyboard and mouse both work great once you switch the VNC client into mousepointer control mode though some keybindings don’t get forwarded correctly.
Installed Zenmap and Etherape, both work flawlessly. Sadly Aircrack-ng does not work as it doesn’t detect the network card correctly (or monitor mode is not supported).
Two things I’m wondering though:
1) How would you extend the FS so it’s > 2gb
2) Is it possible to install Unity onto it as gnome is difficult to work with.
Thanks alot… I tried installing this on Notionink Adam and this is working great.
Is there anyway we can increase free size on the loop drive?
I tried increasing the size of ubuntu.img file by using
“dd if=/dev/zero bs=1024k count=1024 >> ubuntu.img”
however the free space on ubuntu is still less. Any help on this will be very much appreciated. Thanks so much for this code and tutorial.
Is it possible to compile a driver for usb fingerprint scanner inside the Ubuntu-on-android?
I tried to do make, but it gave error, missing headers.
It seems the kernel version shown in uname -r is the android devices kernel.
How to know which ubuntu kernel its running?
Then i can reinstall that kernel headers and try again.
I made a chroot image And there is no details on how install image that we made.
# bootubuntu
mknod: /dev/loop1: File exists
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
Setting localhost on /etc/hosts
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
[1] Segmentation fault chroot ${mnt} /b…
Shutting down Ubuntu
That keeps coming no matter what
cd ubuntu
# ls
ls
bootubuntu
fsrw
mountonly
ubuntu.img
ubuntu.sh
unionfs
# sh ubuntu.sh
sh ubuntu.sh
modprobe: not found
clear: not found
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
mkdir failed for /data/local/mnt, File exists
clear: not found
rm failed for /system/bin/fsrw, No such file or directory
rm failed for /system/bin/bootubuntu, No such file or directory
rm failed for /system/bin/unionfs, No such file or directory
rm failed for /system/bin/mountonly, No such file or directory
cp: not found
cp: not found
cp: not found
cp: not found
Unable to chmod bootubuntu: Operation not permitted
clear: not found
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
This process does NOT damage Android OS!
Original Installer by Charan Singh
Modified for Ubuntu Chroot by Max Lee at AndroLinux.com ,G2Hacks.com and Nex
eHacks.net
To enter the Ubuntu Linux console just type ‘bootubuntu’
# bootubuntu
bootubuntu
bootubuntu: not found
#
help
Hi admin
I had problems first with bootubuntu, but now it works! But when I type apt-get update, I get: “Some-indexvfiles failed to download, they have been ignored instead.” It acctually looks like no files downloads. apt-get install lxde fails too. other ways to get them??
VERY VERY easy written and good video for noobs like me
LooooL. REMEMBER TO ENABLE WIFI ON PHONE WHEN DOING THIS or you get the error messages as i did
Hi
I’m attempting to follow this guide but I am having trouble making LXDE run instead of GNOME.
When trying to run the command “cat > /root/.vnc/xstartup” I get the a responce saying that there is no such directory or file
I tried “cp” while in the ADB shell and was told i have 1.19 but when i try it as root@localhost i am told that i don’t have busybox installed except I do; my rom (DarkyROM 10.2 EE came with 1.19.
I then tried installing it manually from the market and found i supposedly had v1.19 installed at /system/xbin/ (the app allows you to install v1.1814, v1.17.1 or v1.19 in either /system/xbin or /system/bin) i have now tried all of those combinations.
I also tried your ‘how to install Busybox on your android” guide but as there is already a /system/xbin directory, the script failed (I also learnt that you should never delete the xbin folder…)
If you could shed any light on this problem id be very appreciative.
Thebandroid
I thought i may have fixed it by running ‘apt-get install busybox’ under root@localuser then doing the rest of the steps but now when i connect via android vnc i get a sort of gray screen with a cursor that follows my clicks but nothing to interact with (no icons, menus, anything)
i have a nexus one rooted with cyanogenmod, does that take away the loop device support? because i keep getting errors in the end of the setup, after i put bootubuntu, a bunch stuff pops up, i wanna know why it doesnt work, cuz of no loop device support? or wat?
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Android\android-sdk>cd platform
The system cannot find the path specified.
C:\Program Files (x86)\Android\android-sdk>cd platform-tools
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb devices
adb server is out of date. killing…
* daemon started successfully *
List of devices attached
HT9CTP801381 device
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
# su
su
# cd \sdcard
cd \sdcard
# cd ubuntu
cd ubuntu
# sh ubuntu.sh
sh ubuntu.sh
modprobe: module ‘ext2′ not found
←[H←[Jmkdir: can’t create directory ‘/data/local/mnt’: File exists
←[H←[Jchmod: bootubuntu: Operation not permitted
chmod: fsrw: Operation not permitted
chmod: mountonly: Operation not permitted
chmod: ubuntu.img: Operation not permitted
chmod: ubuntu.sh: Operation not permitted
chmod: unionfs: Operation not permitted
←[H←[J
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
This process does NOT damage Android OS!
Original Installer by Charan Singh
Modified for Ubuntu Chroot by Max Lee at AndroLinux.com ,G2Hacks.com and NexusOn
eHacks.net
To enter the Ubuntu Linux console just type ‘bootubuntu’
# bootubuntu
bootubuntu
mknod: /dev/loop1: File exists
losetup: /dev/block/loop1
mount: mounting /dev/block/loop1 on /data/local/ubuntu failed: Device or resourc
e busy
mount: mounting devpts on /data/local/ubuntu/dev/pts failed: No such file or dir
ectory
mount: mounting proc on /data/local/ubuntu/proc failed: No such file or director
y
mount: mounting sysfs on /data/local/ubuntu/sys failed: No such file or director
y
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
Setting localhost on /etc/hosts
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
chroot: can’t execute ‘/bin/bash’: No such file or directory
Shutting down Ubuntu
umount: can’t umount /data/local/ubuntu/dev/pts: No such file or directory
umount: can’t umount /data/local/ubuntu/proc: No such file or directory
umount: can’t umount /data/local/ubuntu/sys: No such file or directory
umount: can’t umount /data/local/ubuntu: Invalid argument
losetup: /dev/loop1: Device or resource busy
#
Having problem can’t open ubuntu after getting into /sdcard
OK – promise I tried to look – anyway, found this:
http://androlinux.com/android-ubuntu-development/how-to-build-chroot-arm-ubuntu-images-for-android/
Guess my shortcut will be to try to open my existing ubuntu.img file (so as to retain my stuff) – if that’s possible, and then simply repackage into a larger one using the above info.
Can anybody add an mirror for ubuntu.zip?
It seems to be corrupted.
HI!!!!!
I installed busybox already, and I did perfect cource.
but I have an error.
cat > /root/.vnc/xstartup
bash: /root/.vnc/xstartup: No such file or directory
how can I fix it?
Hi there,
I got it working on my Tablet Olipad 100
. However, after I restarted the tablet, the androidVNC can’t connect anymore, it gives me the message “VNC connection failed!” “localhost/127.0.0.1:5901 – Connection refused”. Any ideas?
Thanks,
Talita
Ok… I found the problem, I had to delete the /tmp/X*-lock files. However when I connect with vnc I only get a gray screen with a “x” in the center of the screen. Ideas?? Thanks
hello, seems to be a problem with the ubuntu.zip link, im downloading at 3kB/s. other than that it looks great, can’t wait to try it out.
Why is the download so freaking slow could we get a torrent? if not is it the same download from the Ubuntu website or is it modified ?i have 25mb down and 3mb up shouldn’t take me longer than 5 minutes to download the ubuntu.zip
never mind i got it from you nexusonehacks website hopefully it’s the same .zip
i do bootubuntu,but it show,bootubuntu: not found ,i do not know what it mean?thank you .