| | Stumble It! | Add to Mixx! | | diigo it | | Slashdot |

Wednesday, December 16, 2009

Ubuntu Laptop Tethered to Droid Eris via Proxoid

I finally got it sorted out and I can now connect my lappy (EeePC 701) through my Eris' internet connection (3G or WiFi). Technically it's a proxy and not a tether, but IP by any other name is still teh tubes.

Here's how I got it working:
The Eris
1 - Install "Proxoid" from the Market
2 - Configure the port number - I used 8181
3 - [Optional] Set up your user-agent filter
4 - Start Proxoid
5 - Connect your phone to your laptop via USB
6 - In the alert menu (swipe down from the status bar), tap 'HTC Sync' - you can ignore the fail message

The Lappy
1 - Create the following file
$ sudo gedit /etc/dev/rules.d/11-android.rules
with these two lines:
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0bb4", SYSFS{idProduct}=="0c02", MODE="0666", OWNER="yourusername"
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0bb4", SYSFS{idProduct}=="0c01", MODE="0666", OWNER="yourusername"

2 - Restart udev
$ sudo /etc/init.d/udev restart

3 - Download and extract the Android SDK - http://developer.android.com/sdk/index.html
4 - Install corkscrew
$ sudo apt-get install corkscrew

5 - Create the following script with executable privs: (CAUTION, this will overwrite your ~/.ssh/config)
#!/bin/bash
if [ "$1" == on ]; then
echo "TURN IT ON"
/path/to/android-sdk-linux_86/tools/adb forward tcp:8181 tcp:8181
echo "Host *" > ~/.ssh/config
echo " ProxyCommand corkscrew localhost 8181 %h %p" >> ~/.ssh/config
elif [ "$1" == off ]; then
echo "TURN IT OFF"
/path/to/android-sdk-linux_86/tools/adb kill-server
rm ~/.ssh/config
else
echo "So are you going to turn me 'on' or 'off'?"
fi

6 - Start the tether
$ ./tether.sh on

7 - In Firefox - Preferences > Advanced > Network > Connection Settings > Manual proxy
> HTTP Proxy = localhost
> Port = 8181
> Use this proxy server for all protocols = yes
7.1-I just use the FoxyProxy Basic add-on to manage all this for me
Don't expect to be able to watch Hulu or anything, but you should be able to check your email or connect via SSH with ease =)

Please let me know if any part of this doesn't work for you or if you find a better way to do it.

Cheers!

8 comments:

LoneWolfArcher said...

Which OS are you running on your laptop?

Ben said...

I use Ubuntu 9.04 on my lappy, but the Proxoid website has instructions for Win* as well - http://code.google.com/p/proxoid/

Thistle SC said...
This comment has been removed by the author.
Thistle SC said...

Do you know if this works on 64bit ubuntu? I am having trouble with sdk pack. TKS

Ben said...

Hi Thistle SC,

Check out this link:
http://developer.android.com/sdk/installing.html#troubleshooting

It should have the info you need. Also, don't forget Step #6 on "The Eris" section.

-Ben

Ken said...

Great blog! However the newbie that I am, creating a script with Executable privileges is beyond my scope. Do you have instructions? Thanks!!

Ben said...

Hi Ken,

Sorry for taking so long to respond to your question, the day job has been busier than usual lately.

To make a script executable, you need to run the following command:

ken@kensbox:~$chmod +x [script name]

Then to run it, you'll have to specify the file path to the script. For example:

ken@kensbox:~$/home/ken/[script name]

or

ken@kensbox:~$./[script name]
(the . represents the current directory that you're in while in the terminal)

-Ben

NUNTIUS-REX (DAN GUINN) said...

Thanks Ben, This was very helpful. There are a couple of things that I had a problem with that I thought I would comment on that may help others.

On step 1, I had to install the 11-android.rules file into the /etc/udev/rules.d folder not the /dev folder.

On step 5 my ssh folder on xubuntu 10 was /etc/ssh/sshd_config


Lastly, I wondered if corkscrew is necessary. I found a site that perhaps might have been a part of your research. They however seem to bypass corkscrew. Take a look, I would like to know your thoughts on this.

http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce-Dmitri-s-open-source-blend-of-productive-computing/Tether-an-Android-Phone-Using-Proxoid

Again, thanks for your tutorial! It got me a long way!