In the last days I was in need to connect to the company network to do "some regulations" (... like Garrus ;) ), and my OpenVPN connection was not working. I tried from my HD2 and I had no problems, so I did my job from there (complaining about having the smaller screen), repromising to myself that as soon as possible I'll had to fix it. Today was time to do, but it was not so easy as I though.

The hardware is a Galaxy Tab 7 (GT-P1000), with a custom rom based on Cyanogen 7.1 (kernel 2.6.35.7, Mod version CyanogenMod-7.1.0-GalaxyTab-KANG bringing Android 2.3.7, thanks to Technomancer).

First I installed OpenVPN installer and settings, from the Android Market. Installed bins in /etc/xbin and then choose /etc/xbins/bb. But after installation, I got:

Linux ifconfig failed: could not execute external program.

OpenVPN wasn't able to run ifconfig. It took me a while and some googling to figure out I had to choose different path in OpenVPN installer. First /etc/xbins, then /etc/xbin again (NOT /etc/xbins/bb). After that I faced a new error. Using OpenVPN settings I checked the first checkbox on the top, OpenVPN. It runs:

modprobe tun

Then I checked one of my VPNs configuration. It asked me user and password (it's a roadwarrior one), then...

Fatal: cannot allocate TUN/TAP dev dynamically

I thought that finally was everything ok, but I was wrong. I passed the auth process, but then I wasn't able to allocate TUN/TAP dev dynamically. Umpf. I had to open a term on the Galaxy Tab and run:

insmod /system/lib/modules/tun.ko

But the path on my installation was different. In my installation was /system/lib/modules/2.6.35.7/tun.ko, so I changed the insmod to:

insmod /system/lib/modules/2.6.35.7/tun.ko

It finally worked. But before closing everything, modify /data/local/userscript.sh (or whatever else you like, just ne sure it is executed at boot) to run the insmod (so you'll avoid to open term and write "insmod /system/lib/modules/2.6.35.7/tun.ko" every time you need to rise a VPN after switching on your device).

That's all. Happy OpenVPN!

 

Notes (April, 3rd 2012)

To use OpenVPN on your Galaxy Tab 7 you NEED a rooted tablet, and BusyBox installed on it. Otherwise it will never work. I suggest, instead of rooting the stock ROM (with that hugly wooden background everywhere and all the Samsung junk loaded on it) to flash CyanogenMod 7. See this article about flashing CM7 on your Samsung Galaxy Tab 7.