BackTrack 5 for Android Smartphones - VERY UNSTABLE

Search This thread

msullivan

Senior Member
Aug 13, 2008
252
61
Iowa
WARNING: THIS IS NOT FOR THE FAINT OF HEART
UPDATE: My goal was to create a version of BackTrack 5 for ARM that was easy to use and install. As of this time, that IS NOT the case! The versions posted here are **probably not** going to work straight out of the box. If you know what you are doing in a Linux environment, you'll probably be able to get it working.

Because of this, the project is currently completely unsupported. You are free to dive in, but you are doing so with no support for me, and I'm not liable for any damage that might be done to your device's ROM.

I encourage you to pass this up unless you know what you are getting yourself into!



If you were referred here from the XDA-Developers.com article...
Hi there! Let's get one thing on the record here... this is *not* a native client! This is the chroot + VNC method that we'd been using to get Ubuntu running with Android for a while. The article makes it sound like that's the case, but sadly it's not. However, with the chroot + VNC method we can really run BackTrack 5 on an Android device, and it really does work. This takes some technical skills, and isn't for the non-Linux experienced user.

Requires a rooted device!

BackTrack 5 installation guides are making their way around this forum. I've tried to synthesize it all, but I've also added my own touches to help with usability and features, along with a workaround for the "ioctl LOOP_SET_FD failed" error message some people have been getting.

In theory this build is nearly universal, so if you have an Android device it should work. I've put it all in one zip file that you can download directly from my website, no hassles or wait timers.

If you are interested have a look, feel free to re-post. Credit goes to the BackTrack team and xda member anantshri (he's got skills, give him props guys), who built the base image file.

Information, download link, and installation guide at:
(SERVER OFFLINE, SEE BELOW)

If you like what you see help me out, hosting is expensive!
http://www.mattslifebytes.com/donate
(alternatively, you can show interest in the products and services featured on my website, if you know what I mean :p)

If you don't know what BackTrack is, you probably don't want it :)

BackTrack is an operating system based on Ubuntu Linux that is used for security testing (aka hacking) and digital forensics. I'm a master's degree student in computer security, so I love this OS... it can do awesome things. Turn on your Wi-Fi and you can do advanced network scans and tests right from your phone, no laptop required. For me this is hella-useful.

But besides just being an OS for hacking ****, it's also fully Ubuntu-based, so you can run it like a desktop, including running Firefox and other Linux applications.

Well guys my server had hardware failure (lol, my luck), so here's the website's content:
msullivan said:
The Download

This installation of BackTrack 5 is available as a compressed file that will need to be extracted. I recommend downloading this using Chrome or Firefox. Internet Explorer often doesn’t play well with large HTTP downloads.

The root account’s password and the VNC server password are both set to ‘root’ by default!

Mirror 1

Mirror 2

Mirror 3 (Provided by shenshang)

Mirror 4 (Provided by brilldoctor)

Mirror 5 (Thanks for uploading, PIIcoding)

The Description

If you want to run BackTrack 5 on your Android-powered device, read on, you’re in the right place! So the big news is that BackTrack 5 runs on Android phones. We’ve been able to run Ubuntu on these devices for quite some time too, but admittedly BackTrack on a smartphone is just awesome.

Anyway, files for using BackTrack 5 on an Android phone have been running around the internet, but sadly it’s kind of a mish-mash of links saying, “go download this, then get this, to then this, blah blah blah”. Too confusing for my simple brain, so I’ve rounded it all up and posted it in one place… right here. The version posted here has everything you should need to run BackTrack 5 on your Android device. I’ve also added a lot of goodies to help with the user experience that the other offerings don’t include:
  • Works around the ioctl LOOP_SET_FD failed error that many people have been receiving on Galaxy S devices (and others)
  • Asks the user if they want a VNC session upon start-up
  • Starts the SSH service automatically and displays device IP on start-up
  • Enables the Ubuntu repositories to Aptitude, so you can do package installation
  • Adds vim. Really, what distribution doesn’t come with vim by default? Seriously…
  • Sets the screen resolution to 800×480 default (should be compatible with most smartphone devices)

SU
This requires root!
You must be able to "su" at terminal. This ability is usually provided by software for rooting your phone. To see if you have rooted your phone correctly and it's working, go to your terminal emulator and type "su" <enter>. If it is working, you'll probably get a prompt asking you if you want to allow your terminal emulator root access. Hit accept/yes. Now you'll be back in your terminal emulator. Type "whoami" <enter>. If it responds with "root" or "uid 0", then you are properly rooted.

