OpenVPN on Raspbmc

Hi,

I have a Model B Pi 1 running Raspbmc (Kodi 14.1). I want to install & configure OpenVPN to connect to my NAS remotely (from a different physical location). Ive read a few posts on other sites about installing OpenVPN on Kodi (such as http://brianhornsby.com/kodi_addons/openvpn), so that shouldn’t be an issue.

Is there a way to configure Raspbmc to connect to my VPN on each boot? I am planning on saving my username/password to a file and referring to this in the OVPN config file, so it shouldnt need any manual interaction.

This is so that I can connect to the MySQL database & media sources serving my media content.

I am a relative newb on Linux, but am willing to learn. I am running OSMC on my Pi2, but am sticking to Raspbmc on my Pi 1’s until we get to RC on OSMC.

Thanks

Graeme

Hi Graeme,

you will need to put your config into /etc/openvpn and give it a specific name e.g. vpn.conf. OSMC is using systemctl to control the started services. So “systemctl start openvpn@vpn.service” should start your connection while “systemctl enable openvpn@vpn.service” would configure it as a boot time service. Before using systemctl you may want to use “openvpn --config /etc/openvpn/vpn.conf” to test your setup.

Cheers

Fred

Hi, (Alpha4 on pi 1 B)
I logged in through SSH and ran:

  1. sudo bash
  2. apt-get install openvpn

but get Unable to locate package openvpn. Any suggestions as to what is needed to access openvpn repo ?.

P.S. This worked on raspbmc latest version (XBian_2015.02.28_rpi.img) and I was able to install Datho VPN. Also openvpn did not ask for credentials, instead the Datho add-on has a gui settings page where you can enter the server address and your password.

Best regards,
Nookdog

Thanks for your quick reply Frank, Ive got an error:

Tue Mar 10 18:18:06 2015 IMPORTANT: OpenVPN’s default port number is now 1194, based on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Tue Mar 10 18:18:06 2015 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Tue Mar 10 18:18:06 2015 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Tue Mar 10 18:18:06 2015 LZO compression initialized
Tue Mar 10 18:18:06 2015 UDPv4 link local (bound): [undef]
Tue Mar 10 18:18:06 2015 UDPv4 link remote: [AF_INET]xx.xx.xxx.xxx:1194
Tue Mar 10 18:18:06 2015 WARNING: this configuration may cache passwords in memory – use the auth-nocache option to prevent this
Tue Mar 10 18:18:07 2015 [synology.com] Peer Connection Initiated with [AF_INET]xx.xx.xxx.xxx:1194
Tue Mar 10 18:18:09 2015 Note: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)
Tue Mar 10 18:18:09 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Mar 10 18:18:09 2015 /sbin/ifconfig 10.8.0.6 pointopoint 10.8.0.5 mtu 1500
SIOCSIFADDR: Operation not permitted
: ERROR while getting interface flags: No such device
SIOCSIFDSTADDR: Operation not permitted
: ERROR while getting interface flags: No such device
SIOCSIFMTU: Operation not permitted
Tue Mar 10 18:18:09 2015 Linux ifconfig failed: external program exited with error status: 1
Tue Mar 10 18:18:09 2015 Exiting

Ive redacted my IP address where applicable.

Any idea why im getting this?

What about running it as root (sudo)?

Its now appearing working. When I do use Sudo, SSH connection doesnt ask for the next command, it just looks as though its still working.

I can ping its internal IP from another machine on the same network (via OpenVPN).

Now to try it from within Kodi…

Thanks!

Now ive got OpenVPN working on-demand, I tried the systemctl thing above, but I get an error:

systemctl: command not found.

Ive tried it using sudo too, but nothing. Any ideas?

Hi Nookdog,

did you run a apt-get update before?

Cheers

Fred

systemctl is specific to OSMC. If this is specific to rapsmbc, you should be searching/posting to http://forum.osmc.tv/forumdisplay.php?fid=7

Hi fzinken,
No, only because I came across a report that said use of sudo had caused problems on raspbmc.

I have now and OpenVPN installed but there are some 404 errors: 404 Not Found [IP: 5.153.225.206 80]
Thank you.

Hi Nookdog,

So you mean you have 404 errors when doing a sudo apt-get update? That should not be a problem and just might be that one of the central raspbian servers are not reachable. But if you were able to do a sudo apt-get install openvpn you should be fine and the 404 error should not be an issue for successful openvpn operation.

Cheers

Fred

Hi Fred, Thank you.