Tuesday, September 27, 2011

Fixed: Cisco VPN client minimized on Windows 7 taskbar & disconnected

Cisco Systems VPN Client 5.0.0.7.0410 has worked for a month since I first installed it on Windows 7 Enterprise x64. One day, the VPN Client 'connect' window started minimized and stayed in the tool bar when launching. There's no useful choices in pop-up menus for the client window minimized on the taskbar and the VPN service (cvpnd.exe) icon in the Windows tray. Not choices were listed to 'minimize' , 'maximize', 'restore', or 'move'.  Since the Cisco VPN client was launched as 'disconnected', it was basically useless!

Googling found it is rather common a problem and people usually blame it on older versions of the Cisco VPN clients, latest Windows updates, etc. Originally I intended to write a javascript to launch the binary (vpngui.exe) with its window maximized. The javascript snippet I wrote in the past is not handy, so I continued my search a little bit more, only to stumble upon  this thread in a Microsoft forum. One of the answers pointed me to the direction. That is, the direct cause is rather simple. That is, window sizing somehow got messed up in vpnclient.ini under "C:\Program Files\Cisco Systems\VPN Client". 

vpnclient.ini looked like below. Instead of LogWindow* to have super big numbers, my copy has WindowX & WindowY assigned super big numbers. Once I changed WindowX and Window Y to match WindowWidth & WindowHeight, respectively, it started to launch the Cisco VPN client Connect window normally again.  I experimented a little bit more. It seems that the absolute number does not matter such, as long as they are not ridiculously big.

I have dual heads (dual display) setup. HP Elitebook laptop drives two HP L2245wg monitors. A similar thread on Virtual PC 2007 console disappearing problem suspected that dual display may have contributed to erroneous setting with this huge number. On the other hand, this work laptop is a managed node, so, I won't be surprised if something was pushed by our dear IT department to my laptop to cause this by accident or regression. 
 
Important thing is, the fix is simple and I'm happy for now. I will keep an eye on this to see if it gets messed up again.

Before (messed-up version)
---------cut-------------8<---------C:\Program Files\Cisco Systems\VPN Client\vpnclient.ini ----------------8<----------
[main]
ClientLanguage=
[GUI]
DefaultConnectionEntry=OneOfFortune500ciscoVPN
WindowWidth=485
WindowHeight=99
WindowX=4294935296
WindowY=4294935296
VisibleTab=0
ConnectionAttribute=0
AdvancedView=1
LogWindowWidth=0
LogWindowHeight=0
LogWindowX=0
LogWindowY=0
---------cut-------------8<----------------------------------8<----------

After (fixed and verified to be working).
---------cut-------------8<---------C:\Program Files\Cisco Systems\VPN Client\vpnclient.ini ----------------8<----------
[main]
ClientLanguage=
[GUI]
DefaultConnectionEntry=OneOfFortune500ciscoVPN
WindowWidth=485
WindowHeight=99
WindowX=485
WindowY=99
VisibleTab=0
ConnectionAttribute=0
AdvancedView=1
LogWindowWidth=0
LogWindowHeight=0
LogWindowX=0
LogWindowY=0