Busybox
This requires Busybox!
I am no longer providing an installer for Busybox because of issues getting it to work universally, so instead YOU need to go get a working build and install it (I believe "Busybox Installer" will work, but not tested). If you want to know if you have Busybox and it's working, go to your terminal emulator and type "su" <enter>, then "busybox ls" <enter>. If you get a printout of all the files in your current directory, then your Busybox will likely work with BackTrack 5 just fine. If you get an error, "busybox: not found", that means you either do not have Busybox, or it is not properly installed.

WARNING FOR CyanogenMod USERS
Before doing ANYTHING, please test for ext2 support by running (as root, at terminal) --> "modprobe ext2" <enter>

If this fails probably your device lacks ext2 support and the whole thing will screw up if you try to run it! Support for ext2 in CM is being worked on.


The Installation Guide

  • Enable Wi-Fi and connect to a Wi-Fi access point (* not required, but BT5 cannot use your data plan for internet access)
  • Download the zip file, extract anywhere
  • After extraction you’ll have one folder “bt5″; copy this folder to the root of your phone’s SD Card
  • Put card back in phone and/or unplug from USB
  • In a terminal emulator, type “su” <enter>, “cd /sdcard/bt5″ <enter>
  • Now you are ready to rock and roll, so issue “sh bt” <enter> (in the future to start BT5 skip the line above and come straight to this command)
  • If all is well you’ll now be running BackTrack 5 on your Android device; you can SSH to it via Wi-Fi (password ‘root’), or access it from VNC if you said “Yes” to the prompt asking if you wanted a VNC session
  • To get a GUI for BackTrack on your smartphone’s screen, download a VNC viewer from the market (many are free), then connect to host “127.0.0.1″, port “5901″, password “root”

Enjoy, boys and girls.

The Credits

