Tether Android to Ubuntu / Fedora Linux

(Update 09-08-17 - CLICK HERE for the automatic setup script - Now Just 296KB! sha1sum: f3b79c2e191baf8060367681bae27ac75fab9886 ). Based on reader comments, I've added the functionality for the script to use either yum or apt-get (Fedora or Ubuntu). Includes updated Azilink by Charlie Snider - for Android 2.3.x. READ the install instructions here (e.g., PLUG YOUR DROID INTO THE USB FIRST!)) Let me know how it works for you in the comments.)



So if you're like me you recently picked up the fabulous Verizon Droid Linux-based phone, and now you're one happy camper.

I've been cruising along with my Droid (Android Linux based device) for a month now, and I'm happy as a clam. I have to tell you... The Verizon Droid is quite a fine Linux-based device indeed.

So now that I've used the Droid for awhile, I set out in search of a piece of functionality that I hadn't yet replaced from my Blackberry days. That is: The capability to tether my Droid as an Internet modem to my Ubuntu GNU/Linux 9.10 machine using the USB cable.

On the Blackberry, this was as simple as, a.) provisioning the data service through Verizon(yes, this does cost extra), and then b.) setting up the "Berry4All/BBTether" script (by the extravagant Mr. Thibaut Colar) on my Ubuntu Linux box.

In my search for a solution, the first place I checked for a tethering application was in the Android Market. And while there are many other applications, the only app I was able to find for tethering, required for my phone to be "rooted". And so instead of jumping right into that, I went looking for an easier solution, and voila! - I found it.

What I found are some easy tethering instructions by the masterful Shwan.c (link at ubuntuforums.org) using James Perry's azilink (modified for Android 2.3.x by Charley Snider) from Google Project Hosting, GNU+Linux, and the FOSS program openvpn. So now there was only one problem: I'm using the Verizon Droid, not the HTC Magic. The good news is that the process is generally the same, except for a difference in hardware id information for the udev rules settings in Ubuntu.

So after some minor changes, I've now successfully tethered my Verizon Droid via USB as a modem for my Ubuntu GNU/Linux 9.10 machine(Works with 10.04 too - only difference is that you may have to uncheck "Work Offline" in Firefox after connecting (Thanks to Gene for mentioning this)). Update:06-04-10 - I've tested these instructions and they work successfully with both the Motorola Droid and the HTC Incredible Android phones.

So here are the easy steps to get you up and running with using your Droid as a USB tethered modem (and a big Thanks to Shwan.c for posting the original idea):

1.) Download the current Android SDK (for Linux (i386)) from: http://developer.android.com/sdk/index.html

Update(thanks for comments!): 12-13-10 adb does not come with the new SDK by default so you have to add it via the Android SDK and AVD Manager.
2.) Extract the SDK, run the "Android SDK and AVD Manager", then to get the adb tool, install "Android SDK Platform-tools, revision 1":

tar xvf android-sdk_r07-linux_x86.tgz
cd android-sdk-linux_86
tools/android


In the Android SDK and AVD Manager, expand "Available Packages", put a checkmark by "Android SDK Platform-tools, revision 1", click "Install Selected" and follow the prompts to complete the download/installation of adb into your SDK folder (screenshot below).


3.) Change Directory into the "platform-tools" directory, then copy the "adb" application to your Ubuntu /usr/bin directory (sudo privs needed)
#From the extracted "android-sdk-linux_86" directory:
cd platform-tools
sudo cp adb /usr/bin/adb

4.) Create/edit/save a rules file for udev to allow your machine to see your device
sudo vi /etc/udev/rules.d/91-android.rules

Put the text below into the file(using "i" to enter "insert" mode and hitting the escape key to return to "select" mode before saving.. C'mon, what fun would Linux be without using vi? If you really don't like vi, you can substitute with something like gedit, or nano, or kate, or etc.), replace USERNAME with your Linux username, then type ZZ to save the file from vi.

SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", SYMLINK+="android_adb", MODE="0666", OWNER="USERNAME"
If you have an HTC Android phone - use this rule instead of the one above:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", SYMLINK+="android_adb", MODE="0666", OWNER="USERNAME"
If you have the Samsung Galaxy Android phone, use this rule instead of the one above:
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", SYMLINK+="android_adb", MODE="0666", OWNER="USERNAME"  
If you have the Sony Ericsson X11 Android phone, use this rule instead of the one above (Thanks to Steven from the comments):
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", SYMLINK+="android_adb", MODE="0666", OWNER="USERNAME"If you have the LG Optimus V(Virgin Mobile) Android phone, use this rule instead of the one above: 
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", SYMLINK+="android_adb", MODE="0666", OWNER="USERNAME" 


5.) Set the appropriate permissions to the rules file you just created.
sudo chmod a+r /etc/udev/rules.d/91-android.rules


6.) Restart udev to load the new rule.
sudo restart udev


7.) Enable "USB debugging" on your Verizon Droid via Settings | Applications | Development


8.) Connect your Droid to the computer with the USB cable and then use the following adb command to check for your device.
adb devices


example:
$ adb devices
List of devices attached
040364FA0901E011


9.) Install openvpn on your computer so you can connect to your device with it.
sudo apt-get install openvpn
sudo /etc/init.d/networking restart
sudo /etc/init.d/network-manager restart



*For Fedora and Yum, replace the commands above with this:
sudo yum install openvpn
sudo /etc/init.d/networking restart



Note for those without Internet: If you need to install the openvpn package (and dependencies) separately, these packages are what you will need: (liblzo2-2 libpkcs11-helper1 openssl-blacklist openvpn-blacklist openvpn). It's best to use the package manager to install openvpn because it will automatically install the dependencies, but if you can't get your Ubuntu machine onto to the Internet, then you can download the above packages (in .deb format) to a separate medium (i.e., USB drive, CDR, etc.)separately and then install them in the order listed to achieve the same result as installing from the package manager.


10.) Install openvpn on your Verizon Droid. Note: the line "adb install" actually installs the azilink application on your Droid device. After azilink is installed, an icon that looks like a flying insect will appear on your Droid in th applications area.
cd /home/Downloads/
mkdir azilink
cd azilink
#Manually download the setup script, untar it to get the Azilink-debug.apk - fixed by Charley Snider for Android 2.3.x from


adb install -r Azilink-debug.apk
Download the azilink.ovpn file from here


11.) Create a replacement resolv.conf file to be copied over to your /etc directory at run-time:
vi resolv.conf


#Type in the text below(hit "i" for insert first, then ESC after the insert, before saving) and then hit ZZ to save
domain lan
search lan
nameserver 192.168.56.1


12.) Now create a very small script to start the modem
vi start_modem


#Type in the text below, then hit ZZ to save
adb forward tcp:41927 tcp:41927
sudo cp resolv.conf /etc/
sudo openvpn --config azilink.ovpn


13.) Set your new script to be executable.
chmod 755 start_modem


14.) On your Verizon Droid, launch the azilink app and place a checkmark by "Service active" so it can receive the connection from your Ubuntu machine.


15.) With your wireless connection in Ubuntu "unchecked"(via right-click of the Network manager applet), launch the the connection script you just made in the Terminal:
/home/Downloads/azilink/start_modem


You should now be able to surf the Internet, using your Verizon Droid as a tethered modem. When you're finished - hit ctrl+c at the Terminal from which you started the connection script. Then uncheck "Service active" in Azilink on your Droid.


Here's a Speedtest (courtesy of speakeasy.net/speedtest) of the connection from Seattle, WA:
Download Speed: 1448 kbps (181 KB/sec transfer rate)
Upload Speed: 281 kbps (35.1 KB/sec transfer rate)


If you have any questions, feel free to leave a comment.

(Update 09-08-11 - CLICK HERE for the automatic setup script(select download) - Now Just 296KB! sha1sum: f3b79c2e191baf8060367681bae27ac75fab9886 ). Based on reader comments, I've added the functionality for the script to use either yum or apt-get (Fedora or Ubuntu). Includes updated Azilink by Charlie Snider - for Android 2.3.x. READ the install instructions here (e.g., PLUG YOUR DROID INTO THE USB FIRST!)) Let me know how it works for you in the comments.)
Here's a quick video of the setup script in action:


If you're trying to set this up on CentOS and it's not working, checkout hughesjr's post on droidforums.net


(08-14-2010) For Gentoo GNU/Linux users, checkout "Tether your Motorola Droid on Gentoo Linux (USB Version)" on the Faction Clash blog


For those looking for similar instructions for Mac OSX, checkout the article "Tethering Your Android Phone to OS X via USB" on droidie.com.


Haven't replaced your iphone with the Android yet? Checkout Ashton Mills' article at apcmag.net to tether your iphone to Ubuntu GNU+Linux.


For the windows version of these instructions, see "How To: Tether Windows to the Internet via your Android"


Update: 08-31-10 - Just received the Android 2.2 (froyo) update for my Verizon Droid Incredible. Tethering works perfectly for me after the update.


Friendly Note: All references to Linux are intended to mean GNU/Linux.


Shannon VanWagner
Update 09-08-17

