Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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'd like to run this command without having to open up terminal every time.

sudo openvpn --config /home/ubuntu/Documents/vpnbook/vpnbook-euro2-udp25000.ovpn --auth-user-pass /home/ubuntu/Documents/vpnbook/password.txt

Would it be possible to make a script launchable from Unity's launcher?

share|improve this question

First, because you're about not to use terminal, I change sudo to gksu. And then, if you've created a script like this:

gksu openvpn --config /home/ubuntu/Documents/vpnbook/vpnbook-euro2-udp25000.ovpn --auth-user-pass /home/ubuntu/Documents/vpnbook/password.txt

and named it, you can create a file like this (taken from this answer):

#!/usr/bin/env xdg-open

[Desktop Entry]
Name=<Enter visible name here>
Comment=<Enter comment here>

For example, you named the file your-launcher.desktop. Place it in ~/.local/share/applications/, open nautilus and drag-and-drop your-launcher.desktop into the Unity launcher.

Besides that, maybe (but I've not tested yet) you can place gksu openvpn --config /home/ubuntu/Documents/vpnbook/vpnbook-euro2-udp25000.ovpn --auth-user-pass /home/ubuntu/Documents/vpnbook/password.txt directly in Exec field of your-launcher.desktop.

share|improve this answer
In addition, if you don't want to provide your password every time you run the command, do the following: 1) Do not change sudo to gksu 2) Make openvpn sudoable without password. Here's how:… – S Prasanth May 20 '13 at 7:08
also, don't forget to make it executable – mchid Feb 13 '14 at 8:05

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.