In my previous post I showed you how to create an chroot environment for the arm and run it on your Ubuntu. But it’s much nicer to see it work on a real device or on an Android device like Samsun Galaxy S GT-I9000.
To run Ubuntu on Android/Samsung you need to create an img file using my post, you can also use two of my start and stop scripts from here start stop.
I have also created an img for those that don’t want to or can’t create one: Download
Step 1:
Lets begin by preparing our device by create an folder on android, connect your phone to your computer and do:
sudo adb shell cd /sdcard mkdir ubuntu exit
Step 2:
Now you can upload the img file and if you like you can also upload my start and stop scripts.
sudo adb push ubuntu.img /sdcard/ubuntu sudo adb push startA_ubuntu.sh /sdcard/ubuntu sudo adb push stopA_ubuntu.sh /sdcard/ubuntu
Step 3:
Now that you have done all the prep work you can use your ubuntu by doing:
su cd /sdcard/ubuntu sh startA_ubuntu.sh ubuntu.img
Step 4:
To exit just run:
exit sh stopA_ubuntu.sh
That’s it, no more no less
Oh I have also created two movies, first one shows how to setup and the second one is the prove it works on galaxy S. Have fun watching.
So Ubuntu’s working so well on the SGS you need to use a VNC? Is this meant to be an attempt at trolling?
Great work!
Have been looking for something like this since I got my Vibrant!!
Brilliant, bloody brilliant.
@Unimaginative
What do you think localhost is?
It IS running on the Vibrant.
you should do some research on what localhost means.
You are the troll my friend.
@Unimaginative
I am not trolling and never will. This is a real how to that shows you how to run Ubuntu using chroot.
@Jzero88
Thanks. It’s fun to play with, you should try it out.
Pingback: Ubuntu on Galaxy S | Galaxy Root
niceeeee!!!going to try it right away
Does wifi work?
Does it support adobe flash? I tried googling flash support for “arm” (non-x86) versions of linux, but couldn’t find any info.
@Lance
Flash sucks on linux anyways, so I wouldn’t hold my breath getting it for ARM.
@Lance
I don’t think you would like to use this in daily base, it’s just fun to play with it. Maybe next year when the CPU/MEM is better on the phones you will be able to use this as an thin client.
Pingback: Ubuntu sur le Samsung Galaxy S i9200 « dvntnz
nice effort there..got 1 question on VNC..do we need to setup anything in VNC frst?..
yeah..i can run it now..need to start the vncserver first..btw..u r great!!
i’m stuck using the command “mount -o loop,noatime /sdcard/ubuntu/ubuntu.img /data/local/mnt” which outputs “mount: mounting ubuntu.img on /data/local/mnt failed: Block device required” if anyone can help me
and what about running this natively? anyone know much about the bootloader? cant we just run a boot script from within android? other than an xserver video driver, shouldnt most android drivers be compatible? aren’t they just linux kernel modules anyway??
Is there a way that we can do this without harming the old content of the phone ?
Will that happen and this running just as a client on the andriod ? am a noob at this so help would be great
thanks in advance
@damian
I am not sure, I am no expert on this so. I can imagine that it could be possible but we need to dig a little bit further in to android to find out.
@bhavish
You are not harming the content on the phone, what you are doing is placing an Image file on your phone and chroot(starting ubunut next to android).
Ok … and if we run linux next to android will it be possible to use aircrack ? or do u know if the wi-fi harware is capable of packet injection … i`ve been searching for this since i got my sgs … it would be a dream to really unleash the power of the 1gz proc and test wi-fi networks vulnerabilities ! Man you`r the greatest !! Hope you`ll look into the packet injection problem or if u already know this pls tell me your conclusion !!!! 10x
I did all the prep work … (just copy/paste on sdcard because I run win7 on my laptop) I started the terminal emulator with SU permission (on sgs)and after I run the command “sh startA_ubuntu.sh ubuntu.img” hire is the error message I got :
# sh startA_ubuntu.sh ubuntu.img
/data/local/mnt
ioctl LOOP_SET_FD failed: device or resource busy
mount : no such file or directory
mount : no such file or directory
chroot: can`t execute ‘/bin/bash’: no such file or directory
What is the problem ?
H i Armin
are you able to create and image of back track 4 to run on samsung galaxy s or within ubuntu on galaxy s
@AlCaTrAz
Not sure what the problem is, you could try to create an second loop device.
@gurulan
not sure that they have arm based packages
Jag får det inte att fungera.. Jag har original firmware rootat. Detta är mitt terminal-output:
$ su
# sh startA_ubuntu.sh
[: not found
test: not found
mkdir failed for /data/local/mnt, File exists
Usage: mount [-r] [-w] [-o options] [-t type] device directory
mount: No such file or directory
mount: No such file or directory
chroot: not found
#
Verkar som att den inte kan montera. Vad ska jag göra?
Sorry, I didn’t see this is an english blog xD The terminal output is in the post above. Looks like it has problems mounting something. What should I do?
@Joel
Have you installed busybox on your phone?
I use ubuntu.img…and can login with username : root and then i don’t know your password…can you give me password for ubuntu
So everything works except when i’m trying to start your script i got an error that the folder /data/local/mnt doesn’t exist and that the resource is busy. What should i do?
@erni
Try creating the /data/local/mnt on your phone and you could try to create an second loop device.
I had to make a tiny change. What do you think?
#!/bin/bash
#Created by Armin Coralic http://blog.coralic.nl
ln -s /dev/block/loop0 /dev/loop0
ln -s /dev/block/loop1 /dev/loop1
ln -s /dev/block/loop2 /dev/loop2
ln -s /dev/block/loop3 /dev/loop3
ln -s /dev/block/loop4 /dev/loop4
ln -s /dev/block/loop5 /dev/loop5
ln -s /dev/block/loop6 /dev/loop6
ln -s /dev/block/loop7 /dev/loop7
if [ "$1" == "" ] ;
then
echo “You need to specify the img file!”
exit 9;
fi
if `test -d /data/local/mnt` ; then
echo “/data/local/mnt”
else
mkdir /data/local/mnt
fi
export HOME=/root
export USER=root
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
mount -o loop,noatime -t ext2 $1 /data/local/mnt
sleep 3
mount -t proc proc /data/local/mnt/proc
mount -t devpts devpts /data/local/mnt/dev/pts
chroot /data/local/mnt /bin/bash
@nemo
Looks good to me
…for me not working
…output:
/data/local/mnt
ioctl LOOP_SET_FD failed: Device or resource busy
mount: No such file or directory
mount: No such file or directory
chroot: can’t execute ‘/bin/bash’: No such file or directory
…any help?
@Mirel
Do you have busybox tools
@admin
YES!
@admin Wow!!! I’m buying captivate next month… will it work?
has been any improovment in performance since then?
Pingback: ubuntu su galaxy s - Forum Android Italiano
…also for me not working
…output:
/data/local/mnt
ioctl LOOP_SET_FD failed: Device or resource busy
mount: No such file or directory
mount: No such file or directory
chroot: can’t execute ‘/bin/bash’: No such file or directory
what do you mean by: try to create a new loopback device?
@Mirel
@marco
Try creating a second loop device with: mknod /dev/loop2 b 7 0
Is there a way to run it as fast as here? http://www.youtube.com/watch?v=PWI-_iUnPts
…
it would be AZOM!
and if not, can you explain me why? =/ … i know about usb host all that.. but,
I mean.. in the speed of ubuntu..
and I know it’s winmo.. but c’mon.. android is better =D xD..
I hope you can answer…
Esteban
@est_cap
Only way to be able to be faster is to boot Ubuntu native instead of in a chroot (inside android). Running in chroot is slower because you are inside an another running system (in this case android). To be able to boot ubuntu native there are some big issues to address in witch I am no expert. I do believe it should be possible to run ubuntu native.
I made it.. buuut.. I dont know the password .. or the port it’s runing =S… i guess it’s 5901 … but the pass.. i dunno u.u..
. . . I’m so dumb =) xD . . .
people: 3 things
1) when you’re about to start it, the best is to do it from the phone.. so you wont have any problems of root and all..
2) write
su
at the start .. even if you already have # . . . why? so it’s recognized again by superuser (all done from phone) . . .
3) for some reason, it doesnt start vncservr automatically… so write..
apt-get install vncserver
and it’ll download and install it (it it’s not installed… dont have a clue how to know if it already is xD) once done that,
write:
export USER=root
and then vncserver -geometry 800×600
(i pt 800×480 for my Captivate)
.. open vncserver and connect… THAT worked for me.. dunno xD
For everyone having problems with VNC password:
After chrooting type: vncpasswd
and set a new password! ^_^
Imanaged to make it work xD when I had 2.1… now I have 2.2 (Phoenix Ultimate) in my cappy . . . and I can’t use it x(
does someone know why?
@est_cap
What is the problem?
Dumb of me I didnt specify…
When I had 2.1 … I could make it work with THIS method, and with other I found… now I cant doesnt matter what I try xD… well.. I coppy all, as I did before, in terminal put su (oh! before I managed to make it work.. but from THE PHONES TERMINAL.. the PC gave me error didnt found ubuntu folder.. dunno why) so.. I start from the phones temrinal and write SU.. it says it was givven root privilegies. then..
#cd /sdcard/ubuntu
#ls {and it’s correct, it’s there startA_ubuntu.sh}
so i write this, and happens this:
#sh startA_ubuntu.sh ubuntu.img
/data/local/mnt
ioctl LOOP_SET_FD failed: Bad file number
mount: No such file or directory
mount: No such file or directory
chroot: can’t execute ‘/bin/bash’: No such file or directory
#
THAT’S what happens xD… I cant understand much of it yet =/ (I’ve just started yesterday Ingeniería en Sistemas de Informacion {dunno propper translation to english…} ) tnx!
@est_cap
No one knows? =’( xD
What are the steps required to mount the external storage (SD+card) of Samsung Galaxy S from a chroot shell
http://stackoverflow.com/q/5462837/331168
@est_cap
Sorry can’t help you on that one.
@avri
Don’t know didn’t try that
Oh. . . . Is there any chance that it’s something to do with my CRom ? or Lagfix maybe? (Phoenix ultimate.. 2.2)
@est_cap
Don’t think lagfix is the issue, although it depends witch lagfx it is. If it is converting the partitions to ext4, is then that is not a problem. If it is the loopback one then that could be a problem.
@admin
I was diggin in the Recovery.. and I nearly undo the lagfix… when I saw it actually said something of converting to ext4 some partitions.. so I sensed it wasnt the problem… it doesnt use loopback apparently.. i have SpeedMod kernel…
So.. I dont know what to do ¬¬ it gets frustating =S…
OFF TOPIC: mn.. but I managed to “nearly boot” XP on Bochs and Qemu in my phone… Have a 2gb .IMG made with bochs.. and it only prompts the famous “windows wasnt able to run last time.. chose the configuration” (and select for example safemode or normaly startup.. the normal mode crashes and restarts.. and the safemode loads some elements.. and then crashes the same xD… only to share the experience
where do i rights tha codes
1234 sudo adb shell cd /sdcardmkdir ubuntu exit
Step 2:
Now you can upload the img file and if you like you can also upload my start and stop scripts.
123 sudo adb push ubuntu.img /sdcard/ubuntusudo adb push startA_ubuntu.sh /sdcard/ubuntusudo adb push stopA_ubuntu.sh /sdcard/ubuntu
Step 3:
Now that you have done all the prep work you can use your ubuntu by doing:
123 sucd /sdcard/ubuntush startA_ubuntu.sh ubuntu.img
Step 4:
To exit just run:
12 exitsh stopA_ubuntu.sh
That’s it, no more no less
?????????????????????
Hi Admin,
I got the same problem i.e,
ioctl LOOP_SET_FD failed: Device or resource busy
I have busy box installed and have also tried creating a second loop device with: mknod /dev/loop2 b 7 0
Nice work
On my Samsung Galaxy Tab I made a separate partition on the sdcard and moved the img content inside that.
Then, the mount statement became
mount -t ext2 /dev/block/mmcblk1p2 /data/local/mnt
No loop device problems for me this way!
@Unimaginative No, in order to use android graphics drivers etc. you need to run ubuntu set up as vnc server in chroot and connect by vnc client. That’s why he entered localhost into AndroidVNC.
Pingback: Ubuntu porté sur le Samsung Galaxy S | Le Libriste
Great work dude!… its awesome… Your scrips will run in the SGS vibrant 4G? cuz i really want to use ubuntu in my phone…
What are the minimum requirements to run ubuntu?
memory
sdC. space
thnx
@JoeDrD
It should probably work on the SGS vibrant as well.
That’s really nice! Thanks!!
Hi,
I used the above ubuntu image and script files. but it is throwing error as “segmentation fault chroot /data/local/mnt /bin/bash”. I am using samsung galaxy fit (GT-S5670) and Gingerbread OS, I need your help to resolve this
Ty man. It is so cool using ubuntu on Galaxy S. I have one big question : virtual ubuntu have only about 100 Mb free space, so how I can resize it to lets say 1Gb?
Hey can you pls reupload you files? Since megaupload got busted it wont work!
I recommend you: http://www.multiupload.ch/
Pingback: CyanogenMod and Ubuntu on my Samsung Galaxy S | Richi's Blog
Pingback: Como Instalar ubuntu en samsung galaxy s | Blog Darkcrizt - Tutoriales ubuntu Programacion
reupload the image ubuntu thanks
Pingback: Como Instalar ubuntu en samsung galaxy s | Android Mania