Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,344 Members 46,087 Now Online
XDA Developers Android and Mobile Development Forum

[DEV] Chroot Ubuntu

Tip us?
 
Jhinta
Old
(Last edited by Jhinta; 29th June 2011 at 05:15 PM.)
#1  
Jhinta's Avatar
Senior Member - OP
Thanks Meter 255
Posts: 620
Join Date: Dec 2010

 
DONATE TO ME
Default [DEV] Chroot Ubuntu

here you go chroot ubuntu

So you have a working rootfile system like hd2
put the root file system on sdcard location /sdcard/ubuntu
place the two files in /sdcard/ubuntu
(run as root ) just install with -> sh install.sh And READ

installing vnc

in ubuntu linux terminal ->

export USER=root
vncserver -geometry 1024750
nano /root/.bashrc

Add this to the beginning
###########################
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 1280750
########################### ctrl+x to save

Thanks to,
aligatro2010 4 resolution
poltak11 4 helping you guyś with some more info

now connect with your own password and port 5900 or 5901 ad localhost with VNC Android !!

Just download the rootfs from the HD2 form

Ubuntu Chrootenv. <- new
The Following 14 Users Say Thank You to Jhinta For This Useful Post: [ Click to Expand ]
 
Jhinta
Old
(Last edited by Jhinta; 1st July 2011 at 06:44 PM.)
#2  
Jhinta's Avatar
Senior Member - OP
Thanks Meter 255
Posts: 620
Join Date: Dec 2010

 
DONATE TO ME



So how does this works -->

# DONT TOUCH FIRST LINE !!!!
mount -o remount,rw -t ext4 /dev/block/mmcblk0p1 /system ## lets mount the nand RW so that we can make folders
echo "SETTING VARIABLES"
export bin=/system/bin ## divine where bin is
export mnt=/data/local/ubuntu ## divine where mnt is
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH ## set path so that we can run things anywhere
export TERM=linux ## divine term
export HOME=/root ## divine home
if [ ! -d /data/local/ubuntu ] ## if there go else create data/local/ubuntu
then
mkdir /data/local/ubuntu
fi

echo "MOUNTING"
mount -t ext2 -o loop /sdcard/ubuntu/rootfs.ext2 /data/local/ubuntu ## mount a ext2 loop file from dir to dir
mount -t devpts devpts $mnt/dev/pts ### mount android devpts in root (mnt/dev/pts)
mount -t proc proc $mnt/proc ## same as above
mount -t sysfs sysfs $mnt/sys ### same as above

echo "SETTING UP NETWORK"
sysctl -w net.ipv4.ip_forward=1 ## ip forward so that we have internet from android
echo "nameserver 208.67.222.222" > $mnt/etc/resolv.conf ### as is
echo "nameserver 208.67.220.220" >> $mnt/etc/resolv.conf ### as is
echo "127.0.0.1 localhost" > $mnt/etc/hosts ## as is
echo "All credits to original creator !!!!!!!"


chroot $mnt /bin/bash #### finally lets chroot the dir and init /bin/bash meaning lets start a vm on that dir


and thats all to chrooting
The Following 8 Users Say Thank You to Jhinta For This Useful Post: [ Click to Expand ]
 
corwinmortac
Old
#3  
corwinmortac's Avatar
Senior Member
Thanks Meter 23
Posts: 153
Join Date: Nov 2006
Location: Dallas
ok this is pure awesome but...it would mean running 2 OS's just like the old day of running multiple os types off my old winmo phone...right?
 
LucJoe
Old
#4  
Senior Member
Thanks Meter 23
Posts: 187
Join Date: Nov 2008
Wow, great work! Wish the xda app had a thanks button

Sent from my SPH-D700 using XDA App
 
salamandar
Old
#5  
Senior Member
Thanks Meter 9
Posts: 260
Join Date: Feb 2009
"So you have a working rootfile system like hd2
put the root file system on sdcard location /sdcard/ubuntu"

Would anyone mind explaining that beginning part? Seems like I have the folder on my SD card and the 2 files but I am missing the "working rootfile system like hd2". Does this mean i need to make an image of an already running root file system.

My apologies in advance if I am asking a noob question.
 
daniel9522
Old
#6  
Senior Member
Thanks Meter 10
Posts: 188
Join Date: Dec 2010
Location: Toronto
i dont understand what is hd2

So you have a working rootfile system like hd2
 
lithiasalesjs
Old
#7  
lithiasalesjs's Avatar
Senior Member
Thanks Meter 4
Posts: 107
Join Date: Sep 2010
Location: Grand Forks
What is HD2 ? And do we put the two files on the Removable ( REAL SD CARD ) or the Asus Transformer ?

rm failed for -f No such file or directory
CP Can't create '/system/bin/ubuntu: Permission Denied
Type 'sh ubuntu' to boot Ubuntu


MONSTERANDROID

ASUS EEE PAD TRANSFORMER

0423 Prime v1.2
Netformer v1.1 Kernel @ 1.4 GHZ
Honeycomb Home Buttons
Honeycomb Boot Animation
Custom Clock Fonts

MOTOROLA DROID X

Gingerbread
Overclocked 1.4 GHZ
3G Mobile Hot Spot Hack
 
salamandar
Old
#8  
Senior Member
Thanks Meter 9
Posts: 260
Join Date: Feb 2009
I suspect they are refering to the ubuntu.img available in the HD2 Ubuntu Dev forum, im downloading now to test, i'll post my results.
 
lithiasalesjs
Old
#9  
lithiasalesjs's Avatar
Senior Member
Thanks Meter 4
Posts: 107
Join Date: Sep 2010
Location: Grand Forks
Im guessing put them on the Removable


MONSTERANDROID

ASUS EEE PAD TRANSFORMER

0423 Prime v1.2
Netformer v1.1 Kernel @ 1.4 GHZ
Honeycomb Home Buttons
Honeycomb Boot Animation
Custom Clock Fonts

MOTOROLA DROID X

Gingerbread
Overclocked 1.4 GHZ
3G Mobile Hot Spot Hack
 
lithiasalesjs
Old
#10  
lithiasalesjs's Avatar
Senior Member
Thanks Meter 4
Posts: 107
Join Date: Sep 2010
Location: Grand Forks
# ls
install.sh ubuntu
# sh install.sh
Type 'sh ubuntu' to boot Ubuntu
# sh ubuntu
SETTING VARIABLES
MOUNTING
ioctl LOOP_SET_FD failed: Bad file number
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
SETTING UP NETWORK
net.ipv4.ip_forward = 1
ubuntu: line 22: can't create /data/local/ubuntu/etc/resolv.conf: nonexistent directory
ubuntu: line 23: can't create /data/local/ubuntu/etc/resolv.conf: nonexistent directory
ubuntu: line 24: can't create /data/local/ubuntu/etc/hosts: nonexistent directory
All credits to original creator !!!!!!!
chroot: can't execute '/bin/bash': No such file or directory
#


MONSTERANDROID

ASUS EEE PAD TRANSFORMER

0423 Prime v1.2
Netformer v1.1 Kernel @ 1.4 GHZ
Honeycomb Home Buttons
Honeycomb Boot Animation
Custom Clock Fonts

MOTOROLA DROID X

Gingerbread
Overclocked 1.4 GHZ
3G Mobile Hot Spot Hack

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes