yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] userdelroot:
do the following

terminal or adb shell

now do the following

i will assume you have

/data/local/chroot

/data/local/linux.img

terminal or adb shell type

su

cd /data/local

busybox mount -o loop linux.img chroot

cd chroot/debootstrap

we want debootstrap.log

check it or pastebin it or upload here so i can see it

EDIT:

Forgot, once you get the log type

cd /data/local

busybox umount chroot
[Android Software/Hacking General [Developers Only]] userdelroot:
ok my system back online after external drive failure. I run linux off usb external drive cause I don't want dual booting windows etc plus I can take drive anywhere an turn windows box into linux box :)

Ill be up for a lil while longer if anyone is having probs..
[Android Software/Hacking General [Developers Only]] userdelroot:
This has been fixed in the scripts sh lxdestart now will work in 0.2.3-alpha
[Android Software/Hacking General [Developers Only]] TheEdgeOfRage:
Is it possible to mount the external sdcard in the ubuntu terminal?
[Android Software/Hacking General [Developers Only]] djensen777:
Has anybody been ablt to update or upgrade kali? If so please quick reply root password.
[Android Software/Hacking General [Developers Only]] dlradlt:
The repositories have location issues i ran into the same update/upgrade issue with kalli and the others.

on backtrack the password was backtrk. On others it was change me. I also had a problem with the passwd command "its a permissions issue with Android" i cant recall the post exzactly but I belive it's just a matter of adding the userid to one of the file access groups. I'll pm you if I run across the answer.
[Android Software/Hacking General [Developers Only]] George_Jetson:
Hi everyone, Sorry to bump up a 4 year old thread.... But I'm doing some research and come across this thread,

What I'm trying to accomplish is An android OS running in a Chroot ON android OS....

Sorry if that sounds ridicules, but the reason behind this project I'm working on, Is that more and More OEM's are shipping krap-loaded, boot-loader-locked devices... and I want to run a custom Android os such as LiniageOS in a chroot environment on an android arm device, and then Kill the stock android after mounting a chroot, and starting /init in the chroot directory, There-by running custom rom from changed root using stock android kernel...

If there is already anything out there that accomplishes this, PLEASE link me to it.

Thanks,

If not... would anyone familiar with this 4 year old tool please comment and tell me if this could be adapted to achieve said purpose.

Thanks in advance

Jerge
[Android Software/Hacking General [Developers Only]] userdelroot:
It should be mounted in Ubuntu chroot /external_sd
[Android Software/Hacking General [Developers Only]] xxdawidxx:
Hi, I really like the ideas if running Linux on my phone, but I am getting error and can't connect to vnc.

View attachment 2547001

Can anyone help?
[Android Software/Hacking General [Developers Only]] TheEdgeOfRage:
I got the same error. Try installing another vnc server and run that one. I haven't tried it yet, but it should work
[Android Software/Hacking General [Developers Only]] brombomb:
Entering chroot environment: [init]
chroot: can't execute '/root/init.sh': No such file or directory
exiting chroot
done

Got this at the end of install. Tried to mount and got the same info. Samsung Galaxy S3 running PACMan ROM [4.3]
[Android Software/Hacking General [Developers Only]] TheEdgeOfRage:
Remove everything and extract the zip again. Then launch the command exactly like it says in the Op.

Btw can this also be run from the sdcard (either internal or external), since I currently have storage issues when having a 1gb Linux image on my /data partition.
[Android Software/Hacking General [Developers Only]] brombomb:
I think I found the issue in the main post the command is:

In the script output it's

Trying again with chroot instead of temp.
[Android Software/Hacking General [Developers Only]] TheEdgeOfRage:
This shouldn't be a problem. I got it to work with temp instead of chroot :p
[Android Software/Hacking General [Developers Only]] brombomb:
Same issue...

Install init scripts
/setup.sh 147: /setup.sh: Syntax error: "(" unexpected
[finished]
Entering chroot environment [init]
chroot: can't execute '/root/init.sh': No such file or directory
exiting chroot
done

I'm using the newer of the two scripts in the downloads section
[Android Software/Hacking General [Developers Only]] noahthedominator:
Please Help.

Im having the same issue. Every time I try and execute it i get an error saying no such file or directory. Can someone please walk me through all the steps!?!?!?!

---------- Post added at 03:33 PM ---------- Previous post was at 03:06 PM ----------

Any chance you could give me a step by step guide how to do this from terminal emulator. A really basic easy to understand step by step guide would be greatly appreciated!
[Android Software/Hacking General [Developers Only]] ONDR4SH3K:
[MENTION=2819483]userdelroot[/MENTION]: Thanks for your work. It works very well. Much better, than LinuxonAndroid I guess.

I used:

xorg gnome-core gdm

3,5GB (1GB available) image size

tightvncserver

Sony Xperia P, Android 4.4.2, Kernel: 3.0.101-munjeni, CM: 11-20140126-UNOFFICIAL-nypon

I need from you one last question. Where do you defined exit command? I need shutdown vncserver, because I got umount chroot error.

Now, I must wait for Acer Iconia Tab A1 root permission. I need get Ubuntu to tablet.
[Android Software/Hacking General [Developers Only]] userdelroot:
The setup.sh script is failing.

I'll fix it tonight.

However it it gets to that portion of the install it is working just not mounting cause of errors. I can type how to get around it but it takes a few steps.
[Android Software/Hacking General [Developers Only]] noahthedominator:
I got this far now what do I do now?
[Android Software/Hacking General [Developers Only]] noahthedominator:
I got the same error. Any one know how to help?
[Android Software/Hacking General [Developers Only]] userdelroot:
Fixed setup.sh script,

Updated zip is posted in the downloads and main thread page.

You should reboot device and remove the old linux.img to make sure a clean install occurres.

Also the vnc is also fixed in this version.
[Android Software/Hacking General [Developers Only]] userdelroot:
I need you to do the follow:

adb shell or terminal

su

cd /data/local/

busybox mount -o loop linux.img chroot
cd chroot/debootstrap

debootstrap.log is what we want to view.

pastebin that or post it so I can see the log output please...
[Android Software/Hacking General [Developers Only]] userdelroot:
Reboot your device, if you are getting that far the install finished correctly and you should be able to chroot into the enviroment.

So reboot the device.

Then type the following from an adb shell or terminal

su

cd /data/local

busybox mount -o loop linux.img chroot

cd chroot

ls

When you type

do you see directories etc?

if you see directories do you see a media directory ?

if not type

mkdir media

mkdir media/internal_sd

then

cd /data/local

umount chroot

then

cd install-or-mount

sh install-or-mount -z -n linux.img -m /data/local/chroot -l /data/local

I would prefer you reboot device

cd /data/local

rm -rf chroot

rm -rf linux.img

and use the newest alpha release and reinstall

If the reinstall does not correct the issue attempt steps above...
[Android Software/Hacking General [Developers Only]] userdelroot:
If you use the NEW alpha release you don't need to use that vnc server I fixed the scripts....

However, to fix your issue do the following...

from adb shell or terminal

su

cd /data/local

busybox pgrep vnc

it should show, (your pid will be different of course)
24242

if it does show a PID number then do the following

busybox mount -o loop linux.img chroot

cd chroot/root

vi init.sh

At the bottom of the script you will see other pkill options

add pkill vnc or pkill tightvnc or whatever

safe the file

cd /data/local

umount chroot

then try again.. Sometimes for some reason menu-cached doesn't always get killed correctly when exiting which means it will not unmount

to manually unmount if it gets stuck without having to reboot type this from an adb shell or terminal

su

busybox lsof | grep chroot

you should see /rble/bleh/bleh/menu-cached

pkill menu-cached

cd /data/local/

umount chroot/dev

umount chroot

That should fix it without rebooting.
[Android Software/Hacking General [Developers Only]] noahthedominator:
I got an error when I did rm -rf chroot. It said I didn't have permissions to do it.
[Android Software/Hacking General [Developers Only]] userdelroot:
if you are using a file manager, you have to use the file manager with root privileges

If you are using adb shell or terminal

make sure you su first.

if that fails it is because it may be mounted try rebooting and try again.
[Android Software/Hacking General [Developers Only]] userdelroot:
Also PLEASE if you encounter an error or failure, please post that only.

Do not keep attempting to try it unless you know what you are doing..

The errors some are posting are because of the first set of errors. If it fails, there is a reason for it, don't rerun the install trying to bypass or hoping the failuer or error will go away, because it will not.

If you get an error post that please only.

Thanks
[Android Software/Hacking General [Developers Only]] noahthedominator:
Now reboot???
[Android Software/Hacking General [Developers Only]] userdelroot:
You have an error after you typed unmount chroot <---

You should stop and get answers before proceeding, just saying...

Yes you should reboot but it deleted without errors..