Comments

  1. I have tried this with Fedora 10 and the droid and it seems / looks liked iy works (it says connection established), however I'm not able to connect to anything. Any ideas on what I might need to do ? Is there something I need to do in order to enable the TUN0 device in Fedora ? Any help would be great.
    Thanks,
    Jason

    ReplyDelete
  2. Hello!

    Being a Linux/Droid user myself, I found this post incredibly helpful and very exciting. I carry a netbook with Ubuntu 9.10 and this will come in *very* handy! I did have a question -- will this tethering give you full access (ssh/jabber/web/mail/etc) or is it only for web? I didn't see anything implying it was locked down to port 80/443 traffic, but I've gotten the question from others I'd like to make jealous, so I thought I'd come to the source. Thank you again!

    ReplyDelete
  3. @Brian,

    Very cool. I'll give it a test and let you know.

    ReplyDelete
  4. Thanks a lot. It was awesome and very accurate. Just like the other guy, I'm wondering if you figured it out if it's possible to use other ports as well? If I can make pidgin working, I will stop using comcast.

    ReplyDelete
  5. @Brian & @Mohammed,

    I did some testing...

    I can chat through Gmail, ssh appears to work(prompts for key acceptance and login) - although I don't have a remote shell account handy at the moment to fully test it on, vpn works, and ftp seems to work intermittently (perhaps this is because of the port forwarding from my Ubuntu machine to the droid). Http and https appear to work fine as well.

    To ensure it is a fully working solution for your specific needs, I would suggest that you test it from your end. As far as I can tell, aside from the port forwarding to the droid, this is a regular working Internet connection. Also, this connection(Download Speed: 842 kbps (105.3 KB/sec transfer rate)
    Upload Speed: 484 kbps (60.5 KB/sec transfer rate)) is much faster than my previous blackberry-based Internet connection.

    If you plan on using this as your primary Internet connection, I would suggest that you contact Verizon and make sure there is not a limitation on bandwidth.

    Cheers!
    Shannon VanWagner

    ReplyDelete
  6. First off thanks for the guide. I'm having a little trouble at step 15. when i type /home/john/Downloads/azilink/start_modem into the terminal it says "sudo: openvpn: command not found." I'm not real sure where to go from here. the only place I deviated from the guide was having my Downloads folder in home/john/Downloads. when I ls the azilink directory, start_modem is green. Not sure if that is part of my problem. Any ideas?
    Thanks,
    John

    ReplyDelete
  7. I tried this on my Droid and it worked for me! It was also helpful to read the instructions on Azilink's site as well, http://code.google.com/p/azilink/, and to get the version of azilink and azilink.ovpn directly from them.

    I'd be interested in an update that shows typical connection speeds. Mine:
    lag: 138 ms, σ 53.1 ms
    down: 352.9 Kbps σ 153.6 Kbps
    up: 308.4 Kbps, σ 143.3 Kbps
    n=8, Δt ~= 30m ± 1m

    ReplyDelete
  8. @John,

    If you cat start_modem you should see:

    adb forward tcp:41927 tcp:41927
    sudo cp resolv.conf /etc/
    sudo openvpn --config azilink.ovpn


    Try running the above comments separately, in succession, then you can see which command is failing.

    If you get a "command not found" error when you runt he openvpn command... perhaps it didn't install from step 9. Did you install openvpn while connected to the Internet? The command to install it is:
    sudo apt-get install network-manager-openvpn openvpn

    Let me know.

    Shannon

    ReplyDelete
  9. I am going to test this when I get home. But I am wondering why the pain with cping /etc/resolv.conf and the script?
    Doesnt .ovpn allow for specifying the nameserver? and cant you just plug that into nm-applet?
    I'm at work so I dont have access to my laptop or netbook so I'll have to test these things out.
    If I get it working I will post a cleaner set of instructions.
    Let me know if you figure it out before then.
    -Poningru

    ReplyDelete
  10. I am going to test this when I get home. But I am wondering why the pain with cping /etc/resolv.conf and the script?
    Doesnt .ovpn allow for specifying the nameserver? and cant you just plug that into nm-applet?
    I'm at work so I dont have access to my laptop or netbook so I'll have to test these things out.
    If I get it working I will post a cleaner set of instructions.
    Let me know if you figure it out before then.
    -Poningru

    ReplyDelete
  11. I have found this information very helpful for my Linux box (helped with finding some solutions for other app installs).

    For my Mac OS X laptop I downloaded the PDAnet app via Android Market and installed Tunnelblick under OS X (10.5).

    Worked flawlessly and much less setup typing!

    ReplyDelete
  12. Someone asked about tethering the droid to Windows. I haven't tested this, but apparently one can use PDAnet(for a small fee) to accomplish this.
    Checkout this page for more information:
    http://www.gadgetsdna.com/droid-internet-tethering-for-mac-window/595/

    Alternatively, I'm pretty sure the free-software (GPL) program azilink can accomplish tethering droid to windows but since I'm not using windows on my laptop, I haven't gotten around to setting it up.

    Checkout this link for the azilink project
    http://code.google.com/p/azilink

    My suggestion is that windows users could install Ubuntu GNU/Linux inside windows using wubi. Just pop in the Ubuntu cd(download is legally free from ubuntu.com) while booted into Windows and install Ubuntu, then you'll get the option to enter Ubuntu when you reboot.

    ReplyDelete
  13. I just wanted to confirm that SSH works using this method on my Ubuntu laptop, however, pidgin doesn't, which is not a big deal since I can use web based apps similar to it.

    I got the web browsing and internet plan from verizon which gives me unlimited data transfer.

    ReplyDelete
  14. I found your article very interesting and much needed. However I cannot get out on the internet.
    I followed your directions and here is an output of my window when I start the script.

    My system is an IBM R51 running ubuntu 9.10 and motorola droid
    I call the phone and it rings so that makes me think I am not connected to the device.

    root@cj454lt:/home/cj454/scripts# ./start_vzmodem
    Mon Dec 21 12:15:31 2009 OpenVPN 2.1_rc19 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Oct 13 2009
    Mon Dec 21 12:15:31 2009 WARNING: --ping should normally be used with --ping-restart or --ping-exit
    Mon Dec 21 12:15:31 2009 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Mon Dec 21 12:15:31 2009 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Mon Dec 21 12:15:31 2009 TUN/TAP device tun0 opened
    Mon Dec 21 12:15:31 2009 /sbin/ifconfig tun0 192.168.56.2 pointopoint 192.168.56.1 mtu 1500
    Mon Dec 21 12:15:31 2009 Attempting to establish TCP connection with 127.0.0.1:41927 [nonblock]
    Mon Dec 21 12:15:31 2009 TCP connection established with 127.0.0.1:41927
    Mon Dec 21 12:15:31 2009 TCPv4_CLIENT link local: [undef]
    Mon Dec 21 12:15:31 2009 TCPv4_CLIENT link remote: 127.0.0.1:41927
    Mon Dec 21 12:15:41 2009 Peer Connection Initiated with 127.0.0.1:41927
    Mon Dec 21 12:15:42 2009 Initialization Sequence Completed

    ReplyDelete
  15. I think i figured out my issue. I coped the 91-android.rules to the /usr/bin not /etc/udev..doh...

    You rock..

    J

    ReplyDelete
  16. Sweet, It worked great on the first try. Thanks very much for doing the homework and blogging the results. I have eth0 shared on a wired network using a wireless connection to the internet. When using your setup with azilink other computers on the wired lan have a dns problem. The shared lan connection works great thru the tether if dns info for the shared connection was establish before starting the azilink tether. I am hunting down where to set the dns info for this situation. Thanks again. Murray

    ReplyDelete
  17. Just followed this to enable my Samsung NC10 Ubuntu 9.10 to access the internet via my HTC Magic. To get it to work I had to make a couple of changes:

    - had to set the iDvendor string to "0bb4" in the 91-android.rules file
    - comment out the line "proto tcp-client" from the azilink.ovpn file

    Once I'd made these changes it worked very well :)

    Thanks for the write up, Dave

    ReplyDelete
  18. Will this work on Ubuntu 9.04?

    ReplyDelete
  19. This works as well with CentOS 5 with the following changes.

    1. There is a version of openvpn in the rpmforge repository, it is currently 2.0, so you need to edit AziLink.ovpn and remark out the line:

    #socket-flags TCP_NODELAY

    2. You must set up sudo to work with the user who is going to run the sudo commands, and you must use the NOPASSWD option for sudo ... or run the script as root.

    3. change the openvpn command to /sbin/openvpn as sbin is not in a normal user's path.

    ReplyDelete
  20. Huge thanks. Had to make some adaptations since my computer wasn't connected to the internet - wget's wouldn't work - doh! Actually it was easier to download azilink program on the Droid and install through my file manager. Also, like another commenter I had to comment out the socket-flags line in the .ovpn file. And, finally, I had to do a modprobe tun to get the device created. Works great so far (Slackware 13).

    ReplyDelete
  21. Hello Thanks
    I am having trouble, for one I am using ubuntu 9.04. Is this a problem?

    Azilink on my droid says I am connected to host. However I cannot surf the web. No bytes are sent or received. Interesting though when I reenable my wireless connection and I open up a browser the azilink on my droid shows bytes sending and receiving. when I run start_modem this is what I get.

    Any thoughts? When I run thecommands one by one they seem to be aok.

    Tue Dec 29 00:38:26 2009 OpenVPN 2.1_rc11 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Oct 15 2008
    Tue Dec 29 00:38:26 2009 WARNING: --ping should normally be used with --ping-restart or --ping-exit
    Tue Dec 29 00:38:26 2009 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Tue Dec 29 00:38:26 2009 TUN/TAP device tun0 opened
    Tue Dec 29 00:38:26 2009 /sbin/ifconfig tun0 192.168.56.2 pointopoint 192.168.56.1 mtu 1500
    Tue Dec 29 00:38:26 2009 Attempting to establish TCP connection with 127.0.0.1:41927 [nonblock]
    Tue Dec 29 00:38:26 2009 TCP connection established with 127.0.0.1:41927
    Tue Dec 29 00:38:26 2009 TCPv4_CLIENT link local: [undef]
    Tue Dec 29 00:38:26 2009 TCPv4_CLIENT link remote: 127.0.0.1:41927
    Tue Dec 29 00:38:36 2009 Peer Connection Initiated with 127.0.0.1:41927
    Tue Dec 29 00:38:37 2009 Initialization Sequence Completed

    ReplyDelete
  22. Shannon VanWagner you ROCK!

    Seriously thanks so much for this. I got this working with my moto droid on opensuse 11.1 x64 with some minor changes. I followed the directions here exactly except I installed openvpn/networkmanager-openvpn-kde through the yast packagemanager. Also when I first ran the start_modem scrip I got an error from openvpn:

    Options error: Unrecognized option or missing parameter(s) in azilink.ovpn:8: socket-flags (2.0.9)

    So I just commented out this "socket-flags" line in the azilink.ovpn file and now it works.

    vi is fun and LINUX RULES!

    Thanks!!!

    EJ

    ReplyDelete
  23. Super! Issues I had, with no active internet, using Linux Mint & (Gloria) and my Droid.

    I installed openvpn from the repositories, which added a couple of required files.

    Forgot to download the azilink files before I went off-line and home. So I used the Droid in USB connected mode, pulled in both referenced files from their site, and for whatever reason, the ovpn extension saved as a txt file extension. SO I merely renamed it with root permission and it worked fine.
    Because I loaded my files into
    home/USERNAME/Downloads/azilink I have to cd there in the terminal to get the resolv.conf file to work correctly and allow the program to run.
    Everything else was exactly as you stated, thanks for the excellent article, complete with enough explanation to enable others to duplicate your efforts.
    And I called Verizon, just to confirm, no extra charges apply. I'll be sparse on usage until I get my next bill, just in case.

    A great solution, thanks!

    ezsurfer

    ReplyDelete
  24. Despite 4 years of using GNU/Linux, I'm still a "beginner" user (been too busy to become more than a "user")-- I just followed this guide mostly cut/paste plus a few modifications and had no problems. I'm posting this comment through my Droid's 3G connection. Thank you for this guide!

    ReplyDelete
  25. An update to my comment, pleasantly suprised, while surfing, my Droid rings!

    So I answer it, while I am on the web tethered.

    So, purchase a tether long enough to make this easy!

    Clif

    ReplyDelete
  26. Have you tried to tether the Droid to Ubuntu via bluetooth? Sometimes I'm just too lazy to grab my USB cable. I've been trying to do this for a couple of days now but with no success. I've been trying with PdaNet on my Droid. I launch PdaNet, bind the BT DUN channel to /dev/rfcomm0, and then use wvdial for the dial up connection, but haven't had success yet. If you're bored maybe you can give it a try? I bet it'd be easy for someone who's already figured out USB tethering.

    ReplyDelete
  27. Great tutorial. I'm posting with my phone(well, ok, wifi through my phone)'s connection right now.

    Bravo to you sir, I don't know how much more comprehensive you could make this tutorial, though I'm a Linux nerd myself (so it's hard to know).

    One small suggestion though. For me it was:

    /etc/init.d/network-manager restart

    (instead of NetworkManager)

    Awesome, though, I will use this often, :D

    ReplyDelete
  28. @Dan Beam,

    yes, nice job.. thank you Sir for finding the mistake.. I've since changed it in the posting.

    Cheers!

    ReplyDelete
  29. I also noticed you're writing over the /etc/resolv.conf from within the start_modem script. I use resolvconf so I can use different DNS configurations on different interfaces. When you do this, the top line of /etc/resolv.conf says:

    # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

    So I listened, and modified your start_modem script to do this:

    adb forward tcp:41927 tcp:41927
    resolvconf -a tun < resolv.conf
    openvpn --config azilink.ovpn

    (start_modem, resolv.conf, and azilink.ovpn must be in the current directory, or you must add an absolute path to the files to execute this script from anywhere, btw...)

    So this pulls in the settings for only that network. Now usually you won't be using two concurrent networks at the same time (especially when one's your phone), but you never know what somebody's got in their /etc/resolv.conf file that you may not wanna overwrite...

    ReplyDelete
  30. Exactly what I was looking for; works perfectly. Thanks!

    ReplyDelete
  31. Excellent post. It worked perfectly, and props to Hak5 for pointing me your way! They suggested another script which was built off of your post, but this worked quite well, and, in my opinion, if you arent willing to open a terminal, then why use linux?

    Thanks!!

    ReplyDelete
  32. Awesome!!! It works great! Thanks for posting this. It is amazing how easy your step-by-step procedure made this seem.

    ReplyDelete
  33. Here's Hak5's article:
    http://digg.com/d31FPoE
    and bigmack83 over at alldroid.org made a script:
    http://alldroid.org/viewtopic.php?f=236&t=763

    ReplyDelete
  34. Great work, I've been trying this with no internet connection, having downloaded the external packages elsewhere. I couldn't get it. So I took my very old laptop to work. Turns out this does NOT work with 8.04. So contrary to my beleif, I was able to install 9.1 and it works perfectly.

    I don't know much about linux yet, but I couldn't restart network-manager because it wasn't there. Probably the old ubuntu used a different named program for network management. Also I was getting bash errors, I don't know if 9 still runs bash.

    So don't try this on 8.04 unless you can get around some differences on your own, I couldn't. But I also don't know how to install a package already downloaded. Its apt-get install all the way, but not without internetz. I'm trying.

    ReplyDelete
  35. OMG... It works awesomely. I had some confusion with how to install the azilink app on my droid form the terminal, so i went to the dev website from my droid browser and installed it from there. http://lfz.org/azilink/azilink.apk

    no big deal. it worked quite well afterwards. It will not work, however, while your droid is connected to a wireless network (802.11g). Once I realized that it was still connected and shut it off, I was browsing the net in no time. Thanks so much for this awesome guide!! it makes moving from the BB to the Droid soooo much easier. (btw... bbtether always crashed on me and didn't recover itself. With this app, it will restart itself to keep you always connected).

    ReplyDelete
  36. Thanks a lot! It works great!

    A small hint for those who are stuck with no OpenVPN and no net connection on their laptops: tutorial [1][2] allows you to connect through HTTP with no special software (except for Android SDK) which you can use to download OpenVPN with Synaptic (just remember to configure proxy in Synaptic).

    [1] http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce-Dmitri-s-open-source-blend-of-productive-computing/Tether-an-Android-Phone-Using-Proxoid
    [2] http://androidforums.com/how-tips/17470-droid-tethering-all-operating-systems-tested-linux.html

    ReplyDelete
  37. Works great on opensuse 11.2 too. There is only one little thing that annoys me: When i want to use my computer's wifi again, i need to delete the resolv.conf manually, because otherwise dns doesn't work.
    AM i getting something wrong here or is that just normal?

    Thanks for your help and greetings from Germany

    Phillip

    ReplyDelete
  38. I believe I followed the directions correctly, but my Droid doesn't seem to make the connection. Any ideas?
    Thanks

    ReplyDelete
  39. @Phillip, in Ubuntu, the resolv.conf is updated by the NetworkManager when the DHCP connection is made. I would think this would be the same for opensuse but I'd have to do some testing on it to see.

    Also, before connecting with my Droid, I right-click NetworkManager and "uncheck" Enable Wireless. Then after I'm done using the Droid for the connection, I shutdown the connection script, and then I go and "enable" the wireless from the NetworkManager... then my resolv.conf gets fixed when the wireless reconnects. When you switch off of using the Droid, how do you reconnect to the network?

    ReplyDelete
  40. @garmstrong65, when you run the adb devices command (shown in step 8), do you see your Droid as being connected?

    Also, have you tried running each of the commands in step 12 separately, to see if an error is output?

    ReplyDelete
  41. OK, so I probably should have been more deliberate before I posted. I changed my 'Download' folder to the 'Home' folder rather than the 'Home/username' folder. Also, I changed the name of the start_modem to exactly match your example.

    So...it works now. In fact, I'm using the connection to send this updated post (sorry, I tried to post it under your reply, but I didn't see how to do that).

    Thanks for posting your instructions! This will come in quite handy at times.

    ReplyDelete
  42. Well, I disabled wireless connection before using the tethering. When i returned to wifi, I terminated the command and enabled wireless. But the resolv.conf was still there and dns wasn't working. Everything worked fine again after deleting it.

    ReplyDelete
  43. hi , fine tutorial - went through all the steps - but it failed.
    I have a G2 (htc - hero) and am in the uk.
    thought it should still work though.
    here's what i get ..

    Sun Jan 24 20:56:06 2010 OpenVPN 2.1_rc19 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Oct 13 2009
    Sun Jan 24 20:56:06 2010 WARNING: --ping should normally be used with --ping-restart or --ping-exit
    Sun Jan 24 20:56:06 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Sun Jan 24 20:56:06 2010 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Sun Jan 24 20:56:06 2010 TUN/TAP device tun0 opened
    Sun Jan 24 20:56:06 2010 /sbin/ifconfig tun0 192.168.56.2 pointopoint 192.168.56.1 mtu 1500
    Sun Jan 24 20:56:06 2010 Attempting to establish TCP connection with 127.0.0.1:41927 [nonblock]
    Sun Jan 24 20:56:06 2010 TCP connection established with 127.0.0.1:41927
    Sun Jan 24 20:56:06 2010 TCPv4_CLIENT link local: [undef]
    Sun Jan 24 20:56:06 2010 TCPv4_CLIENT link remote: 127.0.0.1:41927
    Sun Jan 24 20:56:06 2010 Connection reset, restarting [-1]
    Sun Jan 24 20:56:06 2010 /sbin/ifconfig tun0 0.0.0.0
    Sun Jan 24 20:56:06 2010 SIGUSR1[soft,connection-reset] received, process restarting
    Sun Jan 24 20:56:11 2010 WARNING: --ping should normally be used with --ping-restart or --ping-exit
    Sun Jan 24 20:56:11 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Sun Jan 24 20:56:11 2010 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Sun Jan 24 20:56:11 2010 TUN/TAP device tun0 opened

    - any help would be much apprec - have spent an ages trying to get this to work.
    One day !

    ReplyDelete
  44. Thank you! Your expert tutorial here allowed me to post this! I can not thank you enough for this.

    ReplyDelete
  45. Excellent tutorial!

    I'm running 9.10 x64 and this worked when everything else has failed, you are an asset to the ubuntu community. Good job!!

    ReplyDelete
  46. I am using a Motorola Droid here in the States and I'm getting the same restarting error as the anonymous post 2 posts above mine. How can I fix this?

    ReplyDelete
  47. @Anonymous - "hi , fine tutorial - went through all the steps - but it failed. I have a G2 (htc - hero) and am in the uk."

    Did you change the /etc/udev/rules.d/91-android.rules file (step 4.) to:

    SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", SYMLINK+="android_adb", MODE="0666", OWNER="your-username"

    Notice the idVendor is different for the Hero than it is for the Droid... you can obtain the idVendor with the lsusb command, while your phone is plugged into the USB.

    Also, what did you get for the output of step 8?

    ReplyDelete
  48. @castironpants - I don't see what comment you are referring to... can you specify?

    ReplyDelete
  49. I'm happy to report that this guide worked for me flawlessly in Fedora 12.

    Great job!

    ReplyDelete
  50. Just did this with Mint 8, and it worked like a charm! Thanks for the walkthrough. I'm also more than a little psyched because I wrote my first shell script for this which allows me to automatically execute the start-modem from my desktop. I know it's child's play to everyone else, but I've only been using Linux for about 4 days, so . . . yeah!

    Rob

    ReplyDelete
  51. Shannon, have you hit the 5gb cap yet? My contract with Verizon is about to expire and I am not sure if I should bother with the Droid and Verizon's fake "unlimited data plan".

    ReplyDelete
  52. Shannon,

    Thanks so much for this thread.

    I'm having a problem. When I execute start_modem I get the following output:

    /home/vaughn/Downloads/azilink/start_modem: 1: db: not found
    Sat Feb 6 14:26:39 2010 OpenVPN 2.1_rc19 x86_64-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Oct 13 2009
    Sat Feb 6 14:26:39 2010 WARNING: --ping should normally be used with --ping-restart or --ping-exit
    Sat Feb 6 14:26:39 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Sat Feb 6 14:26:39 2010 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Sat Feb 6 14:26:39 2010 TUN/TAP device tun0 opened
    Sat Feb 6 14:26:39 2010 /sbin/ifconfig tun0 192.168.56.2 pointopoint 192.168.56.1 mtu 1500
    Sat Feb 6 14:26:39 2010 Attempting to establish TCP connection with 127.0.0.1:41927 [nonblock]
    Sat Feb 6 14:26:39 2010 TCP connection established with 127.0.0.1:41927
    Sat Feb 6 14:26:39 2010 TCPv4_CLIENT link local: [undef]
    Sat Feb 6 14:26:39 2010 TCPv4_CLIENT link remote: 127.0.0.1:41927
    Sat Feb 6 14:26:39 2010 Peer Connection Initiated with 127.0.0.1:41927
    Sat Feb 6 14:26:40 2010 Connection reset, restarting [0]
    Sat Feb 6 14:26:40 2010 /sbin/ifconfig tun0 0.0.0.0
    Sat Feb 6 14:26:40 2010 SIGUSR1[soft,connection-reset] received, process restarting

    I'm running Ubuntu 9.10 and my phone is a Motorola Droid.

    Any ideas?

    ReplyDelete
  53. Shannon,

    Thanks very much for this how0to.

    I'm hitting a snag. Upon executing start_modem, I get the following output which repeats itself until I kill it:

    /home/vaughn/Downloads/azilink/start_modem: 1: db: not found
    Sat Feb 6 14:26:39 2010 OpenVPN 2.1_rc19 x86_64-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Oct 13 2009
    Sat Feb 6 14:26:39 2010 WARNING: --ping should normally be used with --ping-restart or --ping-exit
    Sat Feb 6 14:26:39 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Sat Feb 6 14:26:39 2010 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Sat Feb 6 14:26:39 2010 TUN/TAP device tun0 opened
    Sat Feb 6 14:26:39 2010 /sbin/ifconfig tun0 192.168.56.2 pointopoint 192.168.56.1 mtu 1500
    Sat Feb 6 14:26:39 2010 Attempting to establish TCP connection with 127.0.0.1:41927 [nonblock]
    Sat Feb 6 14:26:39 2010 TCP connection established with 127.0.0.1:41927
    Sat Feb 6 14:26:39 2010 TCPv4_CLIENT link local: [undef]
    Sat Feb 6 14:26:39 2010 TCPv4_CLIENT link remote: 127.0.0.1:41927
    Sat Feb 6 14:26:39 2010 Peer Connection Initiated with 127.0.0.1:41927
    Sat Feb 6 14:26:40 2010 Connection reset, restarting [0]
    Sat Feb 6 14:26:40 2010 /sbin/ifconfig tun0 0.0.0.0
    Sat Feb 6 14:26:40 2010 SIGUSR1[soft,connection-reset] received, process restarting
    Sat Feb 6 14:26:45 2010 WARNING: --ping should normally be used with --ping-restart or --ping-exit
    Sat Feb 6 14:26:45 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Sat Feb 6 14:26:45 2010 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Sat Feb 6 14:26:45 2010 TUN/TAP device tun0 opened
    Sat Feb 6 14:26:45 2010 /sbin/ifconfig tun0 192.168.56.2 pointopoint 192.168.56.1 mtu 1500
    Sat Feb 6 14:26:45 2010 Attempting to establish TCP connection with 127.0.0.1:41927 [nonblock]
    Sat Feb 6 14:26:45 2010 TCP connection established with 127.0.0.1:41927
    Sat Feb 6 14:26:45 2010 TCPv4_CLIENT link local: [undef]
    Sat Feb 6 14:26:45 2010 TCPv4_CLIENT link remote: 127.0.0.1:41927
    Sat Feb 6 14:26:46 2010 Peer Connection Initiated with 127.0.0.1:41927
    Sat Feb 6 14:26:46 2010 Initialization Sequence Completed
    Sat Feb 6 14:26:48 2010 Connection reset, restarting [0]
    Sat Feb 6 14:26:48 2010 /sbin/ifconfig tun0 0.0.0.0
    Sat Feb 6 14:26:48 2010 SIGUSR1[soft,connection-reset] received, process restarting

    I'm running 9.10 on a 64-bit System76 Pangolin laptop. My phone is a brand-new Motorola Droid.

    Any ideas?

    ReplyDelete
  54. Huge thanks for this post. This will be very useful when I'm on the road.

    I've noticed that I'm somewhat limited in the network services I can use through the tether. Web browsing works great. Connecting to a subversion server works, too. However, pidgin and dropbox don't work. Does anyone know why this is? Any way to make these work?

    ReplyDelete
  55. Just got the droid and a major reason was supposely the tethering is free. Well, I followed your script to the letter and it worked. I was up and going in 15 minutes!! I'm using Ubuntu 8.04 and it worked flawlessly. I tested browsing, telnet and ssh. All worked with not problems. I did have a problem creating a VPN tunnel (IPsec) to a firewall. I tried several firewalls and none worked. Has anyone gotten VPN to work thru the Droid?

    ReplyDelete
  56. Shannon, thank you for posting this. Your guide was easy to follow, easy to read, and most important of all---it works!

    Got tethering working on the first go without any hitches. Thank you sir!

    ReplyDelete
  57. Perfect! Just what I needed.

    ReplyDelete
  58. I can't seem to get my computer to realize that the connection is there. My laptop says that the connection is established. My droid says that it is established, and when I ping Yahoo I see both the Bytes sent and Bytes received go up on my phone, but nothing is returned to my laptop.

    Do I need to configure the network settings in Ubuntu somehow?

    ReplyDelete
  59. @drb116, try right-clicking your NetworkManager icon and then uncheck "Enable Wireless" prior to running the script to connect to your droid.

    ReplyDelete
  60. Thank you so much for the detailed instructions. I'm happily posting this via 3G over my Droid! The only part that was confusing for me was installing AziLink. I didn't realize that "adb install azilink" actually installed it to the phone. I was looking for it in the marketplace, and even retrying the wget steps via Terminal Emulator on the phone to try and get it. Then I looked in my applications and realized it was already there.

    ReplyDelete
  61. Found your post by accident. It helped me tethering my Milestone within a few minutes.
    thx a lot!

    ReplyDelete
  62. @Thomas, can you describe the steps that you used to "accidentally find" this post? I've been really trying to get the word out and I could use any tips.

    Thanks and congrats on your Freedom!
    Shannon V.

    ReplyDelete
  63. This works very well with my System 76 Pangolin panp4n laptop running Ubuntu 10.04 64-bit. I never did get it working with Karmic, but I'm posting this note from Lucid via my Droid. Whee!

    Thanks Shannon!

    ReplyDelete
  64. Your guide was a great help. I ran into a couple snags, but after googling a bit, I figured out that my Fedora 12 x86_64 installation doesn't work out-of-the-box with the Android SDK tools. I had install the following to allow it to work (you might make a mention of it in your instructions in case someone else runs into the same)

    Error 1:
    $ ./adb
    bash: ./adb: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

    Fix:
    $ sudo yum install glibc.i686 libxml2.i686 libSM.i686 gtk2.i686

    Error 2:
    $ ./adb
    ./adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

    Fix:
    $ sudo yum install ncurses-libs.i686

    ReplyDelete
  65. I'm on a EEE-PC running Karmic and a new droid. Everything seems to work, and the connection seems to be established, at least according to the output from start_modem, but no bytes are exchanged in either direction.

    ReplyDelete
  66. @Anonymous(EEE-PC) - could you post the output from the terminal when you run the script? Also, try to ping 4.2.2.1 and let me know if it works or not. Also, double-check to ensure azilink is "service enabled" on your droid.

    ReplyDelete
  67. Thanks for this guide. Web browsing works perfectly, but chat clients and Slingplayer do not (but they do work using PdaNet in Windows). Any ideas as to why that is? Thanks in advance.

    ReplyDelete
  68. @Gene, it's probably either Verizon filtering the ports for slingbox or something to do with the routing of traffic through your droid. What is the chat service you're having a problem with?

    ReplyDelete
  69. @Shannon

    As for Slingplayer, it turns out that I didn't have a network adapter in VirtualBox set to bridge mode (even though I wasn't actually using an adapter by tethering the Droid), so after fixing that, it worked.

    I use Empathy in Ubuntu to connect to AIM; I'll do some more experimenting.

    ReplyDelete
  70. Hi Shonnon,

    Trying to tether motorola bacflip to dell inspinron 2650 running xubuntu 9.10. Got most of the way thru but seems to have an issue when I go to config azilink.ovpn here is the output. I am newbi when it come to running terminal can't get my head around it.
    -----------------------------------
    glynnjr@glynnjr-laptop:~/Downloads/azilink$ sudo thunar
    [sudo] password for glynnjr:
    glynnjr@glynnjr-laptop:~/Downloads/azilink$ sudo openvpn --config

    azilink.ovpn

    Sat Apr 3 10:39:10 2010 OpenVPN 2.1_rc19 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Oct 13 2009

    Sat Apr 3 10:39:10 2010 WARNING: --ping should normally be used with --ping-restart or --ping-exit

    Sat Apr 3 10:39:10 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables

    Sat Apr 3 10:39:10 2010 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext

    Sat Apr 3 10:39:10 2010 TUN/TAP device tun1 opened

    Sat Apr 3 10:39:10 2010 /sbin/ifconfig tun1 192.168.56.2 pointopoint 192.168.56.1 mtu 1500

    SIOCADDRT: File exists

    Sat Apr 3 10:39:10 2010 ERROR: Linux route add command failed: external program exited with error status: 7

    SIOCADDRT: File exists

    Sat Apr 3 10:39:10 2010 ERROR: Linux route add command failed: external program exited with error status: 7

    Sat Apr 3 10:39:10 2010 Attempting to establish TCP connection with 127.0.0.1:41927 [nonblock]

    Sat Apr 3 10:39:10 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused

    Sat Apr 3 10:39:15 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Sat Apr 3 10:39:20 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Sat Apr 3 10:39:25 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Sat Apr 3 10:39:30 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Sat Apr 3 10:39:35 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Sat Apr 3 10:39:40 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Sat Apr 3 10:39:45 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Sat Apr 3 10:39:50 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Sat Apr 3 10:39:55 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Sat Apr 3 10:40:00 2010 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused

    So looking for help I don't know where to go from here..
    Thanks Jeff

    ReplyDelete
  71. @Jeff, can you please provide the output from the command 'lsusb | grep Motorola' (no quotes), while your phone is connected with the usb cable?
    Also, which version of Xubuntu are you using?
    Looking at your output, it seems the device is not receiving the connection to azilink via openvpn. Is azilink installed on your phone and have you enabled it?

    ReplyDelete
  72. Shannon,
    I have tried to run
    sudo openvpn --config azilink.ovpn
    in terminal /downloads/azilink all the ways I can think with phone tethered and azilink enabledand still end up with the same output. here is the data you asked for. There is one thing I have had to do different I have had to download the needed package from my other windows computer using Pdanet and my phone then transfer them to my laptop.

    -----------------------------------

    lsusb | grep Motorola
    Bus 001 Device 005: ID 22b8:2d66 Motorola PCS

    cat /etc/issue
    Ubuntu 9.10 \n \l
    cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=9.10
    DISTRIB_CODENAME=karmic
    DISTRIB_DESCRIPTION="Ubuntu 9.10"
    uname -a
    Linux glynnjr-laptop 2.6.31-19-generic
    #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010 i686
    GNU/Linux
    uname -r
    2.6.31-19-generic
    uname -v
    #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010
    uname -o
    GNU/Linux
    Xfce 4 Desktop Environment
    version 4.6.1 (Xfce 4.6)

    Like I said before I am lost at this point so I hope this helps you help me.
    thanks for the great work Jeff

    ReplyDelete
  73. @Jeffrey, from what I see.. the error you're receiving 'SIOCADDRT: File exists' means that some network configurations are being duplicated. Also I notice that your connection sets up the connection as tun1 instead of tun0(mine shows tun0). What shows for tun0 if you run the command ifconfig? Also do you have another connection setup that could be conflicting with your attempts to connect with the Droid?

    Does your azilink.openvn show the same as mine?
    ----------------------------
    $ cat azilink.ovpn
    dev tun

    remote 127.0.0.1 41927 tcp-client
    proto tcp-client
    ifconfig 192.168.56.2 192.168.56.1
    route 0.0.0.0 128.0.0.0
    route 128.0.0.0 128.0.0.0
    socket-flags TCP_NODELAY
    #keepalive 10 30
    ping 10
    dhcp-option DNS 192.168.56.1
    ----------------------------

    ReplyDelete
  74. without usb tether
    glynnjr@glynnjr-laptop:~$ ifconfig
    eth0
    Link encap:Ethernet HWaddr 00:08:74:e6:01:ef
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    Interrupt:10 Base address:0xe000

    lo
    Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:112 errors:0 dropped:0 overruns:0 frame:0
    TX packets:112 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:9532 (9.5 KB) TX bytes:9532 (9.5 KB)

    wlan3
    Link encap:Ethernet HWaddr 00:07:40:bc:e6:ff
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    wmaster0
    Link encap:UNSPEC HWaddr 00-07-40-BC-E6-FF-00-00-00-00-00-00-00-00-00-00
    UP RUNNING MTU:0 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    with usb tether and azilink turned on.
    glynnjr@glynnjr-laptop:~$ ifconfig
    eth0
    Link encap:Ethernet HWaddr 00:08:74:e6:01:ef
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    Interrupt:10 Base address:0xe000
    lo
    Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:176 errors:0 dropped:0 overruns:0 frame:0
    TX packets:176 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:12732 (12.7 KB) TX bytes:12732 (12.7 KB)
    tun0
    Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    inet addr:192.168.56.2 P-t-P:192.168.56.1 Mask:255.255.255.255
    UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:100
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    tun1
    Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    inet addr:192.168.56.2 P-t-P:192.168.56.1 Mask:255.255.255.255
    UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:100
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    wlan3
    Link encap:Ethernet HWaddr 00:07:40:bc:e6:ff
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    wmaster0
    Link encap:UNSPEC HWaddr 00-07-40-BC-E6-FF-00-00-00-00-00-00-00-00-00-00
    UP RUNNING MTU:0 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    ReplyDelete
  75. Shannon,
    It seems that the issue with the tun1 accurs when I plug my phone to the usb cable. Why? unknown I unistalled Pdanet and rooted phone thinking it may have caused the issue. No luck same ifconfig output. I could not included the output. I have sent in next post. The output are without and with phone tethered. Maybe you can find something.
    I did find the line proto tcp-client missing from azilink.ovpn it had no effect still getting the same output I sent you earlier.
    Thanks
    Jeff

    ReplyDelete
  76. @Jeffrey - The tun interface is being duplicated, which is causing the problem. Did you make a script to set this all up, or are you running the commands separately? Is it possible that the 'sudo openvpn --config azilink.ovpn' is being run twice?

    If possible, perhaps you could try this from a fresh boot to the LiveCD? Also, you could try resetting your Droid to factory default - although I can't figure how that would help.

    The method I describe for setting this up, assumes a plain-install of Ubuntu 9.10 or 10.04, and simply having azilink installed on the Droid.

    ReplyDelete
  77. Shannon,
    Well not sure what I did but remove everything and reinstall from the start. And I am posting from my laptop. Linked you at backflip forum thanks for all the help. Not able to run start_modem but entered all three line one after another and it started running.
    Thanks so much
    Jeff
    AKA
    Professor IllDog

    ReplyDelete
  78. Absolutely brilliant. Works beautifully on 9.10. Will try on the April beta sometime in the near future.

    Any interest in turning this into a .deb? Most of the steps are easily automated. I'll assist if you're up for it.

    ReplyDelete
  79. Amazing! Great stuff...thanks Shannon!

    ReplyDelete
  80. Thanks!!! This worked with my at&t moto backflip as well.

    ReplyDelete
  81. @Boom, making it a .deb would be awesome. I've been thinking about doing this, but I don't have a lot of experience with doing that yet. If you want to create one, that'd be great! Maybe we could host it on sourceforge or something.

    Cheers!
    Shannon

    ReplyDelete
  82. Shannon: This works just GREAT with my Canadian Motorola Milestone (Droid in the States).

    I'm using Kubuntu 8.04, and the tutorial was easy to follow.

    Only issue I had was that the USB connection on the Milestone had to be set to "None" for any of this to work. Otherwise the camera, or the SD card mount instead, and USB debugging does not work.

    USB debugging has to remain on while using the Milestone to connect to the Internet. Turning USB debugging off breaks the connection.

    Turning off wireless with the hardware switch on my Dell Vostro also disables the wireless adapter in the laptop, and has no effect on this USB Internet connection.

    Wonderful work!!

    Frank.

    ReplyDelete
  83. Shannon:

    You say you are trying to get the word out. Great. Proxoid is in the Android Market. AziLink is not. Perhaps that is an avenue to be explored?

    Frank.

    ReplyDelete
  84. WOW... Im a Tmobile user with a G1... this process worked PERFECTLY...

    Thanks for the post ... very helpful

    ReplyDelete
  85. Right on! Perfect instructions.

    I did run into a snag where I had Cisco Anyconnect running prior to firing up ovpn and that threw things off. A reboot cleared it up.

    Now running anyconnect post ovpn works. There doesn't seem to be a limit on what I can use. I can SSH, Telnet, VPN, HTTP, HTTPS, haven't gone beyond those.

    Thanks for the post.

    ReplyDelete
  86. Worked like a charm for me: Nexus One to Ubuntu 9.10 on Taiwan Mobile. Thanks a lot!

    ReplyDelete
  87. Doesn't seem adb works on Lucid, not sure why.. I can't update my mom's laptop until that gets resolved :P

    ReplyDelete
  88. @Ethan Anderson - I've been using Ubuntu 10.04 Lucid for a least a month and I use this Droid connection everyday.

    There must be some other issue, can you explain what happens when you run your script? Also, what happens when you run the 'adb version' command?

    Here's my output (I'm on Lucid):
    svanwagner@ubuntu-scythe:~$ adb version
    Android Debug Bridge version 1.0.25
    svanwagner@ubuntu-scythe:~$ uname -r
    2.6.32-21-generic-pae

    ReplyDelete
  89. svanwagner@ubuntu-scythe:~$ ubuntu-support-status
    Support status summary of 'ubuntu-scythe':

    You have 850 packages (52.9%) supported until April 2013 (3y)
    You have 55 packages (3.4%) supported until October 2011 (18m)
    You have 572 packages (35.6%) supported until April 2015 (5y)

    ReplyDelete
  90. Sorry, false alarm, it does in fact work. I've been doing something wrong for months, this time I forgot to plug it in.

    I think where you run adb from may actually make a difference.

    ReplyDelete
  91. I just upgraded to Ubuntu 10.04 LTS. At first, I thought this wasn't working, as Firefox started in offline mode every time I opened it while tethered. I finally unchecked "Work Offline" and realized that it was indeed working. I had to do that every time I launched Firefox while tethered... until I found the fix for that (issue with Network-Manager):

    Go to about:config

    Change toolkit.networkmanager.disable to "enable"

    ReplyDelete
  92. Correction... "toolkit.networkmanager.disable" changed to "true."

    ReplyDelete
  93. I just did this on a Gateway M675 laptop running Fedora 12 using Motorola DROID 2.1.

    Worked like a champ!

    Thank you so much!!

    ReplyDelete
  94. Here's Python script that I wrote that starts the process and sends it to the background. When you're done, you pass the 'stop' command and things are reversed! :)

    Download DROID Tether Script

    This script replaces the "start_modem" script inside of the "azilink/" folder that this article originally mentions.

    It also takes the existing resolv.conf file, moves it (for backup) and copies the resolv.conf file needed for this script. When you pass the 'stop' argument, it reverses the changes of the resolv.conf file that were made.

    View the script to make the needed changes, such as "username."

    Hope it serves others well. :)

    ReplyDelete
  95. Or you could just root it and install Barnacle. Much simpler.

    ReplyDelete
  96. The whole point of the article was to provide users who didn't want to root their DROID a process to still be able to tether.

    ReplyDelete
  97. Ubuntu 10.04 LTS here, easy instructions, and works good. A little slower then PDANet on Windows though.

    ReplyDelete
  98. @anon-PDANet on Windows- What is the speed rating you get from speakeasy.net/speedtest ?

    I'll run another test and post what I'm getting.

    ReplyDelete
  99. Thanks for the new 5-12-10 script! It worked perfectly! The only thing I had to do when I was done was restart, otherwise, instructions were perfect.

    Maybe put in bold/caps (or put as separate step 1) - Connect Droid to computer. I missed this step and had to go back.

    Otherwise, PERFECT! Thank you so much!

    Ubuntu Lucid Lynx 10.04
    Toshiba Satellite 2805-5202
    Pentium III-700/550 CPU, 584MB

    ReplyDelete
  100. Thanks for the new 5-12-10 script! It worked perfectly! The only thing I had to do when I was done was restart, otherwise, instructions were perfect.

    Maybe put in bold/caps (or put as separate step 1) - Connect Droid to computer. I missed this step and had to go back.

    Otherwise, PERFECT! Thank you so much!

    Ubuntu Lucid Lynx 10.04
    Toshiba Satellite 2805-5202
    Pentium III-700/550 CPU, 584MB

    ReplyDelete
  101. Great writeup, this also works in Fedora.

    ReplyDelete
  102. Nice work, thanks alot; however, you may want to substitute the newer azilink version 2.0.2 for the older one that is in your tarball. The problem is your script generically looks for azilink.apk and this version is called azilink-2.0.2.apk.

    PS: The one at http://code.google.com/p/azilink/downloads/list

    Good work!

    Thanks

    ReplyDelete
  103. @Anon - "you may want to substitute the newer azilink version 2.0.2"

    Nice catch.. I've updated the instructions as well as the script to install the newer azilink. When using the adb -r option, the installed application will be updated on the phone.

    Thanks!

    ReplyDelete
  104. @Anon - "you may want to substitute the newer azilink version 2.0.2"

    Nice catch.. I've updated the instructions as well as the script to install the newer azilink. When using the adb -r option, the installed application will be updated on the phone.

    Thanks!

    ReplyDelete
  105. Shannon-

    Unbelievable. I just ran the script, following the readme, of course... and it worked. Perfectly. It JUST WORKED.

    Verizon Motorola Droid with Android 2.1, 64-bit Ubuntu 10.04.

    I'm just speechless. Thank you!!!

    ReplyDelete
  106. Shannon.

    Very nice. Rather than your script, I followed your command line instructions without a hitch and am posting this using my Incredible as modem to Ubuntu 9.10 on a ThinkPad T41. I did find the Incredible device ID of 0bb4 on the ubuntuforums. Thanks. A nice tool for the kit!

    ReplyDelete
  107. nnon. everything works great. Since someone asked .. I talked to Verizon CS yesterday about the TV out... he told me (???) that the phone plan for the droid and incredible were really unlimited. My plan is to watch some shows with the app. TV.com and send them to the tv...This will really test the unlimited comment LOL!! I'll let you know what happens. One question, when I disconnect, I always have to reboot to use it again..even when I ctrl+C...what am I doing wrong ??

    ReplyDelete
  108. @Mrklean59 - the problem is that the openvpn and/or adb processes are still running (ps -A | grep openvpn or ps -A grep adb). If you issue the command: sudo killall adb openvpn prior to retrying your connection.. that should fix the problem. If you download/install the latest script I put up, it should modify the script that runs with the desktop item I made.

    Cheers!

    ReplyDelete
  109. Shannon.....thank you kind sir ; )

    ReplyDelete
  110. This script works flawlessly!

    If you forget to CTRL+C out of the terminal, you have to reopen it and press CTRL+C otherwise you cannot connect to the Internet via wireless.

    The only thing that would make this more awesome if this could be a service application, that would detect the phone being connected and then allow you to connect/disconnect to the 3G connection.

    Thank you Shannon!

    ReplyDelete
  111. @Brian Reeves - Thanks! Glad to help someone else get more from technology.

    As for the openvpn/adb process continuing to run after forgetting ctrl+c - I thought I had nipped that problem in my latest iteration of the script by running a "killall adb openvpn" when starting the script.. Perhaps you could check to ensure your installed version of the script starts with that command on the first line. The script is located at "~/DroidTetherSV/droidtehtersv" and should contain something like(if newest version):


    sudo killall adb openvpn
    sudo adb forward tcp:41927 tcp:41927
    sudo cp /home//DroidTetherSV/resolv.conf /etc/
    sudo openvpn --config /home//DroidTetherSV/azilink.ovpn

    Notice that it starts off by killing openvpn and adb.

    As for making it a dameonized process, I haven't really looked into that just yet but I'll definitely consider the idea. Perhaps I'll get to learn more about Ubuntu!lol

    One thing I like about the connection process being user-initiated though, is that it only uses resources when in use.

    Never the less, thanks for commenting and congrats on your Freedom!

    Shannon V.

    ReplyDelete
  112. Thanks for the easy script setup!

    Here are the lines I had to change in install_droidtethersv.py to work with Fedora 12:

    #output = os.system('apt-get install network-manager-openvpn openvpn -y')
    output = os.system('yum -y install NetworkManager-openvpn openvpn')

    ...

    #os.system('/etc/init.d/networking restart')
    #os.system('restart network-manager')
    os.system('/etc/init.d/NetworkManager restart')

    ReplyDelete
  113. You, sir, ROCK! Thank you. This immediatly worked with no problem on Karmic with Motorola Droid/Verizon. All ports (particularly my needed SSH!!) worked - even ran updates to stress test it with a load.

    Any thoughts on a more GUI style installer or app? I have some experience in that field if you are interested in anyone helping..

    ReplyDelete
  114. @The *growlf* Dragon - glad it worked for you.

    "Any thoughts on a more GUI style installer or app? I have some experience in that field if you are interested in anyone helping.."

    I like the idea of making this a .deb installation - that would make it easier to install I think. Is that something you do?

    I don't have any experience with making .debs.. and I was going to look into it and perhaps get around to making it work, but I obviously haven't yet.

    Someone mentioned making the process run in the background and detect when the droid was plugged in to automatically tether. Some people might like this idea, but I don't because I would rather initiate the process when I need it instead of having it eat system resources all the time.

    I don't claim to own any of the methods or code used in getting the tethering setup so please feel free to use anything from my post if it can help.

    Cheers!
    Shannon

    ReplyDelete
  115. I got everything working on my newly updated fedora 13 on my Thinkpad T61.

    This is way cool and really enhanced my enjoyment and utility of my motorola droid

    Thanks!!

    ReplyDelete
  116. I am also getting the "process restarting" error.

    I have a motodroid and lucid lynx. I checked and double checked all the information, it all matches what is in the this tutorial. Any suggestions?

    ReplyDelete
  117. @Corey, did you try the script, or did you manually configure?

    Also, can you connect your Android and post the results from the terminal command lsusb please? The usb deviceid for your Android should match the rule you created in /etc/udev/rules.d/91-android.rules

    ReplyDelete
  118. @jtmuzix - Please try with the newly added instructions for Fedora, or try the script.

    ReplyDelete
  119. Thank you for your straighforward (and vi friendly) instructions! This worked marvelously. It took less than 10 minutes, and here I am, tethering ubuntu through my new motorola android.

    Never again will I pay for the interweb.

    ReplyDelete
  120. @AltonBYD - Hold on a second.. I'll shoot a quick video for it.

    ReplyDelete
  121. To ensure all applications work, you must not only disable Wireless. You must also disable "Networking". Once you do this, you should find that all applications will work, including Pidgin!

    ReplyDelete
  122. I've been struggling to find a way to tether my new HTC Evo to Ubuntu for several days. And I can't tell you how happy I was to find this. Thanks so much for your efforts!! The script works beautifully with my HTC Evo. I was able to set it up on my Ubuntu 10.04 64 bit and 32 bit machines. Again, thank you.

    ReplyDelete
  123. Hey Shannon,
    Just a tidbit I have upgrade to Xubuntu 10.04 and tether is working great after some issues (typos mostly). I do not have to turn off my wireless connection to connect to my Droid.

    ReplyDelete
  124. Running Ubuntu 10.04 64 bit and your script worked fantastic on my new HTC Droid Incredible.

    The only negative I am running into is that I have to have wifi enabled on my Incredible in order for data to go thru. If I turn off wifi on my Incredible with the USB cable attached, the device will not go on the internet.

    ReplyDelete
  125. Running Ubuntu 10.04 64 bit. (This is a follow up to only being able to tether to the phone's wifi)

    SOLVED my issue with '0 Bytes Sent' on my HTC Incredible. For anyone else with that issue, the solution is in the settings on your phone. Another poster in this thread had the same issue.

    This guide is excellent for the linux setup, but it wouldn't hurt to add the settings for the phone itself.

    1. When connecting via USB select the last option 'mobile broadband connect'. On my incredible I notice that 'mobile network connection' gets disabled when I do this. You have to turn that back on

    2. Go to system -> Wireless & Networks. Scroll down and make sure 'Mobile Broadband Connect' is checked. Also make sure 'Mobile Network' is checked and has a status of 'Connected'. If not, uncheck Mobile Network and recheck Mobile network to get it properly connected.

    ReplyDelete
  126. @Anonymous with Incredible/'Mobile Network' checked - Hmm, I've been switched from a MotoDroid to an Incredible and my Incredible worked straight away after I installed the script. Thanks for posting the tip though, I'll be sure to use it if I have that problem. Cheers! Shannon

    ReplyDelete
  127. Works like a charm on Verizon Droid ERIS. ACER Aspire One running Ubuntu Lucid. Ran the script and it kicked off without a hitch. This is a GREAT solution for Linux users looking to tether ala PDANet -> especially since PDANet doesn't currently support USB tethering on Linux.

    Excellent work Shannon.

    ReplyDelete
  128. As an update to my Empathy IM issue, I found the solution here: http://danielhollenbach.blogspot.com/; you must disable all networking in order for it to connect.

    ReplyDelete
  129. First run and it worked perfect, Motorola back flip unlocked on the Fido network in Toronto On.

    Ubuntu 9.10 on a Gateway 11" netbook

    Thanks

    John

    ReplyDelete
  130. I'm so glad I found this (thank you Google)! Installed this using the python script on Ubuntu 10.04 and my new MyTouch 3G Slide (HTC Espresso)! I was having a hard time finding a way to make the market tethering apps to work. Thank you!

    Also, I hope you don't mind, I posted the link to this post on XDA forums to help people out. If you do mind just email me and I'll remove the link. Here it is: http://bit.ly/9GTBCg

    ReplyDelete
  131. @no joy - I received your comment, and it shows that you were already root when you tried running the install script. Please open the terminal as a user (not root), then run "sudo ./install_droidtethersv.py"

    This:
    "root@ubuntu-laptop:/home/laptop/Droid-Tether-SV# sudo ./install_droidtethersv.py"

    Should be something like this (assuming your username is "laptop"):
    "laptop@ubuntu-laptop:/home/laptop/Droid-Tether-SV# sudo ./install_droidtethersv.py"

    The problem with running as root is there's no /root/Desktop folder by default in Ubuntu. This is why you get the error: "touch: cannot touch `/root/Desktop/Droid-Tether-SV.Desktop': No such file or directory". Even if there were a /root/Desktop directory, you wouldn't be able to see the startup icon when logged in as a normal user anyway.

    If you really did want to run the script as root, **running your system as root by default is a VERY bad idea for security- NOT RECOMMENDED, you should find there's a script created at "~/DroidTetherSV/droidtethersv" that can be run to start the connection to your phone. Again, I do not recommend you use your computer as root on a normal basis for security reasons.

    To get this working properly, please run the script again, as a normal user, using sudo as shown above.

    ReplyDelete
  132. I spent a whole evening trying to make it work on my laptop.
    No luck.
    The next day, decided to try on a desktop machine and collect all the debug info and document the process.
    It worked perfectly.
    Tried it again on the laptop the same way, and it worked as expected.

    HTC Incredible, Toshiba U200, Ubuntu 10.04

    ReplyDelete
  133. After much searching and trying different tethering options between my Ubuntu (9.04) laptop and my Motorola Droid (Android 2.1) phone, your script did the job. Thank you! You've made my mobile computing life SO much better!

    One thing with your script, though, that did not hurt much but did cause a snag: the line "sudo restart udev" errored out for me because I don't have the program "restart" installed nor can I install it with apt-get install. Is it possible you meant "sudo /etc/init.d/udev restart" or something similar? I ran that after the script and now I have networking, though I don't know 100% if that's what got it working.

    Again, thank you so much for this. This is big for me, tethering is why I decided to upgrade to a smartphone and you made it possible.

    ReplyDelete
  134. @Wesley, glad it worked for you. It's the least I can do to give back to the community that provides me with so much free stuff. Also, thanks for the Kudos.

    As for the "sudo restart udev", the "upstart" style of commands e.g., restart "scriptname" are present in Ubuntu 10.04.. I guess I didn't think about the fact that those commands are probably not yet available in Ubuntu 9.04. Rebooting the computer would have the same effect of course, but I'll make some changes to the script and reinstate the "old-fashioned" method of restarting the service from the init.d directory.

    Thanks for submitting the feedback on that, I really appreciate it.

    Cheers!
    Shannon VanWagner

    ReplyDelete
  135. I was reading your original post as I prepared to hit the road for a week, and I thought it would be too much of a pain to get the android sdk onto my wife's netbook.

    Thanks for putting together the python script that you put up today, which worked like a charm on eeebuntu netbook remix!

    ReplyDelete
  136. Holy crap this worked like a charm. Working perfectly on my HP1030nr with my Motorola Droid. Going to do the same thing on my friends Asus eeepc netbook. Thanks!

    ReplyDelete
  137. Great script!!! This works perfectly. I really love that I can use an Open Source Operating system on my laptop (Ubuntu) with a phone that uses Open Source software. It's about time people have real choices. YOU ROCK!!!

    ReplyDelete
  138. Hi Shannon:

    Great work on this, but I'm having a problem similar to some folks above. I'm on Ubuntu Lucid, with a Verizon Motorola Droid. I installed manually, and checked my settings. When I do "adb devices" I do see my Droid. Wireless is disabled, USB Debugging on the Droid ON. Here's what I get when I run the start_modem script:

    chris@cutebalrog:~/Downloads/azilink$ ./start_modem
    Tue Jun 29 11:45:46 2010 OpenVPN 2.1.0 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [MH] [PF_INET6] [eurephia] built on Jan 26 2010
    Tue Jun 29 11:45:46 2010 WARNING: --ping should normally be used with --ping-restart or --ping-exit
    Tue Jun 29 11:45:46 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Tue Jun 29 11:45:46 2010 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Tue Jun 29 11:45:46 2010 TUN/TAP device tun0 opened
    Tue Jun 29 11:45:46 2010 /sbin/ifconfig tun0 192.168.56.2 pointopoint 192.168.56.1 mtu 1500
    Tue Jun 29 11:45:46 2010 Attempting to establish TCP connection with [AF_INET]127.0.0.1:41927 [nonblock]
    Tue Jun 29 11:45:46 2010 TCP connection established with [AF_INET]127.0.0.1:41927
    Tue Jun 29 11:45:46 2010 TCPv4_CLIENT link local: [undef]
    Tue Jun 29 11:45:46 2010 TCPv4_CLIENT link remote: [AF_INET]127.0.0.1:41927
    Tue Jun 29 11:45:56 2010 Peer Connection Initiated with [AF_INET]127.0.0.1:41927
    Tue Jun 29 11:45:56 2010 Initialization Sequence Completed


    At this point, output from the start_modem script stops. I see "Connected to host" on the Droid, but no network connection on my PC.

    Hope you have a suggestion as to what might be missing or wrong.

    Thanks!

    ReplyDelete
  139. @Christopher, from your output, things look to be working. Please try this: open Firefox, ensure "offline mode" is turned off, then attempt to navigate to http://74.125.19.99 (it's Google.com)

    ReplyDelete
  140. Hi, rank newbie to Linux here (I know, I know).I have a vague understanding of everything I've done so far, but I run into trouble at Step 9: when I attempt to install openvpn in Ubuntu (using 10.04, if that matters, but I had the same issue with 9.04 as well) I get:

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package network-manager-openvpn

    The PC I'm attempting to install this on has no internet access via NIC (which is why I'm attempting to set up tethering in the first place). This feels to me (I've been supporting Microsoft OS's for years) like an OS problem rather than specifically a tethering problem, but I'm still too new at Linux to understand exactly what's going wrong at this point. Help?

    ReplyDelete
  141. @Firefly, for the tethering to work, Ubuntu needs to install some software from the Ubuntu repository of free software located on the Internet.

    The easiest way for you to get things running would be to go somewhere where you can get Internet access (wireless or wired), and then run the script while connected to the Internet. For good measure, while you have Internet access, I would also suggest you update your system at this time, via System>Administration>Update Manager as well.

    If you really cannot get the Ubuntu machine plugged into the Internet, you'll still have to manually download the openvpn package and dependencies for the installation.

    On a basic Ubuntu install, the packages & dependencies you will need(and to be installed in the order shown) are:
    liblzo2-2 libpkcs11-helper1 openssl-blacklist openvpn-blacklist openvpn

    You can get these packages(about 7.6M in total size) from:
    http://packages.ubuntu.com/lucid/openvpn

    If you are running a 32-bit machine, I could zip all the packages up into a bundle and put them somewhere where you can download them. You would then have to install each one in the order listed above. Let me know if I can help.

    Something else I notice is that after further review, I've found that only the package openvpn is needed, not network-manager-openvpn. So I'll modify the instructions and the script to not include network-manager-openvpn. Your feedback helped, Thanks!

    Shannon VanWagner
    Disclaimer: I cannot provide any type of warranty(even implied) for anything provided so by using anything from this blog or that you download directly from me, you assume any and all risk associated with using the content on your machine.

    ReplyDelete
  142. @Shannon: Thanks for the help. Getting the machine to a valid internet connection is not an option - it's a work PC and it's not a laptop - it's a tower. I think it'd raise a few eyebrows if I walked outta the place with this under my arm.

    It's always seemed a bit odd to me that instructions on how to use your Droid to connect a PC to the internet assume you're already connected some other way. Let's face it - the Droid is NOT a T1. ;)

    I really appreciate the trouble you've taken to post these instructions and the help you're providing to people after the fact. Working on getting the files... er, packages (dangit, there's my Microsoft background talking again)downloaded and installed; hopefully this will be the only bump in the road. But if you want to verify that your instructions are truly idiot-proof, I may be just the idiot for your experiment!

    ReplyDelete
  143. The readme file isn't readable before beginning the installation; is this what you really wanted to do?

    "You have chosen to open Droid-Tether-SV-README which is a: BIN file from: http://dl.dropbox.com

    What should Firefox do with this file?"

    ReplyDelete
  144. @Anonymous... Hmm, I open it just fine with gedit in Ubuntu 10.04. Are you opening it with windows or something? If so, try notepad, otherwise in Linux, open with gedit or your favorite text editor.

    ReplyDelete
  145. Thank you. I was expecting to be able to read the installation instructions in Firefox. Once I downloaded & saved the installation instructions, I was able to read and follow the instructions quite easily. I used the script you wrote and it worked perfectly for me.

    I am running Ubuntu 8.04 w/updates and writing this to you using my HTC Incredible tethered to my Dell Latitude D800.

    Thank you for all your hard work; I live full-time in my RV and this enables me for the first time to be able to get on-line without having to trek to the nearest library with wireless access.

    Thank you, thank you thank you!!! :)

    ReplyDelete
  146. I use OpenVPN to connect to my router (it runs an OpenVPN server) to access my home network. PdaNet and OpenVPN work fine together in Windows; any ideas on how to have this and a separate VPN connection running at the same time? If I got that working, Blu-ray playback would be the only thing I need Windows for. :)

    ReplyDelete
  147. @Shannon: Will the upcoming OTA update to Android OS 2.2 screw up the Linux tethering your great script enabled?

    ReplyDelete
  148. Shannon and anyone else willing to help a newbie,
    1st off, thank you so much for all the work that went into this. Very helpful! I tried using the script, then tried setting it up step by step per your instructions, but both had the same result. It see's my incredible, and looks like it connects, but I can't get out to the Internet at all. I've gone thru all the comments and tried the suggestion there, but no luck. My wireless card on my laptop is disable, my phone is set to "Mobile Broadband Connect" and the Mobile Network say "connected". I'm using a Dell Lat D620 and Ubuntu 10.04 LTS. Any suggestions?

    Thanks,
    Mark

    ReplyDelete
  149. @MTBiker, have you tried re-running the script, then try connecting again (with azilink enabled on the phone). Then try to open this in the web browser: http://74.125.19.99 (google.com)

    Note: ping does not work with this method, it's a known issue.

    ReplyDelete
  150. Shannon,
    Yes, I tried that again. It just sits and looks at me...

    BUT, then I went in and toggled the "Mobile Network" setting on and off, after connecting using the "smart_modem" script and boom, it worked! Thanks a million for this script! I can finally use Linux, and only Linux, on my laptop! You the MAN!

    ReplyDelete
  151. I too was able to get my Fedora 13 (x86_64) system tethered but it was fraught with issues when using the Python install script: missing packages, complaints that there is no "udev" service in /etc/init.d/ and probably a few other things. My apologies for doing a shoddy job of keeping good notes. Perhaps the next F13/64 user might add better information.

    ReplyDelete
  152. @pajatome, Thanks for the feedback. Frankly, I've done way more testing on Ubuntu than Fedora. I tested the script on a LiveCD version of Fedora and one problem I had was that the Fedora LiveCD user is not in the sudoers file (so the issue was going to be reported... lol). The only package that should need to get installed is openvpn and its depends.. the script should at least be able to install this using yum (assuming the Internet is connected at the time). I'd be glad to address specific issues. Other than the error messages, did you have to correct anything or do something else to get the tethering working? It worked for me on the LiveCD, but perhaps that's cheating ;*)

    ReplyDelete
  153. Thanks to you Shannon for providing this excellent solution. I stepped through the README and this worked beautifully with the Back-Flip (Android 1.5) and Ubuntu 10.04 LTS - the Lucid Lynx. I did have to backup my resolv.conf, thanks for the heads-up on that. I am right now providing this update via the tethered connection. It is only an Edge connection here in this fringe area so I want publish the "speed" stats.

    ReplyDelete
  154. @kcvearner, right on.. glad it worked for you. For those using the python script to set this up, the script does backup the /etc/resolv.conf (once) initially, it will be saved as /etc/resolv.conf/resolv.conf.preDroidTetherSV

    Enjoy!

    ReplyDelete
  155. Thank You for this great post! I'm using Mint and everything works EXCEPT Pidgin-any tips how to get it fuctioning? Appreciate any help

    ReplyDelete
  156. Can I setup two droid phones to the same computer? If so, do I need two user accounts setup on the computer? I'm using Ubuntu 10.

    ReplyDelete
  157. @philly4499, I'm not sure whether you mean using 2 different droids, each at a separate time, or both at the same time. As for separately, that would work just fine. As for using them at the same time, I suppose you could rig this up via the openvpn settings, but then the problem would be the default gateway. If you happen to get this working, please post your solution.

    ReplyDelete
  158. I got the HTC Desire recently. When i plugged it in to my Fedora 12 laptop's USB port and selected "Internet sharing" from the dropdown dialog on the phone, it quickly came up as a USB wired network connection in NetworkManager - and just works.

    ReplyDelete
  159. Shannon, thanks for the excellent how-to on setting up tethering for ubuntu [10.04] / android [moto droid] (!) I did have a problem with the start_modem script for some reason, but when i run the commands separately, it connects without a problem... any thoughts?

    ReplyDelete
  160. I tested the script on the Original Droid and HTC Incredible with Ubuntu 10.04 on Dell Latitude D620. Working like a charm on both. Got it to work under 5 minutes and I'm a newbie! I was having problems with one laptop. It kept telling me check the Internet connection during the download of the packages. It appears that I had way too many WiFi networks setup. Right clicked the connection icon, edit connections, wireless, and deleted everything and re-connected to my home network. Worked perfectly.

    My only concern is that I have no idea what I installed on my computer or my phone and I somehow compromised security on either or both.

    ReplyDelete
  161. @newbie - good to hear it's working for you. As for being concerned about what was installed... The script contains the source code. Since the script is not in binary format (e.g., .exe), you can read through a freshly downloaded version of it and look at the comments I put in there to get an idea for exactly what's happening. Or, if you want to do some Googling on python and bash - you will be able to decipher the commands, and even make the script better for your own use. Please do.
    Regards,
    Shannon

    ReplyDelete
  162. @industrialight - do you get an error message with the start_script? Perhaps you could open the start_script with gedit and check to make sure the commands in the start_script are the same ones as what works when you enter it manually.

    ReplyDelete
  163. The python script worked flawlessly for me on my Moto Droid running 2.1. Thanks so much, Shannon, for putting it together and sharing it. You da' man!

    ReplyDelete
  164. Pure Awesome. Got my Droid Incredible tethered to my netbook in 2 mins w/ your script. Love it!

    ReplyDelete
  165. Installed on Dell Inspiron mini running Ubuntu 10.04 and an HTC Droid Incredible (stock software) running Android 2.1. Seems to be working flawlessly. My biggest difficulty was in realizing that "on your desktop" was referring to a directory named "desktop" -- I'm that new to Ubuntu, and all of this from soup to nuts was over my head, but it worked without a hitch. A little scary, in a way.

    Thanks very much, Shannon!

    ReplyDelete
  166. After these procedures, in which device (/dev/ttySOMETHING) is the modem mounted?

    ReplyDelete
  167. @shannon, I was just wondering if the script or anything I installed on the phone can compromise security or be exploited by some unwanted intruders.I'm so new at this stuff, I can't possibly be sure of anything :)

    Once again thanks for the work you put in this project.

    Also, does anyone know for sure if Verizon can tell we are tethering without a tethering plan? a lot of opinions around the Internet but nothing for sure.

    ReplyDelete
  168. You sir, ROCK! Great bit of work! You are my hero of the day... Your script was flawless.

    Just FYI - config is Droid and Lucid.

    ReplyDelete
  169. Great article! I just wanted to point out that on Fedora the init scripts should point to :

    /etc/rc.d/init.d

    rather than

    /etc/init.d

    and some of the naming is different (NetworkManager, network, and udev-post as opposed to networkmanager, networking, and udev). After a quick edit to the python script though I was good to go.

    Thanks so much!

    ReplyDelete
  170. Very awesome work! Just got the droid x and this software works like a champ - I had to install the AziLink to the phone manually - but maybe because I didn't have the allow non-market-apps enabled when I ran the python script, not sure... Anyway it works great with that and Ubuntu 10.04.1. Thank you!

    ReplyDelete
  171. Sweeeet!!! Works on openSUSE 11.3 :) Thanks alot, dude. You rock!

    ReplyDelete
  172. Hello,

    Great stuff! But I want to do the opposite.

    I have a Droid that is not activated on any network. (Well, it is a Verizon Droid, but I'm about to disconnect it.)

    I have a phone that offers BlueTooth DUN capability.

    I want to use the Droid's data services, with my other phone being the connection - via Bluetooth.

    How can I do this?

    Chees,
    -J

    ReplyDelete
  173. Great work! Script works fine on Ubuntu 10.04 and HTC Evo (froyo) 2.2 on Sprint. When the script finished, I couldn't get connected right away. I killed (Ctrl-C) the script in Ubuntu, shut down AziLink, unplugged the USB, then reconnected and restarted both. No problems after that. Thanks a lot!

    ReplyDelete
  174. @JB - right on! Thanks for reporting back on your tests with 2.2. There had been some question as to whether this tethering capability would somehow get the axe after the update.. and now we can breathe a bit easier anyway. Now we just need someone with the Verizon-based Android 2.2 device to test it. Supposedly the Verizon Droid is supposed to be getting the updates now.
    Cheers!

    ReplyDelete
  175. Heck YEAH! was starting to think that Linux hated itself. The Python script work like a charm! and I'm running Ubuntu 9.04. Great work.

    -Mhdaugherty86@live.com

    ReplyDelete
  176. Tried doing this with my newly-updated Froyo/Android 2.2 Motorola Droid and Ubuntu 10.04, no luck. Azilink at first showed some data transfer, about 700 bytes, and then nothing at all. No new connections shown under networking.

    Is 2.2 blocking this (as Verizon wants to charge for tethering), or is there a 10.04 incompatibility, or am I missing something?

    ReplyDelete
  177. Oops, never mind the above. Success with Moto Droid, 2.2, Verizon. Shannon, thanks a ton!

    Not sure why it wasn't working... I did re-boot laptop and phone, still wasn't working. Gave up, discovered my wireless wasn't connecting, re-booted again - and it works.

    Posting this through my Droid connection.

    ReplyDelete
  178. @Everyone: on my HTC Incredible, when I plug in the USB cable, my phone presents a menu "Charge only, HTC Sync, Disk Drive, Mobile Broadband Connect". If I select "Disk Drive", I can tether using Azilink as well as access the files on my phone at the same time. I just found this out, thought I'd share.

    ReplyDelete
  179. Worked perfectly.

    Notes:
    * I'd recommend saving the resolv and open vpn config in /usr/local/etc for posterity.
    * Just point people at the download manifest for azilink and the sdk so you don't have to update the links every revision.

    ReplyDelete
  180. FWIW - Droid 2 (Android 2.2) and eeebuntu 3 (Ubuntu 9.04) - worked fine.

    ReplyDelete
  181. Thanks so much for posting this. I am a newby and whats worse not an IT guy. I have been poking around with Ubuntu for an embarrassingly long time given my ability level. I have tried the instructions and I have initially failed. It appears that I have not installed any of the components starting with liblzo2-2 -- for the record the files I have gotten are liblzo2-2_2.03-2_i386.deb libpkcs11-helper1_1.07-1build1_i386.deb opnssl-blacklist_0.5-2_all.deb openvpn-blacklist_0.4_all.deb and openvpn-2.1.2.tar.gz
    I get the same error as firefly above where the reposting was never fully chased down or documented here? I get
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package "whatever package I am trying to install here"
    I have checked to make sure the downloaded packages are in the directory I am current in the terminal so I know that the packages are there and correctly named when I reference them, however ... sigh....
    also since I do not have a connection the instruction
    wget http://azilink.googlecode.com/files/azilink.ovpn
    in step 10 might also be a hang up....
    I really really appreciate any help you can offer.

    ReplyDelete
  182. Thanks Shannon, it works great!

    The only "hiccup" was that the line:

    user = os.getlogin()

    in your python script errored out. I just put in the literal:

    user = "johwaa"

    and it works great. In fact, it's what I'm using now. :)

    ReplyDelete
  183. Another dumb question from Floyd In tampa... Since the Droid has internet access and the computer Ubuntu 10.4 does not can I run the perl script from the droid somehow?

    ReplyDelete
  184. MOD OWNER -- This is linux geek.. I sent the script in using wvdial...well I found out I have an error in my script. Here's the correct script:

    [Dialer Defaults]
    Init2 = AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
    Modem Type = USB Modem
    Init1 = ATZ
    Modem = /dev/ttyACM0
    Baud = 460800
    Init3 = AT+CGDCONT=1, "IP", "WAP.CINGULAR"
    ISDN = 0
    Stupid Mode = 1
    New PPPD = yes
    Phone = *99#
    Password = test
    Username = test

    (The error was in the init string, my original script said "S0-0" should have been "S0=0"! :( My Bad!
    Sorry

    ReplyDelete
  185. @DPR - That's a good question.. It won't do any good to try to run the script from the Android but you could use the Android to download the following packages and then retrieve and install them to your Ubuntu machine: liblzo2-2 libpkcs11-helper1 openssl-blacklist openvpn-blacklist openvpn
    You can get these packages(about 7.6M in total size) from: http://packages.ubuntu.com/lucid/openvpn

    After that, you would need to create the startup script and install azilink to your Android per the instructions in the article to connect.

    Cheers!

    ReplyDelete
  186. Did this with my Android Incredible with Verizon service and it works like a charm.
    One thing to remember is that when you connect the phone with the USB cable make sure NOT to select the Mobile Broadband Connect option.

    One question though, using this process do I need to pay Verizon for the "tethering option" for which they charge me $30 a month?

    ReplyDelete
  187. Just bought Android 2. This script works! I did get an encryption error, but it still worked. I use fedora 12.

    OpenVPN 2.1 requires '--script-security 2 .....then something about clear text transmission.

    Don't know what to do for that.

    Larry

    ReplyDelete
  188. Thank you so much for this article! I am now able to connect to the internet from my laptop running BackTrack Linux. The wireless card on my laptop is broken, and if it weren't for your tutorial I wouldn't be able to get on the net.
    Keep up the great work,
    Igor

    ReplyDelete
  189. The python script made this a breeze on Fedora 13! Now I can go to the race and still be able to get my work done! PDAnet works great with Windows, but this is terrific so I can use my linux laptop while away from the house.
    Thanks so much for this!
    Jason

    ReplyDelete
  190. New to Linux myself. I had this working on a previous install of Ubuntu 10.04 and my Droid X. I had to reinstall Ubuntu because of a drive failure. Now I can't get this to work. The script runs, Azilink is still installed on the DX. Now I just get a connection refused error in Ubuntu. Any ideas? I tried uninstalling Azilink from the DX and then the script wouldn't reinstall it so I did it manually and still no go.

    ReplyDelete
  191. Shannon,

    Just wanted you to know I ran the script a while back, tested it and it worked fine on my desktop. Pretty great in and of itself.

    But all last week, I was on vacation with nothing but my Droid and my Ubuntu netbook, and with no WiFi connection. I had run your script on the netbook before leaving home but never tested it. For me, this would be the true test of the setup.

    I'm here to report that it worked PERFECTLY, all week. I couldn't believe how seamless it was. I could even receive a phone call and temporarily lose the Internet connection, then hang up the call and the connection would be restored automatically, no restarting, or any action required on my part.

    Thanks for creating such a useful system!

    ReplyDelete
  192. @DeathAdder666 - sounds like the DX isn't being seen as connected to the machine. Do you get some type of indication from the Droid when you connect it? Also, what do you get if you connect the Droid, then run adb devices from the Terminal? Also, do you have USB Debugging turned on in the DX?

    ReplyDelete
  193. @Floydintampa - From your description, it sounds like you are trying to use the script after downloading the individual *.deb files?? This will not work, because the script (or even the sudo apt-get install commands) are used to retrieve the packages from the Internet, not a local directory. Since you don't have an Internet connection, what you need to do is double-click each of the *.deb files and follow the on-screen instructions for installing them with the gdebi graphical installer tool. After you have the packages installed, you will need to perform the other steps manually as outlined in this blog entry to get setup. The script will not work for you because it checks to see if you have Internet before proceeding. If you end up having major problems following the steps manually... let me know, and perhaps I can modify the script to perform the rest of the steps (less the installation of openvpn) for you. Also, as a general note, anyone is allowed to copy/modify/redistribute the script to suit their needs. As for troubleshooting individual problems, I have tried to cover every problem that one might encounter by adding the appropriate detail to the setup steps but I obviously can't cover every possible setup problem that someone might have. People(including myself) are infinitely creative in this respect..lol But I will try to help, if possible, as I have time. Please understand that I don't get paid to do this, and so I can only devote spare (and therefore lower priority) resources to helping each person fix a problem they might have when installing this script.
    Cheers!

    ReplyDelete
  194. Thanks for the help. adb devices gives me an error that cannot open shared object file. libncurses.so.5. I hear the all too familiar "DROID" sound when connected and I see the device appear in Ubuntu. the DX is in debugging mode and I had this working with your script originally before the machine rebuild. So I know it worked before. Just now with a fresh 10.04 build it's giving up the errors.

    ReplyDelete
  195. I figured it out finally. I checked out the SDK package page and found it was for x86 and I'm running x64 now (I don't remember if the previous build was x86 or x64). So I used the "sudo apt-get install ia32-libs" command and updated the libraries and it started up just fine. Thanks for the help. If others are having trouble with x64, maybe this will help them out too. Thanks again for the help, this is a life saver.

    ReplyDelete
  196. @Shannon: OTA update to Android 2.2 on HTC Incredible (Verizon) confirmed to work with AziLink and Shannon's script (installed under 2.1u1). Posting this while tethered to my Dell D800 Latitude. Great work Shannon!

    ReplyDelete
  197. How did you figure out what the vendor ID is? I want to try to make this work for my friend. He has a LG phone.

    ReplyDelete
  198. @Daniel Hollenbach - to get the deviceID, connect the phone via USB cable to the computer then run the terminal command lsusb

    If you will post the output from lsusb, I'll add the device to the script and instructions.

    Cheers!

    ReplyDelete
  199. @Daniel Hollenbach - the terminal command to get the device id while the USB cable is attached to the phone is lsusb

    If you could post the output from lsusb, I will add the device to the script and instructions.

    Cheers!

    ReplyDelete

Post a Comment

Thanks for commenting. Comments are moderated by the blog owner and will appear once approved. Need to email me directly? Go to http://shannonvanwagner.com/email-me.php

Popular posts from this blog

On Helping Others Get their GNU/Linux & Consider Doing So

How To: Install Wordpress on Manjaro Linux Pahvo 21.1.0

How to Disable Middle Mouse Button in Ubuntu / Debian Linux