1

I'm using RaspBMC and have set up a VPN using openVPN and PrivateInternetAccess. I've been following the third comment on this post which I have used previously and has worked. A few weeks ago, it stopped working on boot. If I run it manually, so type

sudo openvpn /etc/openvpn/London.conf

into putty, it works fine, but only until the next time it reboots. The instructions in this post edit the startup file for openVPN, but I've also tried to use a cronjob to launch it on boot with no luck. I'll post the openVPN startup file at the end. Please let me know anything else I should post that may help. Thanks in advance.

Openvpn startup script:

# This is the configuration file for /etc/init.d/openvpn

#
# Start only these VPNs automatically via init script.
# Allowed values are "all", "none" or space separated list of
# names of the VPNs. If empty, "all" is assumed.
# The VPN name refers to the VPN configutation file name.
# i.e. "home" would be /etc/openvpn/home.conf
#
#AUTOSTART="all"
#AUTOSTART="none"
#AUTOSTART="home office"
AUTOSTART="London"
#
# Refresh interval (in seconds) of default status files
# located in /var/run/openvpn.$NAME.status
# Defaults to 10, 0 disables status file generation
#
#STATUSREFRESH=10
#STATUSREFRESH=0
# Optional arguments to openvpn's command line
OPTARGS=""
#
# If you need openvpn running after sendsigs, i.e.
# to let umountnfs work over the vpn, set OMIT_SENDSIGS
# to 1 and include umountnfs as Required-Stop: in openvpn's
# init.d script (remember to run insserv after that)
#
OMIT_SENDSIGS=0
1

I have used LXDE's(X11 Desktop environment) 'autostart' file as a start up source for VPN and some other applications. 'autostart' file runs automatically every time the Raspbian starts.

Normally you can find the file at following paths,

/etc/xdg/lxsession/LXDE/autostart

or

~/.config/lxsession/LXDE/autostart

Just add your application to be run on boot to the file as shown below, using '@' before application name

@openvpn

  • Thanks for the suggestion, should that be installed already or do I need to apt-get install something? – Rob Mackinnon Feb 5 '15 at 9:05
  • LXDE is the default Desktop environment and it will be installed already. Please check. – MVSR Feb 5 '15 at 9:07
  • It's not there, I'm guessing because it's RaspBMC rather than a regular linux build so the default desktop environment is the XBMC user interface. Should I look into installing it or is that likely to just destabilise the entire system? – Rob Mackinnon Feb 5 '15 at 9:43
  • It will be there in Raspbian by default. I am not sure about RaspBMC. Try this command and let me know. "#sudo update-rc.d openvpn defaults" – MVSR Feb 5 '15 at 10:42
  • Definitely not there. Can't seem to find a way of installing it as well, I've followed instructions but hasn't worked at the moment. – Rob Mackinnon Feb 6 '15 at 9:34
0

I couldn't work out what was going on here, but I changed from RaspBMC to Xbian, and it's solved the problem. I think it's because the set up instructions were designed for Raspbian and Xbian is closer to it, though that's just a noob guess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.