Reboot and then try to install.
[Android Software/Hacking General [Developers Only]] noahthedominator:
So try from the beginning or the from the rm -rf chroot part after I reboot?
[Android Software/Hacking General [Developers Only]] userdelroot:
Do a fresh install using the newest release if you do not have it already

If it fails, stop at fail and post here to get some answers before proceeding.
[Android Software/Hacking General [Developers Only]] ONDR4SH3K:
I will try a new release and maybe post video of installation for others.

Many problems come with bad busybox in system. Do you have be able to run your project with busybox from your bin directory, not from system?
[Android Software/Hacking General [Developers Only]] userdelroot:
Updated to 0.2.5-Alpha

I have corrected errors with setup.sh and lxdestart .motd missing.

lxdestart should now work with no issues. No need to install a different vnc.

Enjoy!

Also please let me know what devices you get it working on in a private message so I can add to main thread please.

Thanks
[Android Software/Hacking General [Developers Only]] ekdmfree:
Hello guys,

not sure why its failing to download anything...I guess everything went well...but failed at the end...please help

I am using NOTE2 with DN3 ROM 4.3 JB

checking mount point: [OK]

Mount location: /data/local/chroot

rootfs: [OK]

starting debootstrap

debootstrap --no-check-gpg --extractor=ar --arch=armhf --foreign precise /data/local/chroot

I: Retrieving Release

E: Failed getting release file http://ports.ubuntu.com/ubuntu-ports/dists/precise/Release

[fail]

Failure bailing out

sysctl: invalid option -- 'q'

BusyBox v1.19.4-wraithdu (2012-02-16 23:47:29 CST) multi-call binary.

Usage: sysctl [OPTIONS] [VALUE]...

Configure kernel parameters at runtime

-n Don't print key names

-e Don't warn about unknown keys

-w Change sysctl setting

-p FILE Load sysctl settings from FILE (default /etc/sysctl.conf)

-a Display all values

-A Display all values in table form
[Android Software/Hacking General [Developers Only]] userdelroot:
Your busybox version doesn't support -q option.

To fix install a different busybox or edit the install-or-mount script and

There are 2 locations in the script that use sysctl.

If you know how to edit scripts just fix it and I'll add fix to the script -q is just for quiet.
[Android Software/Hacking General [Developers Only]] ekdmfree:
Thank you very much for that...I will fix the scripts...just wondering if it has got anything to do with the download section where it says "failed"

---------- Post added at 04:17 PM ---------- Previous post was at 04:09 PM ----------

