yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] abc27:
Getting problems on first boot :(

# bootubuntu

bootubuntu

mknod: /dev/loop2: File exists

ioctl LOOP_SET_FD failed: 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/mnt/etc/resolv.conf: directory nonexistent

bootubuntu: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent

Setting localhost on /etc/hosts

bootubuntu: cannot create /data/local/mnt/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.

#
[Desire Android Development] abc27:
Apparently the issue has to do with the kernel. The kernel needs to support loop devices. That's something that's present already on Nexus One kernels but is disabled on all other HTC devices. I'm gonna set off now and see how I can edit my kernel to enable loop devices.
[Desire Android Development] abc27:
Argh I need a linux dev environment :(

Needless to say I haven't got one set up and ready to go. Anyone willing to take on the task? It's only one line of code that needs to be modified.
[Desire Android Development] abc27:
Ok i've found a workaround.

Open up the bootubuntu file in a text editor and replace "loop2" with "loop0"

Working fine for me now.

Scratch that... Logged out and couldn't log back in again :(
[Desire Android Development] KuRouZu:
if you run the original ubuntu.sh will not work. And If you do it without recovery mode your phone reboots automatically. This is the principal difference with nexus one. But when you run bootubuntu, do it in android! and before this don't forget do:

type "su"

type "mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system"

type "mkdir /data/local/mnt"

and then type: "bootubuntu"

I recommend that you follow the guide I've posted from the beginning, it's easier than you've skipped a step. It is important to know that not all roms suports ubuntu, only those who can mount loop devices . And I do not know how to identify it.

ah, and people with problems with "/dev/loop2" busy, etc. It's because you has not replaced the "bootubuntu" file of ubuntu.zip from this:

h t t p : / /zedomax.com/android/bootubuntu

I say this at the beginning of the howto :)
[Desire Android Development] peewster:
Just logged in with vnc, really awsome :) Only thing is that eventually i have to logg off :(

screens:
[Desire Android Development] abc27:
How did you get it to work? Still trying (And failing :( )

Think I know why I can't get it to work. I forgot to replace the bootubuntu script at the start and all i've been doing is modifying the one on the sdcard. Going to move it to /system now and try again.
[Desire Android Development] peewster:
It's more like a onetime thing :)

Just follow post 1, don't miss anything. When you have done that, follow the instructions from the video where he's installing tightvncserver and lxde (correct me if i'm wrong). After that you have to install a vnc client (link provided at the howto). Connections with the vncclient has to be done at port 5902, NOT 5900 as he said in his tutorial.

After logging out, it's not possible to log in again so i'm not using it anymore.
[Desire Android Development] abc27:
Not working :( Gonna get going on that kernel compile, setting up a dev environment first though.
[Desire Android Development] peewster:
If you really want to try it, then do a nand backup. Then wipe everything and startover. That worked for me.
[Desire Android Development] fllash:
Hi there,

This is the bootubuntu file you need to replace. if you dont want to put it in the system partition, you can rename it to bootubuntu.sh and run it by

adb shell

su

cd sdcard/ubuntu/

sh ./bootubuntu.sh

and then it should work properley. Its the same file the OP wanted to you replace, i think.

Josh.
[Desire Android Development] abc27:
It works once but then refuses to start up again.

If it helps i've found the source of that tutorial...

http://www.saurik.com/id/10
[Desire Android Development] abc27:
Now working.

What you need to do is type in

cd /sdcard/ubuntu

sh ./ubuntu.sh

Then bootubuntu and the phone will lock up and restart

After the phone restarts open up adb shell again and type in bootubuntu and it will start up again.

Now that i've got this working, i'm going to try my hand at getting Maemo to boot up =/
[Desire Android Development] peewster:
your right, it works. So indeed now we have to find a way to boot it without rebooting the phone over and over again.
[Desire Android Development] animehq:
I can't use adb shell in recovery mode :

"c:\adroid-sdk-windows\tools>adb shell

- exec '/system/bin/sh' failed: No such file or directory (2) -"

:(
[Desire Android Development] d3sm0nd:
Someone has to explain how to update the kernel on different roms to support loop devices...
[Desire Android Development] abc27:
You have to recompile the kernel with the following flag uncommented...

CONFIG_DEV_BLK_LOOP=y

But first of all check your current kernel, it may already be uncommented...

adb pull /proc/config.gz and then extract the file and check your config file. If it's uncommented and doesn't have a # beside it then you do have loopback device support.
[Desire Android Development] abc27:
http://xdaforums.com/showthread.php?t=724151

I've got a Maemo build compiled for use in the same method as this.

Just replace the ubuntu.img (I renamed it that so as to avoid unneeded changing of scripts) with the one found in the above thread.

Then use the following scripts package (named ubuntu.rar) attached to this post.

Post back here if you get it booted!
[Desire Android Development] d3sm0nd:
Thanks! Will try in a bit and let you know. I hope it's not too hard to recompile it if it's not uncommented.

EDIT:

There is no "CONFIG_DEV_BLK_LOOP=y" but there is "CONFIG_BLK_DEV_LOOP=y" and it's not uncommented.

Can I just uncomment it and push the file back? Or is it not that easy?...
[Desire Android Development] animehq:
It was ok with clockwork recovery
[Desire Android Development] abc27:
You can try but it will more than likely not work.

Edit the file and save it uncommented then repeat the same command but use "adb push" rather than "adb pull"

Give it a shot.
[Desire Android Development] d3sm0nd:
Didn't work :( It says "Operation not permitted"

I found this:

http://htcevohacks.com/htc-evo-hacks/how-to-build-your-own-htc-evo-4g-android-kernel/

This way it should work but seems too complicated... I think I will try Modaco's Froyo ROM with Sense when it's out.
[Desire Android Development] abc27:
The Dj.Droid FroYo ROM kernel has it enabled.
[Desire Android Development] d3sm0nd:
The ROM that i'm using is DJ Droid.. but it's not enabled for me ?
[Desire Android Development] abc27:
That's odd. How are you checking? With the adb pull method?
[Desire Android Development] d3sm0nd:
Yes. I was one of the first that flashed the rom.. maybe there were some updates, gonna flash the newest now (hope it doesn't wipe :D )

BTW did you got Maemo running? If it works this would be awesome... :)
[Desire Android Development] abc27:
Nope, for some odd reason loop devices works intermittently so I can't fully test it. If someone can get ubuntu booting up then they should be able to get Maemo up as well using the image I uploaded.
[Desire Android Development] Blinkiz:
I can not get this to work. Running the bootubuntu script manual to identify when it goes wrong.

# mknod /dev/loop1 b 7 0
# losetup /dev/block/loop1 /sdcard/ubuntu/ubuntu.img
losetup: /dev/block/loop1
# mount -t ext2 /dev/block/loop1 /data/local/ubuntu
mount: Device or resource busy

For some reason, the loop1 is not ready.

Running this with Defrost 2.0f ROM.
[Desire Android Development] Skimi:
With [ROM] [Froyo] AhmgskMod FroyoSenseV1 [9th July] it work's perfectly, but the ubuntu says it as an update to 10.04 LTS, can i do it? Or it will break the system on my desire?

Thanks
[Desire Android Development] d3sm0nd:
I'm lost :(

Just flashed

13/Jul r4 WIP refresh - MoDaCo Custom ROM for HTC Desire with Online Kitchen - Froyo FRF85 / FRF91 with Sense

and it also doesn't have loop devices enabled... i've contacted Paul and hope that he enables this in future releases.
[Desire Android Development] Pyr0x64:
until the kernel source is released, it's not possible is it?
[Desire Android Development] d3sm0nd:
Hmm... just tried everything on Modaco and it worked! Still loop devices are disabled...
[Desire Android Development] JDouce:
can we get netbook edition of 10.04 ... would be MUCH better
[Desire Android Development] Skimi:
I got an error while trying to update...
[Desire Android Development] Blinkiz:
I tried this before with Defrost 2.0f ROM. It did not work.

Today I put in OpenDesire v2.0 (15/07) ROM and then it worked perfectly to install Ubuntu.
[Desire Android Development] d3sm0nd:
Okay.. I've played a bit with it.. but there is one big problem:

When I try to exit chroot.. I type exit and it says shutting down... but I'm still able to login with VNC... LOL? :D And when I type bootubuntu it just opens an another X11 session...

I guess this is because of the loop devices ?
[Desire Android Development] datom84:
hello.

can someone help me?

I always get this syntax error.
[Desire Android Development] Blinkiz:
Hi there

You are running ubuntu.sh. That is wrong. Please follow the guide on the first page of this thread.

If you want to run ubuntu.sh, that should be done in recovery mode. Rest should not be run in recovery mode.
[Desire Android Development] JohnQ:
successfully installed on HTC DESIRE.

ROM: DJ DROID 1.0.

report: slow..
[Desire Android Development] Blinkiz:
I wrote this above before. It was tested after a clean OpenDesire v2.0. Now I can not get this to work any longer. It worked like one time. I have the exact same problem as before.

# mknod /dev/loop1 b 7 0
# losetup /dev/block/loop1 /sdcard/ubuntu/ubuntu.img
losetup: /dev/block/loop1
# mount -t ext2 /dev/block/loop1 /data/local/ubuntu
mount: Device or resource busy
[Desire Android Development] NChief:
Works on MCR froyo-sense without problems. kinda slow tho.
[Desire Android Development] rommark:
Would we see Linmo for desire?
[Desire Android Development] abc27:
Impossible..
[Desire Android Development] Romalouz:
Hi there!

I have installed ubuntu on my Desire and it works fine.... for the first boot!

Today I tried to launch it but it failed like it did for others.

I am wondering if I have to do the process all over again to get it work or ifsomebody knows a method to fix it?

I am using ShadowFrost v1.4 !

Thank you in advance.
[Desire Android Development] mercianary:
working great for me. every time. using defrost.

only problem i had was vncserver command was messed up when copying over. had an illegal char instead of x. changed it in /root/.bashrc

sending this from desire ubuntu now. i dont think it is thatvslow considering.

god knows why a 700mb distro is needed.

working on a lightweight debian net install cd based image. then i will chuck it on ext partition on the sdcard cuz loop and mount is a pain.
[Desire Android Development] ephumuris:
That would be great i would definitely try that out. Can you make a new thread with guide when you do it as i think it would be worthy of being noticed.
[Desire Android Development] peewster:
How did you try to launch it ?

Try to: (within better term or terminal from the market)

su
cd /sdcard/ubuntu
sh ./bootubuntu

This should work.
[Desire Android Development] Romalouz:
I tried it with Defrost 2.1 and it works fine every time! But I still got an error when I shutdown ubuntu. Does anybody knowwhere this error comes from ?
[Desire Android Development] animehq:
Due to the fact that ubuntu is chrooted and shares the kernel with android it don't have full access to filesystem...
[Desire Android Development] mercianary:
I get that error too. I think we all do.

Please note it doesn't actually shutdown. You can still log in via vnc. You need to reboot when You've finished with it.
[Desire Android Development] peewster:
Is there a way to acces the sdcard folder within Ubuntu?
[Desire Android Development] mercianary:
To mount sd.

From Ubuntu terminal

mkdir /root/sdcard

From a different terminal. I recommended gscrpt.

busybox mount /sdcard/data/local/ubuntu/root/sdcard

You only need to do the first command once. You need to do the second after Ubuntu has been started each time.
[Desire Android Development] peewster:
# busybox mount /sdcard/data/local /ubuntu/root/sdcard

mount: mounting /sdcard/data/local on /ubuntu/root/sdcard failed: No such file or directory

# busybox mount /sdcard/data/local/ubuntu/root/sdcard

mount: can't read /etc/fstab: No such file or directory
[Desire Android Development] mercianary:
Sorry.using phone. Its a pain.

Should be

busybox mount /sdcard /data/local/ubuntu/root/sdcard
[Desire Android Development] peewster:
unfortunatly this won't work either.

no such file or directory
[Desire Android Development] mercianary:
Type

cd /data/local/ubuntu/root

Then

ls

It should say

# cd /data/local/ubuntu/root

# ls

Desktop

Downloads

Templates

Public

Documents

Music

Pictures

Videos

sdcard

Let me know what it says
[Desire Android Development] peewster:
My ubuntu folder is not under /data/local/ but /sdcard/ubuntu

The script to run ubuntu "sh ./bootubuntu" did not created links or folders in /data/local/ubuntu.

When i run ubuntu the only thing i do is:

cd /sdcard/ubuntu

sh ./bootubuntu

and that's it. No directories or links in /data/local
[Desire Android Development] mercianary:
When you installed it via adb it created the folder inside data local.

When you run the .sh it mounts the image there.
[Desire Android Development] mercianary:
Sorry.just realised what's wrong.

Replace Ubuntu with mnt in the command. I had to change where it was mounted when I did it.
[Desire Android Development] Amber-Willow:
Hi,

I've tried to install Ubuntu on both jasons rom with expresso as well as ledroid 1.4.

Both times i ran into the same problem.

I install and everything seems to run perfectly, no errors on installation and i manage to get into the vnc connection.

Thats where things go wrong. I can open the ubuntu menu's, but no programs start at all. Even shutdown and reboot dont start. In the bottom bar i see that the program is starting, but it disappears after a little while, with no windows popping up.

The only way to shut down seems to be to reboot my phone, and from there i get the loop1 errors that the device is busy. It looks like it is not released properly after shutdown.

Is there a manual command i can use to release the loop1? I've tried the newer script for bootubuntu and the sh ./ubuntu.sh again. it reboots the phone after i do bootubuntu again, like someone else said might be a fix, but afterwards i still get the loop1 error.

Anyone who knows any other possible fixes? I read through this thread but i couldn't find any.

Many thanks,

Amber Willow
[Desire Android Development] adityapb:
I am also getting the same error message....LeDroid 1.4a

It says chroot: can't execute '/bin/bash': No such file or directory

but i actually checked the directory for bash and it exists.
[Desire Android Development] zhaocs:
Very cool!

Thanks your support!

Desire will more stronger and stronger~~
[Desire Android Development] adityapb:
mapping keyboard

can anyone please tell how to map the keboard in Ubuntu...defrost 2.4
[Desire Android Development] ilor:
not working for me on Leedroid 1.6...
[Desire Android Development] pphillips001:
So - are you guys installing Ubuntu on the Desire, then using adb on your PC/Mac to VNC onto the phone?

Or is this Ubuntu running on its own on the phone?

Either way - pretty cool stuff you guys are doing.

If it's running from the phone does the OS have access to all the hardware? Phone? Camera? Audio? etc

Cheers.
[Desire Android Development] peewster:
You chroot ubuntu on your Desire. If you install a vncviewer from the market you can run it directly from your phone without any use of a pc.
[Desire Android Development] mercianary:
new method (easy way)

it seems that most of the steps in the instructions are not needed.

you dont need to use adb at all.

here is the easy way.

this works for me on defrost and cyanogen6, i haven't tested on aything else.

Before you start you will need

-a vnc client on your android (any will do, i use androidVNC)

-a terminal emulator on your phone (any will do, i use the one included with cyanogen or connectbot)

1. Download this (it is the original ubuntu.img after all the steps have been completed so you dont have to install lxde or vncserver or set anything up. this is ready to go.)

2. Copy both files too sdcard.

3. From your favourite terminal emulator type

4. From your favourite VNC client connect using these details.

Please give me feedback if it works for you.

Also if anyone else has other android devices can you give it a go for me and let me know if it works.
[Desire Android Development] Rosi1337:
is ubuntu 10.4 available too?
[Desire Android Development] Peelypeel:
This is fantastic, but i want Windows XP :p
[Desire Android Development] Loshia:
Thanks for the new method! It works like a charm. I do have one question though - how do you shutdown Ubuntu? I tried from the logoff menu and from typing "shutdown now" in the terminal but to no avail. Any ideas?

I am using Cyanogen6 latest ROM.
[Desire Android Development] mercianary:
You can't shut it down.

You can kill the desktop with

vncserver -kill :1

But the terminal will still be running. You need to reboot your phone to get rid of it.
[Desire Android Development] matisamd:
Paraphrase=horadee' why would anyone want to install ubuntu?
[Desire Android Development] codeXcalibur:
It works in Pays Froyo 1.3 which is based on MCR! Nice :cool:
[Desire Android Development] peewster:
So CTRL D isn't enough?
[Desire Android Development] mercianary:
Afraid not. You can still log in with vnc after CTRL+D or exit
[Desire Android Development] Rosi1337:
Is there a way to get a keyboard in the vnc client?
[Desire Android Development] mercianary:
hold menu..
[Desire Android Development] Rosi1337:
thank you...
[Desire Android Development] Rosi1337:
Is there another to start the vncserver on system startup?

The solution with .bashrc is crap, each time you open the terminal a new vncserver starts

I already tryed to implement the start command in the bootubuntu file and in rc.local and made a startscript in init.d and linked it to the runtimes, but nothing worked.
[Desire Android Development] mercianary:
You could remove the command from .bashrc and run it manually when you need x.

Or

You could add the command

vncserver -kill :2

After the vncserver -geo... command.

Not pretty. But it will work.

edit.

I wouldnt recomend running multiple terminals at the same time or one at a time as the contents of /tmp are cleared on each startup also.

personally i would put all the commands you ammended in .bashrc inbetween if and fi. telling if to check for a files existense before runnung them. but you will have to manually delete it when your finished if you want it to run properly the next time.

something like

when you finished with ubuntu you need to

it's still crap, but its a start

i havent tested this, your on your own there:)
[Desire Android Development] Rosi1337:
That works great, thanks.

Is it possible to enlarge the img file up to 4gb for instance?
[Desire Android Development] jullejul:
Microsoft Windows [Version 6.1.7600]

Copyright (c) 2009 Microsoft Corporation. Med ensamrätt.

C:\Users\julle>cd /

C:\>cd /Users\julle\Documents\android-sdk_r06-windows\android-sdk-windows\tools

C:\Users\julle\Documents\android-sdk_r06-windows\android-sdk-windows\tools>adb s

hell

# su

su

# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

# mkdir /data/local/mnt

mkdir /data/local/mnt

# bootubuntu

bootubuntu

ioctl LOOP_SET_FD failed: 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/mnt/etc/resolv.conf: directory nonexistent

bootubuntu: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent

Setting localhost on /etc/hosts

bootubuntu: cannot create /data/local/mnt/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.

# chroot

chroot

BusyBox v1.16.0 (2010-01-29 22:31:34 CET) multi-call binary.

Usage: chroot NEWROOT [PROG [ARGS]]

Run PROG with root directory set to NEWROOT

#

did it work?
[Desire Android Development] mercianary:
No. It didn't. Try the new method above. Let me know if you have any luck and what rom your using.
[Desire Android Development] jullejul:
im using deforst 2.5, shud the phone be in recovery mode or shdu it be started?
[Desire Android Development] mercianary:
You don't need advanced or anything. Should be working out of the box with defrost.

Try the instructions in post 94.
[Desire Android Development] Rosi1337:
Possible to make the img file bigger (like 4gb)?

I think so but, I dont know how to mount this image in Ubuntu and copy all files into a new 4gb image...
[Desire Android Development] SpineKracker:
Ubuntu and LeeDroid 1.6a

Anyone tried to install ubuntu with this rom?

Tried with several roms, didn't get it working. Problem with the loop device, either not existing or being busy..
[Desire Android Development] mercianary:
worked fine for me using the method i mention above.

i have got it working on all the roms i have tested except for one of the nightly cyanogen builds, but the rest are working fine.

working for me on...

leedroid

opendesire

cyanogen (depends on which nighly you get)

defrost

one of the official 2.2 builds with busybox (dont remember wich)
[Desire Android Development] cosmophobia:
I'm using "Official Froyo HTC Sense ROM (16/07 v1.0c | OpenDesire Team) HTC 2.06 base by AdamG" and ubuntu runs well.

There are also too much instructions in the howto, the most are not necessary.

Just: - Copy the ubuntu-directory (from ubuntu.zip) tu the sd-card

- replace the old bootubuntu

- execute "sh ./ubuntu.sh " as su(root)

- restart your phone

- install terminal-emulator and vnc-apps

- start terminal-emulator

- "cd /sdcard/ubuntu"

- execute "sh ./bootubuntu " as su(root)

(ubuntu should run now)

- "apt-get update"

- "apt-get install tightvncserver"

- "export USER=ubuntu"

- "vncserver -geometry 800x480" (choose your password)

- "echo "export USER=ubuntu" >> .bashrc" (I think it's better than using root)

- "echo "vncserver -geometry 800x480" >> .bashrc" (Or another resolution)

- "exit"

- restart your phone

To start Ubuntu:

- start terminal-emulator

- "cd /sdcard/ubuntu"

- execute "sh ./bootubuntu " as su(root)

- connect via vnc-app to port 5901 @ localhost (name: ubuntu, password: what ever you set)

(- replace gnome if it's the heavy for you)
[Desire Android Development] SpineKracker:
Shooo ubuntu, get your a** into my phone!!

Okay, I can give it another try, but most likely I'll end up with that loop device error again.. Beats me why, it has been completely wiped before installing leedroid.. And the phone is not operator locked either. Does it matter if the sdcard has been partitioned into fat and ext3?
[Desire Android Development] cosmophobia:
My sdcard is fat+ext3 too.

I noticed, that "export USER=ubuntu" and "export USER=root" seems to make no difference.

Before

- "echo "export USER=ubuntu" >> .bashrc" (I think it's better than using root)

- "echo "vncserver -geometry 800x480" >> .bashrc" (Or another resolution)

do a simple "cd" to change to the home-directory.