You are hereTunnelDroid

TunnelDroid


By chri - Posted on 28 November 2009

Some long time ago I made a call for help to get OpenVPN working on the Android platform. There were two places where work had to be done: porting openvpn and writing a GUI enabling you to start/stop/interact with tunnels.

It took some time but finally someone made the necessary patches to get openvpn running. It was then time for me to get into action and continue the work on a GUI wrapper.

The first releases supported only hardcoded usernames and passwords, but I finally released a new version supporting authentication prompts. If you want to install it simply search for TunnelDroid on the Market.

On the technical part this is how the app is structured:

  • Main GUI Intent listing the configurations
  • Second Intent to edit the configurations
  • Service managing the openvpn binaries and the tunnel-inteligence
  • Thread to stop openvpn after a timeout, this is necessary as otherwise openvpn will not stop try connecting
  • Thread to interact with openvpn using a network socket and the openvpn management interface
  • Intent displaying the connection logfile, logfile can be emailed by a simple click
  • Status Bar Notification when the tunnel is up

Of course the code is released as open source and can be found on sourceforge.
Below you can see some screenshots.

So what am I supposed to fill in in "Filename" and "Content"..

Going to SF from your mobile is sloooo :)

Did you read the README?
Just drop your .ovpn config file and your certificates in the openvpn/ directory on your SDcard.

Starting a config from scratch from your phone is not a good idea as you still need to import the public key of your server or CA.

Then start up TunnelDroid and connect.

We need a beginner's guide to this.

The readme is not enough.

http://sourceforge.net/projects/tunneldroid/files/README/download

I have a Motor Droid running 2.0.1 and rooted. I started to install openvpn, then I stopped and wondered if it was a good idea to install new .so files that were made for a different version of Android. I'd appreciate any advice.

First try to simply copy the openvpn binary and the liblzo.so file without the other .so files.
So simply don't replace anything existing.

Then start up openvpn manually using the CLI:
cd /sdcard/openvpn
openvpn --config configfile.ovpn

If that is working then TunnelDroid will also work fine.
If it doesn't work feel free to send me the output you get. That might help me helping you.

Cheers

Sorry to have bothered you. I finished the install, then I realized I was looking for an Android implementation of vpnc, not openvpn. :(

If you would like me to test for you, I'd be happy to provided you send me an ovpn file for some test site.

Thanks and Cheers,
Mike

Hello Chris,
I would like to try this out and get this working on the Moto Droid. I have copied openvpn to /system/bin and liblzo.so to /system/lib. On running the command from the su shell, it seems to connect but fails with a cannot allocate tun device dynamically error. Everything seems to be going famously well and then it looks for a /dev/tun and fails. Here are my logs. any suggestions?

Mon Dec 14 15:54:02 2009 us=160082 OPTIONS IMPORT: route options modified
Mon Dec 14 15:54:02 2009 us=160296 OPTIONS IMPORT: --ip-win32 and/or --dhcp-opt
on options modified
Mon Dec 14 15:54:02 2009 us=164904 ROUTE default_gateway=10.41.42.1
Mon Dec 14 15:54:02 2009 us=168780 Note: Cannot open TUN/TAP dev /dev/tun: No s
ch file or directory (errno=2)
Mon Dec 14 15:54:02 2009 us=169665 Note: Attempting fallback to kernel 2.2 TUN/
AP interface
Mon Dec 14 15:54:02 2009 us=183214 Cannot allocate TUN/TAP dev dynamically
Mon Dec 14 15:54:02 2009 us=184008 Exiting

One more update. What I have is an unmodded droid. Figured out that the kernel probably does not have the tun device enabled or loaded. I do not know if the support for such a device exists in the kernel. Is the only solution then to load a custom kernel? Or is there a non-destructive method to load this module dynamically?

You can try this:
http://android-vpnc.googlecode.com/files/android-vpnc-20090208.tar.bz2

extract this file and you'll find a tun.ko at others/

I read your comments and I do agree with your opinion but I would like to further add some thing that we never be so strict in our personal opinions as it takes us towards extremism

BY JAMES
MTO: mcsa

One more update. What I have is an unmodded droid. Figured out that the kernel probably does not have the tun device enabled or loaded. 70-271 I do not know if the support for such a device exists in the kernel. Is the only solution then to load a custom kernel? Or is there a non-destructive method to load this module dynamically?

Hi Cristophe and congrats for this wonderful app.
Unfortunately I can't get it working on my HTC Magic.
I receive "connecting" message for less than a sec, afterwards I see a black empty screen.
Problem is that I can't see any logs (with or without "log-apend openvpn.log" into the config file) and if I want to share the logs via email, all that I get is an empty email.
The config file together with the certificates moved to a PC a working !!!

Any idea?
Thanks

Hi,
I managed to find out that i don't have liblzo.so in the lib folder. I have installed the app. from the market and my phone is not rooted, so i cannot manualy copy the file.
Could you check why the file is not installed automatically when downloadind from market?
Thanks

I´ve installed the app from market, too. After clicking on the connection I also see only a black screen. Is there already a solution available?

I Love Belgium... and you?

About Me
GnuPG Public Key Still More LinkedIn profile
Photos
Projects
WeIDS 2.0 Linux Lessons WiFi Auth Project
Documentation
Acer Aspire 2012 WLMi Acer TM 4002 WLMi IR-receiver (Win)(NL)
Links
Ubuntu Belgium Planet Grep

FOSDEM BruCON Profoss hacker emblem www.cacert.org Get OpenOffice Get Firefox Get Thunderbird