sorry, it failed again :(

I: Retrieving Release

E: Failed getting release file http://ports.ubuntu.com/ubuntu-ports/dists/precise/Release

[fail]

Failure bailing out

net.ipv4.ip_forward = 0
[Android Software/Hacking General [Developers Only]] userdelroot:
Please reboot device

Then from terminal or adb shell type

su

cd /data/local

rm -rf Linux.img

rm -rf chroot

then start install process again.

let me know what happens after that.
[Android Software/Hacking General [Developers Only]] brombomb:
Almost working now. The init.sh script is now working but I can't get through the graphical install. Vol Up inserts a ^C so I can't hit Vol Up + W.
[Android Software/Hacking General [Developers Only]] userdelroot:
use this.

hackers keyboard

https://play.google.com/store/apps/...board&pcampaignid=APPU_DrnqUuCzJYbvkQeMrIHIAg
[Android Software/Hacking General [Developers Only]] brombomb:
I installed it too late (used to always have it).
[Android Software/Hacking General [Developers Only]] userdelroot:
ok you get passed that screen?
[Android Software/Hacking General [Developers Only]] brombomb:
I exited the screen becuase it became unusable. I tried re installing but it was still mounted. I'll either need to do a clean re install or resume the init somehow.
[Android Software/Hacking General [Developers Only]] userdelroot:
use the mount switches and -r to get rootshell

they you can try to it it
[Android Software/Hacking General [Developers Only]] userdelroot:
[MENTION=2154548]ONDR4SH3K[/MENTION]

My busybox probably will not work on all devices as it was built for kitkat 4.4.3 and it uses the full android source (CyanogenMod) and it uses the nexus 7 2013 library's to statically link to. With that said, if you look in in the install-or-mount/bin and type ls -la

you will see where all files are linked to. Most are linked to the default busybox on the system eg: /system/xbin/busybox or to specific files that the device comes with in /system/bin

However, for some reason some rom's places the busybox in /system/bin or /system/sbin which I do not check.

I will add checks for that.

I also need to add checks that if any of the required applets or binary's can not be located it bails out and lets the person know they need a busybox with blah blah...

So to accurately answer your question YES the prebuilt busybox included must be in the busybox/bin dir. That is an absolute last resort if the script can not find the required binary's on the system.

Hopefully that answered your question?
[Android Software/Hacking General [Developers Only]] userdelroot:
I am going to add that to the FAQ sometimes it can't unmount cause a file is in use. Plus add extra code to make sure they system unmounts.

For now if it does not unmount reboot device that will unmount it.

Then use the following...

install-or-mount -z -n linux.img /data/local/chroot -l /data/local -r

That will dump you into the chroot as root.

ls and you will see the setup.sh

if you edit that file towards the bottom you will

locale-gen ....

dpkg-reconfigure tzdata

delete those 2 lines safe file and do

sh setup.sh

If you get errors its ok as most of the stuff had already been done, and it doesn't hurt if you rerun it.
[Android Software/Hacking General [Developers Only]] Pulsa:
[MENTION=2819483]userdelroot[/MENTION] I always have a problem in graphical interface, I can't choose the region, and I can't proceed to the next step, I've press enter many times but there isn't any respond

Sent from My XZ1, XSP, and X8
[Android Software/Hacking General [Developers Only]] noahthedominator:
This is a little out of my league, and I don't wanna have to ask what the next step is every time. So if someone would make a written tutorial that would be amazing. But if no one does I'm not sure if I'm gonna try this?
[Android Software/Hacking General [Developers Only]] userdelroot:
If it fails, that is what the forum is for, is to get answers and or maybe it is something in the code that needs fixed.

What I mean fresh install is download the latest install-or-mount

delete the old one at /data/local/install-or-mount

extract new one

delete /data/local/linux.img

delete /data/local/chroot

then use the script to install chroot..

If the script fails on a failure post that error here so you can get help.
[Android Software/Hacking General [Developers Only]] userdelroot:
I will be uploading a new version here shortly that will not show that anymore.

In the mean time, did you try the space button ?
[Android Software/Hacking General [Developers Only]] Pulsa:
I have pass that graphical interface and now I'm facing new problem, I can't connect the vnc server, I've tried 3 different vnc viewer apps and still can't connect

By the way, tried space button in what?

Sent from My XZ1, XSP, and X8
[Android Software/Hacking General [Developers Only]] ekdmfree:
Thanks buddy and really appreciate your help...I tried it then and there by removing chroot and img file...rebooted as well but end up with the error tht I posed regarding downloading the files.

I am trying from adb shell...mobile and laptop is well connected to wi-fi with high speed internet...can browse the url mentioned so connectivity is not a issue as well.

Please help sir...thanks!

PS I am not a complete noob :)
[Android Software/Hacking General [Developers Only]] userdelroot:
lol @ PS

adb shell or terminal

su

cd /data/local

busybox mount -o loop linux.img chroot

cd chroot/debootstrap

post the debootstrap.log or pastebin it

cd ..

umount chroot
[Android Software/Hacking General [Developers Only]] TheEdgeOfRage:
I tried running it from the sdcard and I got the following error:

127|root@LT25i:/data/local/install-or-mount # sh install-or-unt -z -n linux. img -m /data/local/install-or-mount/chroot -l /storage/sdcarall-or-mount/chroot -l /storage/sdcard0 /ubuntu <
Preparing chroot enviroment
Image name: linux.img
Mount Location: /data/local/install-or-mount/chroot
Image Location: /storage/sdcard0/ubuntu

Setting up enviroment: [OK]
checking root: [OK]
checking mount point: [OK]

Mount location: /data/local/install-or-mount/chroot
rootfs: [fail]

>>CMD: [mount -o] ARGS: [loop /storage/sdcard0/ubuntu/linux.img /data/local/install-or-mount/chroot ]
>>>ERROR: [Usage: mount [-r] [-w] [-o options] [-t type] device directory]
1|root@LT25i:/data/local/install-or-mount #

Can someone hep please?
[Android Software/Hacking General [Developers Only]] userdelroot:
look at the example on main thread . then look at your command above.

I'll give ya a hint.. you have two -l -l switches.
[Android Software/Hacking General [Developers Only]] Pulsa:
[MENTION=2819483]userdelroot[/MENTION] I can't connect to vnc, I've tried 3 vnc viewer apps and all of them said that I've been refused why?

Sent from My XZ1, XSP, and X8
[Android Software/Hacking General [Developers Only]] userdelroot:
when you run

sh lxdestart

do you get any errors?

if not type the following

ps aux | grep -i vnc

