[Guide] Ubuntu Lucid 10.04 Defy CHROOT port

Search This thread

mihovil13

Senior Member
May 9, 2011
1,131
292
Ubuntu Lucid 10.04 android-vnc Defy port
s16r3.png

THIS DOESNT MODIFY, REPLACE OR CHANGE YOUR CURRENT ROM OR ANDROID OS. IT RUNS IN CHROOT USING VNC, LIKE A VIRTUAL MACHINE! SO IT CANNOT BRICK OR HARM YOUR DEVICE!



Installation guide
1. Download Ubuntu image from Downloads section
2. Extract Ubuntu 7-zip file contents to /sdcard/ubuntu
3. Download ubuntu.sh from attachments to /sdcard/ubuntu and replace the existing one
4. Start Terminal Emulator
5. Type in the following lines, each line is followed by enter (return) key, you'll need to run this only the first time :
su
cd /sdcard/ubuntu
sh ubuntu.sh
6. The Installation script starts and it creates necessary files and folders on internal memory, type in starttux
7. When the starttux command finishes, type in ui
8. Now you'll have to switch to android-vnc-viewer without closing Terminal Emulator (press home key to go to launcher and start vnc)
9. Setup VNC viewer :
password : 12345678
address : 127.0.0.1
port : 5901
color format : 24-bit color
10. Now press connect and Ubuntu GUI will start!
11. To exit Ubuntu GUI press menu while in vnc -> disconnect
12. Return to terminal emulator and type in killui
13. Type stoptux
14. Type exit
15. Type exit if Terminal is still opened, reboot device for proper unmount.

Video instalation guide :
http://www.youtube.com/watch?v=O9ercgiqwi0


Notes :
  • Tested on Defy CM10 2007+ by Quarx and HTC HD2 CM9 4.0.4 HWA build
  • I recommend using touchpad as input in vnc viewer
  • 127.0.0.1 is known as localhost
  • If you have any errors post them here
  • The script can run without ubuntu.sh from downloads, but I recommend to replace it anyway
  • Credits : anantshri for image file
  • Soon I'll port Backtrack 5
  • Fell free to donate :)
 
Last edited:

mihovil13

Senior Member
May 9, 2011
1,131
292
F.A.Q

Q : Can this brick or harm my device?!

A : It simply can't cause it doesn't change anything inside your system!

Q : Is this a ROM or what?

A : THIS ISN'T A CUSTOM ROM! This is an image file that starts using Terminal and VNC (for gui), and it doesn't change or modify your system.
Just like a virtual machine.

Q : Can we use BT keyboard & mouse?

A : Yes.

Q : I've got problems with mouse/keyboard mapping, solution?

A : Open $HOME/.vnc/xstartup file with a text editor, and copy the text below :

Code:
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
#x-window-manager &
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

For noobs : "XKL_XMODMAP_DISABLE=1" fixes the mapping or wrong positioning the mouse.

Q : Can we use this for other devices than Defy?

