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":
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).
tar xvf android-sdk_r07-linux_x86.tgz
cd android-sdk-linux_86
tools/android
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
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.
ReplyDeleteThanks,
Jason
Hello!
ReplyDeleteBeing 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!
@Brian,
ReplyDeleteVery cool. I'll give it a test and let you know.
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@Brian & @Mohammed,
ReplyDeleteI 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
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?
ReplyDeleteThanks,
John
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.
ReplyDeleteI'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
@John,
ReplyDeleteIf 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
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?
ReplyDeleteDoesnt .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
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?
ReplyDeleteDoesnt .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
\\\ AIR GUITAR ///
ReplyDeleteI have found this information very helpful for my Linux box (helped with finding some solutions for other app installs).
ReplyDeleteFor 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!
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.
ReplyDeleteCheckout 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.
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.
ReplyDeleteI got the web browsing and internet plan from verizon which gives me unlimited data transfer.
I found your article very interesting and much needed. However I cannot get out on the internet.
ReplyDeleteI 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
I think i figured out my issue. I coped the 91-android.rules to the /usr/bin not /etc/udev..doh...
ReplyDeleteYou rock..
J
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
ReplyDeleteJust 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:
ReplyDelete- 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
Will this work on Ubuntu 9.04?
ReplyDeleteThis works as well with CentOS 5 with the following changes.
ReplyDelete1. 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.
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).
ReplyDeleteHello Thanks
ReplyDeleteI 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
Shannon VanWagner you ROCK!
ReplyDeleteSeriously 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
Super! Issues I had, with no active internet, using Linux Mint & (Gloria) and my Droid.
ReplyDeleteI 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
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!
ReplyDeleteAn update to my comment, pleasantly suprised, while surfing, my Droid rings!
ReplyDeleteSo I answer it, while I am on the web tethered.
So, purchase a tether long enough to make this easy!
Clif
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.
ReplyDeleteGreat tutorial. I'm posting with my phone(well, ok, wifi through my phone)'s connection right now.
ReplyDeleteBravo 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
@Dan Beam,
ReplyDeleteyes, nice job.. thank you Sir for finding the mistake.. I've since changed it in the posting.
Cheers!
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:
ReplyDelete# 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...
Exactly what I was looking for; works perfectly. Thanks!
ReplyDeleteExcellent 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?
ReplyDeleteThanks!!
Awesome!!! It works great! Thanks for posting this. It is amazing how easy your step-by-step procedure made this seem.
ReplyDeleteHere's Hak5's article:
ReplyDeletehttp://digg.com/d31FPoE
and bigmack83 over at alldroid.org made a script:
http://alldroid.org/viewtopic.php?f=236&t=763
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.
ReplyDeleteI 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.
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
ReplyDeleteno 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).
Thanks a lot! It works great!
ReplyDeleteA 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
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.
ReplyDeleteAM i getting something wrong here or is that just normal?
Thanks for your help and greetings from Germany
Phillip
I believe I followed the directions correctly, but my Droid doesn't seem to make the connection. Any ideas?
ReplyDeleteThanks
@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.
ReplyDeleteAlso, 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?
@garmstrong65, when you run the adb devices command (shown in step 8), do you see your Droid as being connected?
ReplyDeleteAlso, have you tried running each of the commands in step 12 separately, to see if an error is output?
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.
ReplyDeleteSo...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.
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.
ReplyDeletehi , fine tutorial - went through all the steps - but it failed.
ReplyDeleteI 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 !
Thank you! Your expert tutorial here allowed me to post this! I can not thank you enough for this.
ReplyDeleteExcellent tutorial!
ReplyDeleteI'm running 9.10 x64 and this worked when everything else has failed, you are an asset to the ubuntu community. Good job!!
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@Anonymous - "hi , fine tutorial - went through all the steps - but it failed. I have a G2 (htc - hero) and am in the uk."
ReplyDeleteDid 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?
@castironpants - I don't see what comment you are referring to... can you specify?
ReplyDeleteI'm happy to report that this guide worked for me flawlessly in Fedora 12.
ReplyDeleteGreat job!
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!
ReplyDeleteRob
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".
ReplyDeleteShannon,
ReplyDeleteThanks 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?
Shannon,
ReplyDeleteThanks 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?
Huge thanks for this post. This will be very useful when I'm on the road.
ReplyDeleteI'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?
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?
ReplyDeleteShannon, thank you for posting this. Your guide was easy to follow, easy to read, and most important of all---it works!
ReplyDeleteGot tethering working on the first go without any hitches. Thank you sir!
Perfect! Just what I needed.
ReplyDeleteI 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.
ReplyDeleteDo I need to configure the network settings in Ubuntu somehow?
@drb116, try right-clicking your NetworkManager icon and then uncheck "Enable Wireless" prior to running the script to connect to your droid.
ReplyDeleteThank 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.
ReplyDeleteFound your post by accident. It helped me tethering my Milestone within a few minutes.
ReplyDeletethx a lot!
@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.
ReplyDeleteThanks and congrats on your Freedom!
Shannon V.
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!
ReplyDeleteThanks Shannon!
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)
ReplyDeleteError 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
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@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.
ReplyDeleteThanks 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@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@Shannon
ReplyDeleteAs 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.
Hi Shonnon,
ReplyDeleteTrying 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
@Jeff, can you please provide the output from the command 'lsusb | grep Motorola' (no quotes), while your phone is connected with the usb cable?
ReplyDeleteAlso, 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?
Shannon,
ReplyDeleteI 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
@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?
ReplyDeleteDoes 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
----------------------------
without usb tether
ReplyDeleteglynnjr@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)
Shannon,
ReplyDeleteIt 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
@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?
ReplyDeleteIf 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.
Shannon,
ReplyDeleteWell 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
Absolutely brilliant. Works beautifully on 9.10. Will try on the April beta sometime in the near future.
ReplyDeleteAny interest in turning this into a .deb? Most of the steps are easily automated. I'll assist if you're up for it.
Amazing! Great stuff...thanks Shannon!
ReplyDeleteThanks!!! This worked with my at&t moto backflip as well.
ReplyDelete@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.
ReplyDeleteCheers!
Shannon
Shannon: This works just GREAT with my Canadian Motorola Milestone (Droid in the States).
ReplyDeleteI'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.
Shannon:
ReplyDeleteYou 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.
WOW... Im a Tmobile user with a G1... this process worked PERFECTLY...
ReplyDeleteThanks for the post ... very helpful
Right on! Perfect instructions.
ReplyDeleteI 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.
Worked like a charm for me: Nexus One to Ubuntu 9.10 on Taiwan Mobile. Thanks a lot!
ReplyDeleteDoesn't seem adb works on Lucid, not sure why.. I can't update my mom's laptop until that gets resolved :P
ReplyDelete@Ethan Anderson - I've been using Ubuntu 10.04 Lucid for a least a month and I use this Droid connection everyday.
ReplyDeleteThere 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
svanwagner@ubuntu-scythe:~$ ubuntu-support-status
ReplyDeleteSupport 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)
Sorry, false alarm, it does in fact work. I've been doing something wrong for months, this time I forgot to plug it in.
ReplyDeleteI think where you run adb from may actually make a difference.
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):
ReplyDeleteGo to about:config
Change toolkit.networkmanager.disable to "enable"
Correction... "toolkit.networkmanager.disable" changed to "true."
ReplyDeleteI just did this on a Gateway M675 laptop running Fedora 12 using Motorola DROID 2.1.
ReplyDeleteWorked like a champ!
Thank you so much!!
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! :)
ReplyDeleteDownload 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. :)
Or you could just root it and install Barnacle. Much simpler.
ReplyDeleteThe 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.
ReplyDeleteUbuntu 10.04 LTS here, easy instructions, and works good. A little slower then PDANet on Windows though.
ReplyDelete@anon-PDANet on Windows- What is the speed rating you get from speakeasy.net/speedtest ?
ReplyDeleteI'll run another test and post what I'm getting.
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.
ReplyDeleteMaybe 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
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.
ReplyDeleteMaybe 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
Great writeup, this also works in Fedora.
ReplyDeleteNice 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.
ReplyDeletePS: The one at http://code.google.com/p/azilink/downloads/list
Good work!
Thanks
@Anon - "you may want to substitute the newer azilink version 2.0.2"
ReplyDeleteNice 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!
@Anon - "you may want to substitute the newer azilink version 2.0.2"
ReplyDeleteNice 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!
Shannon-
ReplyDeleteUnbelievable. 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!!!
Shannon.
ReplyDeleteVery 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!
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@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.
ReplyDeleteCheers!
Shannon.....thank you kind sir ; )
ReplyDeleteThis script works flawlessly!
ReplyDeleteIf 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!
@Brian Reeves - Thanks! Glad to help someone else get more from technology.
ReplyDeleteAs 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.
Thanks for the easy script setup!
ReplyDeleteHere 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')
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.
ReplyDeleteAny thoughts on a more GUI style installer or app? I have some experience in that field if you are interested in anyone helping..
@The *growlf* Dragon - glad it worked for you.
ReplyDelete"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
I got everything working on my newly updated fedora 13 on my Thinkpad T61.
ReplyDeleteThis is way cool and really enhanced my enjoyment and utility of my motorola droid
Thanks!!
I am also getting the "process restarting" error.
ReplyDeleteI 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?
@Corey, did you try the script, or did you manually configure?
ReplyDeleteAlso, 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
@jtmuzix - Please try with the newly added instructions for Fedora, or try the script.
ReplyDeleteThank 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.
ReplyDeleteNever again will I pay for the interweb.
@AltonBYD - Hold on a second.. I'll shoot a quick video for it.
ReplyDeleteTo 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!
ReplyDeleteI'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.
ReplyDeleteHey Shannon,
ReplyDeleteJust 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.
Running Ubuntu 10.04 64 bit and your script worked fantastic on my new HTC Droid Incredible.
ReplyDeleteThe 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.
Running Ubuntu 10.04 64 bit. (This is a follow up to only being able to tether to the phone's wifi)
ReplyDeleteSOLVED 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.
@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
ReplyDeleteWorks 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.
ReplyDeleteExcellent work Shannon.
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.
ReplyDeleteFirst run and it worked perfect, Motorola back flip unlocked on the Fido network in Toronto On.
ReplyDeleteUbuntu 9.10 on a Gateway 11" netbook
Thanks
John
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!
ReplyDeleteAlso, 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
@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"
ReplyDeleteThis:
"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.
I spent a whole evening trying to make it work on my laptop.
ReplyDeleteNo 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
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!
ReplyDeleteOne 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.
@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.
ReplyDeleteAs 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
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.
ReplyDeleteThanks for putting together the python script that you put up today, which worked like a charm on eeebuntu netbook remix!
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!
ReplyDeleteGreat 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!!!
ReplyDeleteHi Shannon:
ReplyDeleteGreat 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!
@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)
ReplyDeleteHi, 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:
ReplyDeleteReading 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?
@Firefly, for the tethering to work, Ubuntu needs to install some software from the Ubuntu repository of free software located on the Internet.
ReplyDeleteThe 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.
@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.
ReplyDeleteIt'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!
The readme file isn't readable before beginning the installation; is this what you really wanted to do?
ReplyDelete"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?"
@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.
ReplyDeleteThank 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.
ReplyDeleteI 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!!! :)
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@Shannon: Will the upcoming OTA update to Android OS 2.2 screw up the Linux tethering your great script enabled?
ReplyDeleteShannon and anyone else willing to help a newbie,
ReplyDelete1st 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
@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)
ReplyDeleteNote: ping does not work with this method, it's a known issue.
Shannon,
ReplyDeleteYes, 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!
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@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 ;*)
ReplyDeleteThanks 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@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
ReplyDeleteEnjoy!
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
ReplyDeleteCan 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@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.
ReplyDeleteI 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.
ReplyDeleteShannon, 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?
ReplyDeleteI 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.
ReplyDeleteMy 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.
@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.
ReplyDeleteRegards,
Shannon
@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.
ReplyDeleteThe 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!
ReplyDeletePure Awesome. Got my Droid Incredible tethered to my netbook in 2 mins w/ your script. Love it!
ReplyDeleteInstalled 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.
ReplyDeleteThanks very much, Shannon!
After these procedures, in which device (/dev/ttySOMETHING) is the modem mounted?
ReplyDelete@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 :)
ReplyDeleteOnce 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.
You sir, ROCK! Great bit of work! You are my hero of the day... Your script was flawless.
ReplyDeleteJust FYI - config is Droid and Lucid.
Great article! I just wanted to point out that on Fedora the init scripts should point to :
ReplyDelete/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!
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!
ReplyDeleteSweeeet!!! Works on openSUSE 11.3 :) Thanks alot, dude. You rock!
ReplyDeleteHello,
ReplyDeleteGreat 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
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@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.
ReplyDeleteCheers!
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.
ReplyDelete-Mhdaugherty86@live.com
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.
ReplyDeleteIs 2.2 blocking this (as Verizon wants to charge for tethering), or is there a 10.04 incompatibility, or am I missing something?
Oops, never mind the above. Success with Moto Droid, 2.2, Verizon. Shannon, thanks a ton!
ReplyDeleteNot 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.
@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.
ReplyDeleteWorked perfectly.
ReplyDeleteNotes:
* 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.
FWIW - Droid 2 (Android 2.2) and eeebuntu 3 (Ubuntu 9.04) - worked fine.
ReplyDeleteThanks 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
ReplyDeleteI 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.
Thanks Shannon, it works great!
ReplyDeleteThe 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. :)
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?
ReplyDeleteMOD 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:
ReplyDelete[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
@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
ReplyDeleteYou 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!
Did this with my Android Incredible with Verizon service and it works like a charm.
ReplyDeleteOne 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?
Just bought Android 2. This script works! I did get an encryption error, but it still worked. I use fedora 12.
ReplyDeleteOpenVPN 2.1 requires '--script-security 2 .....then something about clear text transmission.
Don't know what to do for that.
Larry
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.
ReplyDeleteKeep up the great work,
Igor
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.
ReplyDeleteThanks so much for this!
Jason
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.
ReplyDeleteShannon,
ReplyDeleteJust 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!
@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@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.
ReplyDeleteCheers!
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.
ReplyDeleteI 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@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!
ReplyDeleteHow 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@Daniel Hollenbach - to get the deviceID, connect the phone via USB cable to the computer then run the terminal command lsusb
ReplyDeleteIf you will post the output from lsusb, I'll add the device to the script and instructions.
Cheers!
@Daniel Hollenbach - the terminal command to get the device id while the USB cable is attached to the phone is lsusb
ReplyDeleteIf you could post the output from lsusb, I will add the device to the script and instructions.
Cheers!