does that show vnc running?
[Android Software/Hacking General [Developers Only]] Pulsa:
It show this

Sent from My XZ1, XSP, and X8
[Android Software/Hacking General [Developers Only]] PunkUnity:
http://pastebin.ca/2608991

My errors in that Link. I did a factory reset. Reinstalled omnirom.
[Android Software/Hacking General [Developers Only]] userdelroot:
Unless your rom was causing an issue with your phone, you should not have to do that at all. The chroot does not touch any android files nor does it modify them. Just an FYI.

I need to see the debootstrap log and it will display error messages.

Please enter a terminal or adb shell.

Type the following

[B]su[/B]

[B]cd /data/local/[/B]

[B]busybox mount -o loop linux.img chroot[/B]

[B]cd chroot/debootstrap[/B]

debootstrap.log is what we want to view.

Upload the debootstrap.log or dropbox or whatever so I can see that log please.
[Android Software/Hacking General [Developers Only]] PunkUnity:
I ran the commands. First error was "mount: mounting linux,img on croot failed: No such file or directory

also the same for the second command you gave me.

---------- Post added at 03:07 PM ---------- Previous post was at 02:40 PM ----------

http://pastebin.ca/2609004

My error after the mount command. Located near bottom of list in link

http://pastebin.ca/2609056

All new errors
[Android Software/Hacking General [Developers Only]] userdelroot:
Ok well 1 you are doing and making this WAY to difficult to diagnose.

You are attempt to cd to places that don't exist or are not mounted and running commands that are not even supposed to be ran unless inside the chroot enviroment which it does not appear you are.

With that said.

Please reboot your device.

once device comes back up please do the following ONLY. If you get an error please report that error before trying to go to the next step...

device rebooted

goto terminal or adb shell

type the following just like have I have it.

su

cd /data/local

ls

Does ls list chroot and linux.img ?

if it does not contain BOTH of those

please delete the one that is showing.

then use the install method in the example.

if you get the same error you were after the install process please do the following.

cd /data/local

ls

does the ls command now list BOTH chroot and linux.img ????

if so do the following.

cd /data/local

busybox mount -o loop chroot linux.img

cd chroot/debootstrap

Did cd chroot/debootstrap actually cd or give an error OR did you get any errors from the busybox mount command ?

if you did not receive an ERROR

then do

ls

did ls list the debootstrap.log ???

If so PLEASE upload that to dropbox or whatever so I can see that.

Once you upload please reboot device again to cleanly umount directory.
[Android Software/Hacking General [Developers Only]] userdelroot:
hmm that is odd.

please chroot into the linux enviroment

type the following command and let me know what it says.

x11vnc -q -localhost -display :0 -usepw

do yo get an error ?

to kill that if it you need to CTRL+C

I highly recommend using the hackers keyboard from the playstore OR ConnectBOT

As both allow you to type CTRL keys..

ConnectBot you touch your screen and it will say on the left of the screen

ctrl

touch the ctrl

then touch c on the keyboard

that will kill the process if it actually starts;.
[Android Software/Hacking General [Developers Only]] userdelroot:
Sorry bro I been busy and missed your response...

from adb shell if you have that or terminal please do the following....

This all assumes you are using the same as the example

su

cd /data/local

ls

is there chroot and linux.img should be if you got to downloading portion

busybox mount -o loop linux.img chroot

cd chroot/debootstrap

ls

do you see the debootstrap.log ?

Check that for errors, or upload to dropbox or somewhere else so I can see it please.
[Android Software/Hacking General [Developers Only]] userdelroot:
oops I just noticed this

You have a typo above it has croot ? try again with chroot
[Android Software/Hacking General [Developers Only]] Pulsa:
I get this, it says that command not available

Sent from My XZ1, XSP, and X8
[Android Software/Hacking General [Developers Only]] userdelroot:
That is an easy fix, seems like it didn't install.

here

type this

sudo apt-get install vim desktop-base x11-xserver-utils xfonts-base openssh-server openssh-client lxde menu-xdg hicolor-icon-theme gtk2-engines xfonts-100dpi xfonts-75dpi x11vnc xvfb --no-install-recommends -yq

Once that is done. then just

sh lxdestart

it will probably ask ya for password type one in

then you are good to go..
[Android Software/Hacking General [Developers Only]] Pulsa:
[MENTION=2819483]userdelroot[/MENTION] it's working now, thanks:thumbup:

I can confirm this work on Xperia SP running VanirAOSP with kernel from the ROM (boot.img)

Sent from My XZ1, XSP, and X8