A : The script supports ext4 module roms, so it should work on ICS (I've tested on Jelly Bean) and GB rooted devices.
To change the resolution (by default 850x480) type this into the terminal after starttux command :

Code:
vncserver -geometry 1280×800

1280x800 represents scren resolution, so if you use SGS3 e.g, use vncserver -geometry 1280x720

Q :Can this work on ARMv6?

A : I don't have an ARMv6 device, so I haven't tested it, I think that it may work pretty slow, but it should still work somehow.
So please, if anyone has ARMv6 based device, please test and report.
 
Last edited:

mihovil13

Senior Member
May 9, 2011
1,131
292
Both 11.04 and 12.04 aren't supported on our CPU or it would be slow (their image files are way to big for my sd card)

I've also tried this on HTC HD2 and it works.

Tommorow expect Backtrack 5.
 
  • Like
Reactions: espaciosalter20

mihovil13

Senior Member
May 9, 2011
1,131
292
Thanks for the link, I'll try in cca 12h.
Also tommorow (in my time) I'll post a port of BT5 (I hope that this script could get it work)
 

Posse666

Member
Jun 16, 2010
38
4
Can I install and play linux games?
Is it possible to connect Bluetooth mouse and keyword?

Sent from my MB525 using xda app-developers app
 

mihovil13

Senior Member
May 9, 2011
1,131
292
Yes it is, I use BT mouse and keyboard, games are already installed.
I'll edit FAQ now
 

oxristsis

Senior Member
Oct 5, 2011
75
3
Problem

I have followed all the steps in terminal but i get an error after i enter 'starttux'.
See the screenshot if u can help me,,, thank u

2hdmidj.png
 
Last edited:

mihovil13

Senior Member
May 9, 2011
1,131
292
I have followed all the steps in terminal but i get an error after i enter 'starttux'.
See the screenshot if u can help me,,, thank u

2hdmidj.png

Try changing the script files using Notepad++ to this (delete all the text and replace with this)
ubuntu.sh

Code:
echo " "
echo "Ubuntu Chroot v0.2-anant-netbook"
echo "This process does NOT damage Android OS!"
echo " "
echo "Original Script by Charan Singh"
echo "Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net"
echo "Xperia Customized by Anant shrivastava http://anantshri.info "
echo " "
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
echo "Cleaning up old Chunks . . ."
rm /system/bin/tuxcmd
rm /system/bin/starttux
rm /system/bin/stoptux
echo "Creating necessary directories"
if [ ! -d /data/local/mnt ]
then
mkdir /data/local/mnt
fi
#copy the files to places
echo "Setting up files"
cp -f starttux /system/bin
cp -f stoptux /system/bin
cp -f tuxcmd /system/bin
echo "Ubuntu is now configure!"
echo " "
echo "to Start ubuntu type 'starttux'"
echo "once ubuntu started use tuxcmd to gain shell"
echo "when you want to shutdown type 'stoptux'"

starttux

Code:
#Mount SYSTEM RW
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
#exporting useful variables
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
# Mounting Image to the farthest loop point
# FIXME : check if mount sucessfull otherwise abort whole process.
mknod /dev/block/loop255 b 7 255
busybox losetup /dev/block/loop255 $kit/ubuntu.img
busybox 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
# Mounting SD Card inside the CHROOT
busybox mount -o bind /sdcard /data/local/mnt/sdcard
#seting environment
sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo "Customized by Anant shrivastava http://anantshri.info"
echo "Ubuntu configured to use it just type 'tuxcmd'"

tuxcmd

Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo "Customized by Anant shrivastava http://anantshri.info"
echo " "
busybox chroot $mnt /bin/bash

stoptux

Code:
#Cleanup
#After exit command is executed clear it all up
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
echo "Cleaning the Ubuntu leftover and returning back the memory to Android."
echo "by Anant Shrivastava http://anantshri.info "
echo "Shutting down Ubuntu"
sync
busybox umount -l $mnt/sdcard
busybox umount -l $mnt/dev/pts
busybox umount -l $mnt/proc 
busybox umount -l $mnt/sys 
busybox umount -l $mnt
busybox losetup -d /dev/block/loop255
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
echo " "
echo "Please reboot to properly unmount Ubuntu"
echo "Specially If you recieved an error before this line"



You maybe even don't have to go type tuxcmd after the starttux shell, if the shell changes to root:localhost automatically, then just type ui
 

mihovil13

Senior Member
May 9, 2011
1,131
292
Yes but there's gnome preinstalled in the image

Swyped off my Defy using Jelly Bean
 

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    Ubuntu Lucid 10.04 android-vnc Defy port
    s16r3.png

    THIS DOESNT MODIFY, REPLACE OR CHANGE YOUR CURRENT ROM OR ANDROID OS. IT RUNS IN CHROOT USING VNC, LIKE A VIRTUAL MACHINE! SO IT CANNOT BRICK OR HARM YOUR DEVICE!



    Installation guide
    1. Download Ubuntu image from Downloads section
    2. Extract Ubuntu 7-zip file contents to /sdcard/ubuntu
    3. Download ubuntu.sh from attachments to /sdcard/ubuntu and replace the existing one
    4. Start Terminal Emulator
    5. Type in the following lines, each line is followed by enter (return) key, you'll need to run this only the first time :
    su
    cd /sdcard/ubuntu
    sh ubuntu.sh
    6. The Installation script starts and it creates necessary files and folders on internal memory, type in starttux
    7. When the starttux command finishes, type in ui
    8. Now you'll have to switch to android-vnc-viewer without closing Terminal Emulator (press home key to go to launcher and start vnc)
    9. Setup VNC viewer :
    password : 12345678
    address : 127.0.0.1
    port : 5901
    color format : 24-bit color
    10. Now press connect and Ubuntu GUI will start!
    11. To exit Ubuntu GUI press menu while in vnc -> disconnect
    12. Return to terminal emulator and type in killui
    13. Type stoptux
    14. Type exit
    15. Type exit if Terminal is still opened, reboot device for proper unmount.

    Video instalation guide :
    http://www.youtube.com/watch?v=O9ercgiqwi0


    Notes :
    • Tested on Defy CM10 2007+ by Quarx and HTC HD2 CM9 4.0.4 HWA build
    • I recommend using touchpad as input in vnc viewer
    • 127.0.0.1 is known as localhost
    • If you have any errors post them here
    • The script can run without ubuntu.sh from downloads, but I recommend to replace it anyway
    • Credits : anantshri for image file
    • Soon I'll port Backtrack 5
    • Fell free to donate :)
    1
    Both 11.04 and 12.04 aren't supported on our CPU or it would be slow (their image files are way to big for my sd card)

    I've also tried this on HTC HD2 and it works.

    Tommorow expect Backtrack 5.
    1
    Both 11.04 and 12.04 aren't supported on our CPU or it would be slow (their image files are way to big for my sd card)

    I've also tried this on HTC HD2 and it works.

    Tommorow expect Backtrack 5.

    Pre-Installed 11.10 and 12.04 OMAP3/OMAP4 images...
    https://wiki.ubuntu.com/ARM/OMAP
    1
    Defy development is on fire these days....gonna try this in 10 days when I go home...!!!!!

    Sent from my MB526 using xda app-developers app
    1
    Updated second post with FAQ