The BackTrack 5 Development Team
anantshri on xda-developers (his blog: http://blog.anantshri.info/) for creating the image file to fit FAT32 filesystems
anantshi's original thread where it all began: http://xdaforums.com/showthread.php?t=1074169

Known Incompatibility
  • Voodoo lagfix kernel (possibly? reported, not confirmed)
 
Last edited:

Dr_Death

Senior Member
Aug 5, 2010
96
4
Hi thanks for the great work, I try it on my HTC WildFire with CyanogenMod7 2.3 CFW
this what i got when try it install it from the terminal:

$ su
# id
uid=0(root) guid=0(root)
#
# cd /sdcard/bt5
# sh installbusybox
installbusybox: 14: Syntax error: end of file unexpected (expecting "fi")
#
# sh bt
bt: 36: Syntex error: end of file unexpected (expecting "then")
#
:confused:
 

msullivan

Senior Member
Aug 13, 2008
252
61
Iowa
Hrm... I failed when packaging the version that got put up online (sorry). I'm fixing now, will update shortly.
 

Dr_Death

Senior Member
Aug 5, 2010
96
4
ok i remove the first two lines, and i got:

# sh installbusybox
BeginningBusyBox installation...
mount: mounting /dev/block/mtdbloc faild: No such file or directory
/sdcard/busybox: No such file or directory
cd:can't cd to /data/local
installbusybox: ./busybox: permission denied
cd:can't cd to /system/xbin
: No such file or directory
installbusybox: ./busybox: permission denied
If there were no error messages given above then installation was successfull
#

not sure why when i try to chmod 755 busybox nothing change!
 

Motodoido

Senior Member
Jan 22, 2011
320
163
Curitiba
export PATH=/data/local/bin:$PATH
$ $su
# cd /sdcard/bt5
# sh bt
mkdir failed for /data/local/mnt, File exists
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
bt: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
bt: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
bt: cannot create /data/local/mnt/etc/hosts: directory nonexistent
Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:
eth0: No such device

chroot: can't execute '/bin/bash': No such file or directory
Shutting down BackTrack ARM
failed.
failed.
failed.
failed.
losetup: /dev/loop7: No such device or address
#

I have this error when i try

Sent from my A953 using Tapatalk
 

tripacer99

Senior Member
Nov 23, 2010
276
27
Orlando, Florida
export PATH=/data/local/bin:$PATH
$ $su
# cd /sdcard/bt5
# sh bt
mkdir failed for /data/local/mnt, File exists
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
bt: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
bt: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
bt: cannot create /data/local/mnt/etc/hosts: directory nonexistent
Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:
eth0: No such device

chroot: can't execute '/bin/bash': No such file or directory
Shutting down BackTrack ARM
failed.
failed.
failed.
failed.
losetup: /dev/loop7: No such device or address
#

I have this error when i try

Sent from my A953 using Tapatalk

Same error here, Verizon Fascinate.
 

Dr_Death

Senior Member
Aug 5, 2010
96
4
I download the new package, and this what i got:
[drdeath@bl4ckb0x tools]$ ./adb shell

# id
uid=0(root) gid=0(root)
# cd sdcard/bt5
# ls
bt busybox installbusybox unionfs
bt5.img fsrw mountonly
# sh installbusybox
Beginning BusyBox installation...
/sdcard/busybox: No such file or directory
--install: applet not found
If there were no error messages given above then installation was successful!
# sh bt
mkdir: can't create directory '/data/local/mnt': File exists
Loop device exists
losetup: /dev/block/loop7: No such file or directory
mount: mounting /dev/block/loop7 on /data/local/mnt failed: Device or resource busy
mount: mounting devpts on /data/local/mnt/dev/pts failed: No such file or directory
mount: mounting proc on /data/local/mnt/proc failed: No such file or directory
mount: mounting sysfs on /data/local/mnt/sys failed: No such file or directory
net.ipv4.ip_forward = 1
bt: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
bt: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
bt: cannot create /data/local/mnt/etc/hosts: directory nonexistent
Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:
eth0: ip 192.168.2.13 mask 255.255.255.0 flags [up broadcast running multicast]

chroot: can't execute '/bin/bash': No such file or directory
Shutting down BackTrack ARM
umount: can't umount /data/local/mnt/dev/pts: No such file or directory
umount: can't umount /data/local/mnt/proc: No such file or directory
umount: can't umount /data/local/mnt/sys: No such file or directory
umount: can't umount /data/local/mnt: Invalid argument
losetup: /dev/loop7: Device or resource busy
#
 

msullivan

Senior Member
Aug 13, 2008
252
61
Iowa
Hrm yet another small error in one of the scripts. So sorry :S (this script is from the BT5 team though, so I take no fault in it not working, lol).

Open "installbusybox" in a text editor and replace the text "cat /sdcard/busybox" with "cat /sdcard/bt5/busybox" it should work. I'll fix it and put it up online once I'm home from work today.
 

Dr_Death

Senior Member
Aug 5, 2010
96
4
Hrm yet another small error in one of the scripts. So sorry :S (this script is from the BT5 team though, so I take no fault in it not working, lol).

Open "installbusybox" in a text editor and replace the text "cat /sdcard/busybox" with "cat /sdcard/bt5/busybox" it should work. I'll fix it and put it up online once I'm home from work today.
thanks for your time and for your help :)
now i got:
# sh installbusybox
Beginning BusyBox installation...
[1] Illegal instruction ./busybox cp /da...
--install: applet not found
If there were no error messages given above then installation was successful!
#
# cat installbusybox
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
echo "Beginning BusyBox installation..."
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cat /sdcard/bt5/busybox > /data/local/busybox
chmod 755 /data/local/busybox
#/data/local/busybox mkdir /system/xbin
cd /data/local
./busybox cp /data/local/busybox /system/xbin
cd /system/xbin
chmod 755 busybox
./busybox --install -s /system/xbin
rm /data/local/busybox
echo "If there were no error messages given above then installation was successful!"
# ls /data/local/busybox
ls: /data/local/busybox: No such file or directory
#
 

