I have a wireless connection that connects automatically on its own just fine. In network settings it is set to:

"Automatically connect when it is available" & "All users may connect to this network".

When I check the box "Automatically connect to VPN when using this connection" it stops automatically connecting all together. What happens is the wireless icon spins as if it is trying to connect, then the disconnected notification pops up a couple times as if it failed. When I then manually click the wireless connection in the drop down it connects and logs into the VPN perfectly.

After searching the internet for solutions the only answer I found was to unencrypt my default key ring. I am on a personal desktop so this is potentially fine however it didn't fix my issue.

Any help debugging or advice getting me closer to a solution would be greatly appreciated. Thanks!

Edit - In case it matters, my wireless card is a Rosewill RNWD-N9003PCe.


I was having the same issue with Ubuntu/Linux Mint and I found it was related to my wireless driver.

See if you have a realtek card with lspci

02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188EE Wireless Network Adapter (rev 01)

If followed these steps to fix:

sudo apt-get install linux-headers-generic linux-headers-$(uname -r) build-essential dkms git
git clone https://github.com/FreedomBen/rtl8188ce-linux-driver
cd rtl8188ce-linux-driver
sudo make install
sudo cp -r firmware/* /lib/firmware
echo "options rtl8188ee ips=0 fwlps=0" | sudo tee /etc/modprobe.d/rtl8188ee.conf
  • I don't have that card, I have a Rosewill RNWD-N9003PCe. I don't know enough to know if it could be a similar issue? Thanks. – Sloth Armstrong Jan 21 '15 at 14:55

I found a solution here.

First, figure out the UUID of your VPN connection.

nmcli con list | grep -i vpn

The UUID is the second column with the letters, numbers and dashes.

Simple solution: Add the following command to the startup application list. (Follow the above link to see how.)

nmcli con up uuid <put you UUID here>

Complicated/Advanced solution: It takes my wifi a while to connect, so if the above command is run immediately at startup (before wifi is connected), it will fail, without retrying. So I wrote a shell script to run at startup, which tries to connect every few seconds (and eventually gives up if it can't connect).

#This script autoconnects a vpn on startup.
#It just runs the vpn connect command in a while loop.

#Whatever is returned by nmcli con list | grep -i vpn
VPN_UUID=<Whatever your UUID is>

VPN_RETRY_TIME=2 #how many seconds until you retry?
MAX_RETRIES=30 #how many time will you try before you give up?

#run the command once, so the while loop has 
#something to check the first time around
nmcli con up uuid $VPN_UUID
SUCCESS=($? = 0)

ATTEMPT_COUNT=1 #the number of times we've tried to connect.

   sleep $VPN_RETRY_TIME #it just keeps on trying
   nmcli con up uuid $VPN_UUID
   SUCCESS=($? = 0)

Save the above code into a .sh file somewhere. Edit it so that "Whatever your UUID is" (line 5) is the long, complicated number you got from the first command. Make it executable (chmod +x fileName.sh), and then add it to the startup application list.)

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.