Setup USB Tethering on your Android Phone, No Root Access Required

11

Initial Setup and Configuration

Download the current Android SDK (Linux version).
$ wget http://developer.android.com/sdk/download.html?v=android-sdk_r04-linux_86.tgz

Untar the SDK.
$ tar xvf android-sdk_r04-linux_86.tgz

Copy the “adb” application to your Ubuntu /usr/bin directory (sudo privs needed)
$ sudo cp android-sdk-linux_86/tools/adb /usr/bin/adb

Create a rules file called /etc/udev/rules.d/91-android.rules containing the information below. This will allow udev to see your device. Make sure you replace <username> with your username. This example shows the idVendor for the Motrola Droid “22b8”, if you are using a Nexus One change the idVendor to “18D1”, for the HTC Incredible use “0BB4”.
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", SYMLINK+="android_adb", MODE="0666", OWNER="<username>"
For other android devices you can use the lsusb command with your phone connected over USB. The vendor ID is the bold text. This example shows the Motrola Droid.
$ lsusb
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 22b8:41db Motorola PCS
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Change the file permissions.
$ sudo chmod a+r /etc/udev/rules.d/91-android.rules

Restart udev so that it uses the new rules.
$ sudo restart udev

On your phone enable “USB debugging” Settings -> Applications -> Development.

Connect your Droid to the computer with the USB cable and check that it recognizes the device.
$ adb devices

Install OpenVPN on Ubuntu.
$ sudo apt-get install network-manager-openvpn openvpn
$ sudo /etc/init.d/networking restart
$ sudo /etc/init.d/network-manager restart

Install OpenVPN on your Phone. The adb command will install the azilink app on your phone from your computer. Alternatively you can copy the azilink.apk to your phone and install it directly if you have the Settings -> Applications -> Unknown Sources option enabled.
$ wget http://lfx.org/azilink/azilink.apk
$ adb install azilink.apk
$ wget http://azilink.googlecode.com/files/azilink.ovpn

Create a script called android_tether with the following code. This script handles .
adb forward tcp:41927 tcp:41927
sudo mv /etc/resolv.conf /etc/resolve.conf.backup
sudo echo "domain lan" > /etc/resolv.conf
sudo echo "search lan" >> /etc/resolv.conf
sudo echo "nameserver 192.168.56.1" >> /etc/resolv.conf
sudo openvpn --config azilink.ovpn

Set your new script to be executable.
$ chmod 755 android_tether

« IntroductionStart and Stop Tethering Service »

1 2 3
Share.

About Author