Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running ubuntu version 12.04 LTS and I have installed OpenVPN on it. After a while of troubleshooting why my client won't connect (I have generated keys and confligured the client), I ran 'service openvpn status' from the command line and received the following error:

could not access PID file for VPN 'server'

I have rebooted, started and restarted the service, but each time I check the status, I receive the PID error. I'm pretty sure that I can't connect because the service isn't running.

Where can I begin troubleshooting this? I don't know what to look for. Any help is greatly appreciated.


share|improve this question
try this when your Server has finished booting and is running as usual ps ax | grep openvpn please post the output of this command. – Harrys Kavan Nov 13 '12 at 9:05
This is the only line that comes up: "root 24079 0.0 0.1 9376 888 pts/0 S+ 13:10 0:00 grep --color=auto openvpn" – dingalingchickenwiing Nov 13 '12 at 13:10
this means that the openvpn is not running on the maschine you're using. – Harrys Kavan Nov 14 '12 at 15:37
What's in your server.conf? Do you use the user or group options to change the user of the vpn process? if so, do the specified user and group exist? OpenVPN will also log something, either to syslog or to a logfile specified (file has to be writable by the user you specified). You can use the verb option to increase the verbosity of the log entries. – Thomas May 30 '14 at 7:41

could not access PID file for VPN 'server' means the PID file could not be read. This can have different reasons:

  • you do not have the rights to read the pid file -- did you run the command as root or with sudo?
  • the pid file does not exist, as the process is not running or could not create the file for some reason

Thus, for further debugging, you will need to look at /var/run/ itself

  • does it exist?
  • is there an openvpn process running with the pid listed in the file?
  • are there other openvpn processes running?

If the process is not running, your config is most probably wrong and you will have to read the logs why it did not start. Running service openvpn start might bring helpful output too.

share|improve this answer

It seems like, you do not have an automatic start script! Which is usual. OpenVPN does not install such a thing by it self, as far as i know...

First of all try executing the server manually.
This will need an own Terminalwindows to run. And for the time OPENVPN is running this way, the TerminalWindow will not be usable for other stuff.

Try this (replace /etc/openvpn/config-files/ with your Path):

openvpn /etc/openvpn/config-files/server.conf

Some Information will appear in this Window.
Now try to connect to the Server with a client. You can shut the openvpn down by hitting CTRL+C

If this was the solution, do following for executing the OpenVPN-Server after your System has booted.

Do this in the terminal:

vim /etc/init.d/

and tipe in the following lines:

#! /bin/sh
# /etc/init.d/ #
openvpn /etc/openvpn/config-files/server.conf

This would be for the Server. Of course you have to change /etc/openvpn/config-files/ to your Path!!!

For Clients do the same, just be sure to choose the client.conf!

Then you'll add this script, to start after the system booted.
Do this in the terminal:

update-rc.d defaults

It might say hes missing headers. You can ignore that for now.
I'm not sure what "defaults" does, I think it means to start as a "normal" programm, after finishing booting and doing deep System stuff.

share|improve this answer
when I ran the first command you posted (openvpn <path>/server.conf) I received the following error: "WARNING: Failed running command (--up/--down): external program fork failed" - this is a good thing, I now have something to research. I'm looking it up online, will report back when I find something or hit a roadblock. – dingalingchickenwiing Nov 14 '12 at 23:54
Sounds strange.. I've never heard of it! Have luck finding the answer! – Harrys Kavan Nov 18 '12 at 17:49

The startup script will just try to start OpenVPN, but it will not give you any error messages if it fails. Manually execute OpenVPN

$ openvpn /etc/openvpn/server.conf

And solve any errors that you see there. If you do not see errors, check that you did not set log to off, and maybe increase verbosity with verb.

share|improve this answer

By default, Ubuntu ships OpenVPN with a legacy startup script. This makes Upstart unable to restart service when it crashes. Legacy scripts also make use of pid files, which are not necessary with native Upstart jobs. So having a native job looks like a solution to your problem.

I've written Upstart job definition for OpenVPN myself and use it for 2 years without problems. Download the files below, then replace your /etc/init.d/openvpn with a symlink to /lib/init/upstart-job, run sudo initctl reload-configuration. You can edit /etc/default/openvpn to customize deamon startup (by default all VPNs from /etc/openvpn/ are run). Instances (CONN variable for connection job) are named after /etc/openvpn/*.conf files, without extension.




This solution is compatible up to Ubuntu 14.04 LTS, there are minor issues with 14.10 and in 15.04 Upstart is gone.

share|improve this answer

The init script just reporting that OpenVPN didn't start , and due to that openvpn can't read the pid file.
You have to check system/daemon/openvpn log to see why couldn't start.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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