[Droid 2 Global General] Naesen:
First off, This is probably in the wrong space, simply because I haven't reached my proper post count. (Too much of a lurker, sorry) but I think I've found something that will make fellow D2 / D2G smile, and I couldn't help but share this.

Here is where I got the idea from:

http://xdaforums.com/showthread.php?t=962974

Unfortunately, the debian-img.zip link is no longer functional (at least it was the last time I checked). No big deal, you can get it from here: Debian-img.zip.

Download that, and make sure you have your Android sdk tools installed. You will need root and busybox. Connect phone to computer, memory card mode, create folder called debian, and unpack the debian-img.zip file into the debian folder on the sdcard. When complete, switch it to charge only mode and now for the fun to begin.

Open the command prompt, navigate to sdk\tools folder, and type adb devices. If you don't see your phone listed as a device (will be a bunch of letters and numbers) switch it to pc mode, run adb devices again.

Once it shows up, type the following:

adb shell

su

mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system

export bin=/system/bin

export img=/sdcard/debian/debian.img

export mnt=/data/local/debian

mkdir /data/local/debian

export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH

export TERM=linux

export HOME=/root

busybox mount -t ext3 -o loop,noatime,nodiratime $img $mnt

busybox mount -t devpts devpts $mnt/dev/pts

busybox mount -t proc proc $mnt/proc

busybox mount -t sysfs sysfs $mnt/sys

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" > $mnt/etc/hosts

busybox mount --bind /sdcard $mnt/sdcard

busybox chroot $mnt /bin/bash

if ps -Al | grep vnc > /dev/null

then

echo "vnc detected"

else

export USER=root

rm -r /tmp

mkdir /tmp

vncserver -geometry 854x480

fi

exit

mount -o remount,ro -t yaffs2 /dev/block/mmcblk1p21 /system

You can't just copy/paste that whole block of code due to the busybox commands. Copy and paste one at a time. I also found that you can't make a script with that code either (please prove me wrong!) and have it work on the droid2 or d2g without errors.

Once you put in the last command, hit ctrl+c, and then open AndroidVNC, using the following data (similar to the debondroid thread):

nickname: debian

Password: password

Address: localhost

Port: 5901

Then connect!

Issues:

I have found that not only can't I use a script, I also cannot use a terminal emulator or even connectbot to put in the commands line by line. I am unsure why, but this only seems to work when I use the adb shell through a computer/usb connection.

You may have issues using USB SDCARD mode after you have run this code. This is fixed by rebooting the phone (as this causes debian to stop being run, and the img is being run off the sdcard, which is mounted with busybox into the system). Otherwise, all other phone functions work perfectly.

A neat little bonus: I found that I am able to access the internet through a browser in debian using nothing more than my 3g data connection.

Feel free to comment! Especially if someone out there can get these commands to work as a script. Enjoy!