Top Liked Posts

  • There are no posts matching your filters.
  • 48
    WARNING: THIS IS NOT FOR THE FAINT OF HEART
    UPDATE: My goal was to create a version of BackTrack 5 for ARM that was easy to use and install. As of this time, that IS NOT the case! The versions posted here are **probably not** going to work straight out of the box. If you know what you are doing in a Linux environment, you'll probably be able to get it working.

    Because of this, the project is currently completely unsupported. You are free to dive in, but you are doing so with no support for me, and I'm not liable for any damage that might be done to your device's ROM.

    I encourage you to pass this up unless you know what you are getting yourself into!



    If you were referred here from the XDA-Developers.com article...
    Hi there! Let's get one thing on the record here... this is *not* a native client! This is the chroot + VNC method that we'd been using to get Ubuntu running with Android for a while. The article makes it sound like that's the case, but sadly it's not. However, with the chroot + VNC method we can really run BackTrack 5 on an Android device, and it really does work. This takes some technical skills, and isn't for the non-Linux experienced user.

    Requires a rooted device!

    BackTrack 5 installation guides are making their way around this forum. I've tried to synthesize it all, but I've also added my own touches to help with usability and features, along with a workaround for the "ioctl LOOP_SET_FD failed" error message some people have been getting.

    In theory this build is nearly universal, so if you have an Android device it should work. I've put it all in one zip file that you can download directly from my website, no hassles or wait timers.

    If you are interested have a look, feel free to re-post. Credit goes to the BackTrack team and xda member anantshri (he's got skills, give him props guys), who built the base image file.

    Information, download link, and installation guide at:
    (SERVER OFFLINE, SEE BELOW)

    If you like what you see help me out, hosting is expensive!
    http://www.mattslifebytes.com/donate
    (alternatively, you can show interest in the products and services featured on my website, if you know what I mean :p)

    If you don't know what BackTrack is, you probably don't want it :)

    BackTrack is an operating system based on Ubuntu Linux that is used for security testing (aka hacking) and digital forensics. I'm a master's degree student in computer security, so I love this OS... it can do awesome things. Turn on your Wi-Fi and you can do advanced network scans and tests right from your phone, no laptop required. For me this is hella-useful.

    But besides just being an OS for hacking ****, it's also fully Ubuntu-based, so you can run it like a desktop, including running Firefox and other Linux applications.

    Well guys my server had hardware failure (lol, my luck), so here's the website's content:
    msullivan said:
    The Download

    This installation of BackTrack 5 is available as a compressed file that will need to be extracted. I recommend downloading this using Chrome or Firefox. Internet Explorer often doesn’t play well with large HTTP downloads.

    The root account’s password and the VNC server password are both set to ‘root’ by default!

    Mirror 1

    Mirror 2

    Mirror 3 (Provided by shenshang)

    Mirror 4 (Provided by brilldoctor)

    Mirror 5 (Thanks for uploading, PIIcoding)

    The Description

    If you want to run BackTrack 5 on your Android-powered device, read on, you’re in the right place! So the big news is that BackTrack 5 runs on Android phones. We’ve been able to run Ubuntu on these devices for quite some time too, but admittedly BackTrack on a smartphone is just awesome.

    Anyway, files for using BackTrack 5 on an Android phone have been running around the internet, but sadly it’s kind of a mish-mash of links saying, “go download this, then get this, to then this, blah blah blah”. Too confusing for my simple brain, so I’ve rounded it all up and posted it in one place… right here. The version posted here has everything you should need to run BackTrack 5 on your Android device. I’ve also added a lot of goodies to help with the user experience that the other offerings don’t include:
    • Works around the ioctl LOOP_SET_FD failed error that many people have been receiving on Galaxy S devices (and others)
    • Asks the user if they want a VNC session upon start-up
    • Starts the SSH service automatically and displays device IP on start-up
    • Enables the Ubuntu repositories to Aptitude, so you can do package installation
    • Adds vim. Really, what distribution doesn’t come with vim by default? Seriously…
    • Sets the screen resolution to 800×480 default (should be compatible with most smartphone devices)

    SU
    This requires root!
    You must be able to "su" at terminal. This ability is usually provided by software for rooting your phone. To see if you have rooted your phone correctly and it's working, go to your terminal emulator and type "su" <enter>. If it is working, you'll probably get a prompt asking you if you want to allow your terminal emulator root access. Hit accept/yes. Now you'll be back in your terminal emulator. Type "whoami" <enter>. If it responds with "root" or "uid 0", then you are properly rooted.

    Busybox
    This requires Busybox!
    I am no longer providing an installer for Busybox because of issues getting it to work universally, so instead YOU need to go get a working build and install it (I believe "Busybox Installer" will work, but not tested). If you want to know if you have Busybox and it's working, go to your terminal emulator and type "su" <enter>, then "busybox ls" <enter>. If you get a printout of all the files in your current directory, then your Busybox will likely work with BackTrack 5 just fine. If you get an error, "busybox: not found", that means you either do not have Busybox, or it is not properly installed.

    WARNING FOR CyanogenMod USERS
    Before doing ANYTHING, please test for ext2 support by running (as root, at terminal) --> "modprobe ext2" <enter>

    If this fails probably your device lacks ext2 support and the whole thing will screw up if you try to run it! Support for ext2 in CM is being worked on.


    The Installation Guide

    • Enable Wi-Fi and connect to a Wi-Fi access point (* not required, but BT5 cannot use your data plan for internet access)
    • Download the zip file, extract anywhere
    • After extraction you’ll have one folder “bt5″; copy this folder to the root of your phone’s SD Card
    • Put card back in phone and/or unplug from USB
    • In a terminal emulator, type “su” <enter>, “cd /sdcard/bt5″ <enter>
    • Now you are ready to rock and roll, so issue “sh bt” <enter> (in the future to start BT5 skip the line above and come straight to this command)
    • If all is well you’ll now be running BackTrack 5 on your Android device; you can SSH to it via Wi-Fi (password ‘root’), or access it from VNC if you said “Yes” to the prompt asking if you wanted a VNC session
    • To get a GUI for BackTrack on your smartphone’s screen, download a VNC viewer from the market (many are free), then connect to host “127.0.0.1″, port “5901″, password “root”

    Enjoy, boys and girls.

    The Credits

    The BackTrack 5 Development Team
    anantshri on xda-developers (his blog: http://blog.anantshri.info/) for creating the image file to fit FAT32 filesystems
    anantshi's original thread where it all began: http://xdaforums.com/showthread.php?t=1074169

    Known Incompatibility
    • Voodoo lagfix kernel (possibly? reported, not confirmed)
    5
    This will solve all of your problems...

    Requirements:
    1. root
    2. busybox
    3. remove apps from SDCard (use titanium backup)
    4. Place any Ubuntu variant img in /sdcard/ubuntu/ubuntu.img
    note: img should be EXT4 filesystem format

    Code:
    #! $SHELL
    #AndBuntu 
    #Android 2.2 Ubuntu launcher
    #Copyright 2011 Adam Outler
    #
    #   Licensed under the Apache License, Version 2.0 (the "License");
    #   you may not use this file except in compliance with the License.
    #   You may obtain a copy of the License at
    #
    #       http://www.apache.org/licenses/LICENSE-2.0
    #
    #   Unless required by applicable law or agreed to in writing, software
    #   distributed under the License is distributed on an "AS IS" BASIS,
    #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    #   See the License for the specific language governing permissions and
    #   limitations under the License.
    
    
    #Generate a ubuntu.img file on Ubuntu with the following commands:
    
    # cd ~/Desktop
    # sudo apt-get install rootstock
    # sudo rootstock --dist maverick --seed lxde,tightvncserver,openoffice.org,gimp,ssh, -fqdn localhost --login ubuntu --password ubuntu --imagesize 3800M --notarball --fullname "Ubuntu for Android" --kbmodel pc104  --locale en_US.UTF-8 --serial ttyS0  --doswap --swapsize 256M 
    
    #This will generate a *************.img file.  Rename this file "ubuntu.img".
    #Copy this script and your new ubuntu.img file to your android's /sdcard/ubuntu/ folder
    #Open any Terminal Emulator and execute this script with the following command:
    
    # cd /sdcard/ubuntu
    # su
    # sh uboot
    
    
    
    clear
    helpfulExit (){
     echo "The command executed failed.  please search for this
    command on Google.  If that fails, try www.UbuntuForums.org."
     exit
    }
    
    echo "Setting up environmental variables."
    export UbuntuLoopFS=/sdcard/ubuntu/ubuntu.img
    export UbuntuMountPoint=/data/local/mnt
    export PATH=/system/bin:/usr/bin:/usr/sbin:/bin:$PATH
    export TERM=linux
    export HOME=/root
    export USER=root
    test "$SHELL" = "" && export SHELL="sh"
    echo "Environment is: $SHELL"
    Dependency=""
    echo "Verifying dependencies..."
    Dependency="mount"
    if ! which $Dependency >/dev/null; then MissingDeps="$MissingDeps $Dependency"; fi
    Dependency="mknod"
    if ! which $Dependency >/dev/null; then MissingDeps="$MissingDeps $Dependency"; fi
    Dependency="rm"
    if ! which $Dependency >/dev/null; then MissingDeps="$MissingDeps $Dependency"; fi
    Dependency="ln"
    if ! which $Dependency >/dev/null; then MissingDeps="$MissingDeps $Dependency"; fi
    Dependency="expr"
    if ! which $Dependency >/dev/null; then MissingDeps="$MissingDeps $Dependency"; fi
    Dependency="grep"
    if ! which $Dependency >/dev/null; then MissingDeps="$MissingDeps $Dependency"; fi
    Dependency="chroot"
    if ! which $Dependency >/dev/null; then MissingDeps="$MissingDeps $Dependency"; fi
    Dependency="sysctl"
    if ! which $Dependency >/dev/null; then MissingDeps="$MissingDeps $Dependency"; fi
    Dependency="umount"
    if ! which $Dependency >/dev/null; then MissingDeps="$MissingDeps $Dependency"; fi
    if [ "$MissingDeps" != "" ]; then
      echo "*********WARNING**********"
      echo "MISSING DEPENDENCIES FOUND"
      echo "THE MISSING DEPENDENCIES.."
      echo "$MissingDeps"
      echo "*********WARNING**********"
    fi
    
    
    echo "Remounting root filesystem as rewritable"
    mount -o remount,rw -t ext4 rootfs /
    if [ $? != 0 ]; then
      echo "    Failure...
    YOU MUST BE ROOT!  
    *****ERROR*****
    command failed
        mount -o remount,rw -t ext4 rootfs /
    Attemted to mount a new root filesystem as EXT4 and failed.
    Your system must be Android 2.2 compatible and support EXT4 filesystems"
      echo "trying again.. "
    
      if [ ! -h /system/lib ]; then
        cp -r /lib /system/lib 
        rm -r /lib 
        ln -s /system/lib /lib
      fi 
    
      mount -o remount,rw -t ext4 rootfs /
      if [ $? = 0 ]; then
        echo "Sucessful"
      else 
        echo "FAILED. YOU MUST BE ROOT."
        echo "Type 'su' first to attain root access"
        echo "The command run was:
        mount -o remount,rw -t ext4 rootfs /"
        helpfulExit
      fi
    fi
    
    
    
    
    echo "Attempting to remount /system dir as RW... "
    mount -o remount,rw -t ext4 /dev/block/mtdblock3 /system
    if [ $? != 0 ]; then
      echo "    failed...  
    *****ERROR*****
    command was 
      mount -o remount,rw -t ext4 /dev/block/mtdblock3 /system
    Your system must be Android 2.2 compatible and support EXT4 filesystems."
      helpfulExit
    fi
    
    
    
    echo "Removing preexisting loopfs devices."
    #rm /dev/loop* 2>&1 >/dev/null
    
    FreeLoop=`losetup -f`
    x=${FreeLoop#${FreeLoop%?}}
    echo "setting up $FreeLoop"
    test ! -e "$FreeLoop" && mknod "$FreeLoop" b 7 "$x"
    
    
    FreeLoop=`losetup -f`
    x=${FreeLoop#${FreeLoop%?}}
    echo "setting up $FreeLoop"
    test ! -e "$FreeLoop" && mknod "$FreeLoop" b 7 "$x"
    
    x=1
    FreeLoop=/dev/loop1
    #losetup $FreeLoop /sdcard/ubuntu/ubuntu.img
    
    echo "Checking for interference mount points"
    existingMounts=`mount |grep "$UbuntuMountPoint/dev/pts"|awk '{print $3}'`
    if [ "$existingMounts" != "" ]; then
      umount  "$UbuntuMountPoint/dev/pts"
      umount  "$UbuntuMountPoint/proc"
      umount  "$UbuntuMountPoint/sys"
      umount  "$UbuntuMountPoint"
    fi
    
    test ! -e "$UbuntuMountPoint" && mkdir "$UbuntuMountPoint"
    
    
    echo "Mounting $UbuntuLoopFS at $UbuntuMountPoint as EXT4 Filesystem"
    mount -o loop,noatime -t ext4 $UbuntuLoopFS $UbuntuMountPoint
    if [ -e $UbuntuMountPoint/etc ]; then
      echo "Mounted $UbuntuLoopFS as EXT4 loopFS at $UbuntuMountPoint/ubuntu.img"
    else
      echo "Error in mounting $UbuntuLoopFS as loop EXT4 filesystem
    the command executed was
        mount -o loop,noatime -t ext4 $UbuntuLoopFS $UbuntuMountPoint
      The filesystem may have been of the wrong type.  Check to make sure $UbuntuMountPoint falls within the following filesystems:"
      mount |grep ext4|sed s/\(.*// 
      helpfulExit
    fi
    
    
    echo "Mounting $UbuntuMountPoint/dev/pts"
    mount -t devpts devpts "$UbuntuMountPoint/dev/pts"
    test $? != 0 && echo "Failed mounting $UbuntuMountPoint/dev/pts as devpts filesystem type"
    echo "Mounting $UbuntuMountPoint/dev/proc"
    mount -t proc proc "$UbuntuMountPoint/proc"
    test $? != 0 && echo "Failed mounting $UbuntuMountPoint/proc as proc filesystem type"
    echo "Mounting $UbuntuMountPoint/dev/proc"
    mount -t sysfs sysfs "$UbuntuMountPoint/sys"
    test $? != 0 && echo "Failed mounting $UbuntuMountPoint/sys as sysfs filesystem type"
    
    echo "Setting up network forward..."
    sysctl -w net.ipv4.ip_forward=1
    
    
    echo "checking /etc/resolv.conf s.."
    if ! grep "nameserver 8.8.8.8" "$UbuntuMountPoint/etc/resolv.conf" 2>&1 >/dev/null ; then
      echo "adding nameserver 8.8.8.8"
      echo "nameserver 8.8.8.8" > "$UbuntuMountPoint/etc/resolv.conf"
    fi
    if ! grep "nameserver 8.8.4.4" "$UbuntuMountPoint/etc/resolv.conf"  2>&1 >/dev/null ; then
      echo "adding nameserver 8.8.4.4"
      echo "nameserver 8.8.4.4" >> "$UbuntuMountPoint/etc/resolv.conf"
    fi
    
    
    echo "checking localhost entries in /etc/hosts and $UbuntuMountPoint/etc/hosts"
    if ! grep '127.0.0.1 localhost' /etc/hosts 2>&1 >/dev/null ; then
      echo '127.0.0.1 localhost' > /etc/hosts
      echo 'Adding localhost to /etc/hosts'
    fi
    if ! grep '127.0.0.1 localhost' "$UbuntuMountPoint/etc/hosts" 2>&1 >/dev/null ; then
      echo '127.0.0.1 localhost'>"$UbuntuMountPoint/etc/hosts"
      echo 'Adding localhost to $UbuntuMountPoint/etc/hosts'
    fi
    
    
    test ! -h /lib && rm -r /lib && ln -s /system/lib /lib
    
    if [ -e "$UbuntuMountPoint/bin/bash" ]; then
      echo "Clearing $UbuntuMountPoint/tmp.."
      rm -r "$UbuntuMountPoint/tmp"
      mkdir "$UbuntuMountPoint/tmp"
    
    #generate quit script
      echo "#! /bin/bash">$UbuntuMountPoint/usr/bin/q
      echo 'X=`ps 2>&1 |awk '"'"'{print $1}'"'"' |tr -d PID `'>>$UbuntuMountPoint/usr/bin/q
      echo 'echo $X'>>$UbuntuMountPoint/usr/bin/q
      echo "kill \$X">>$UbuntuMountPoint/usr/bin/q
      chmod 777 $UbuntuMountPoint/usr/bin/q
    
    
    #generate helper script to fix things
      echo "#! /bin/bash">"$UbuntuMountPoint/usr/bin/firstRun"
      echo 'rm /dev/ptmx
    mknod --mode 666 /dev/ptmx c 5 2
    /bin/dbus-uuidgen --ensure'>>"$UbuntuMountPoint/usr/bin/firstRun"
      chmod 777 "$UbuntuMountPoint/usr/bin/firstRun"
      
    
    
    
      echo "Ubuntu is ready! Chrooting terminal into Ubuntu distribution."
      echo "type 'q' to quit"
    
    
    
      chroot "$UbuntuMountPoint" "/bin/bash"
    else 
      echo "Failed... Bash is not mounted at $UbuntuMountPoint/bin/bash"
      echo "the command executed was
        chroot $UbuntuMountPoint /bin/bash"
      helpfulExit
    fi
    #After exit command is executed clear it all up
    echo " "
    
    echo "Shutting down Ubuntu"
    umount $UbuntuMountPoint/dev/pts
    umount $UbuntuMountPoint/proc 
    umount $UbuntuMountPoint/sys 
    umount $UbuntuMountPoint
    You can VNC into your android after apt-get install tightvncserver.


    AndBuntu is the first Android EXT4 compatible image file mounter/chrooter.
    3
    Re: Installing bt5 on android

    REQUIREMENTS:
    1.your phone must be rooted
    2.apps to be installed on your phone androidvnc,terminal emulator.get these from market

    TUTORIAL:
    on pc:

    After downloading arm version of backtack5 extract it on ur pc and must have 5 files on it .
    1.bt
    2.bt5.img
    3.fsrw
    4.mountonly
    5.unionfs
    step1:
    open the bt file in wordpad,delete all its contents and paste the following code and save it

    ##########################################
    #Back Track boot script V5 for Android #
    #Built by Zachary Powell (zacthespack) #
    #Modded for Galaxy S3 by Michael Lee on 01SEP2012 #
    #Thanks to everyone at XDA! #
    ##########################################
    perm=$(id|cut -b 5)
    if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
    mount -o remount,rw /dev/block/mmcblk0p5 /system
    export kit=/sdcard/bt5
    export bin=/system/bin
    export mnt=/data/local/mnt
    export sdcard=/mnt/sdcard
    export extsd=/mnt/extSdCard
    export USER=root
    if [ ! -d "$mnt" ]; then
    mkdir $mnt
    fi
    export PATH=$bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
    export TERM=linux
    export HOME=/root
    if [ -b /dev/block/loop255 ]; then
    echo "Loop device exists"
    else
    busybox mknod /dev/block/loop255 b 7 255
    fi
    #mount -o loop,noatime -t ext2 $kit/bt5.img $mnt
    losetup /dev/block/loop255 $kit/bt5.img
    mount -t ext2 /dev/block/loop255 $mnt
    mount -t devpts devpts $mnt/dev/pts
    mount -t proc proc $mnt/proc
    mount -t sysfs sysfs $mnt/sys
    mount -o bind /mnt/sdcard $sdcard
    mount -o bind /mnt/extSdCard $extsd

    if [ ! -d "/data/local/mnt/sdcard" ]; then
    mkdir /data/local/mnt/sdcard
    fi
    busybox mount -o bind /sdcard /data/local/mnt/sdcard
    busybox sysctl -w net.ipv4.ip_forward=1
    echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
    echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
    echo "127.0.0.1 localhost bt5" > $mnt/etc/hosts
    echo "Back Track is configured with SSH and VNC servers that can be accessed from the IP:"
    ifconfig wlan0
    echo " "
    busybox chroot $mnt /bin/bash

    echo "Shutting down BackTrack ARM"
    umount $sdcard
    umount $extsd
    umount $mnt/dev/pts
    umount $mnt/proc
    umount $mnt/sys
    umount $mnt
    losetup -d /dev/block/loop255

    step 2:
    create a folder named bt5 and move all the 5 files to that folder
    connect phone's sdcard to the pc and copy bt5 folder to the root of your sdcard

    ON PHONE:

    STEP3:
    open terminal emulator
    code:
    cd sdcard/bt5 [you must be on bt5 folder]
    su [for granting super user access]
    sh bt

    then it asks for [do you want to start a vnc server]? type y
    then terminal window is like this

    root@localhost:~#
    then type startvnc and press enter
    root@localhost:~# startvnc
    minimize the terminal emulator app

    STEP 4:
    open androidvnc app

    in the connection option select new

    in the nickname option type root

    in the password option type root

    in the address option type 127.0.0.1

    in the port option type 5901

    in the color format option select 24-bit color

    and leave the others
    STEP 5:

    click on the connect button.:)
    BACKTRACK5 WILL SURELY RUN ON YOUR ANDROID PHONE
    3
    2
    Old news...

    Btw.. if you're having problems, migrate apps from SDCard to Internal memory.

    edit: Just realized this came off kinda ****-like... So here http://xdaforums.com/showpost.php?p=13924701&postcount=109