A Quick Hack With vSphere Web Client Timeout
Last week I released a tiny tool called DoubleCloud Client, which eases the usage of vSphere Web Client. I didn’t have time to add another hack which can bypass the session timeout of vSphere Web Client.
By default, vSphere Web Client times out after 30 minutes of inactivity according to VMware Doc. After timing out, you got to re-login and click back to the page you left out. It’s good for the security, but also not convenient. If you use it on your own desktop and have set up screen saver with password protection, you don’t really need this security feature.
If you want a longer timeout, you can change the setting as William illustrated in his article. In this article, I will show you how to stay connected all the time with a newer version of DoubleCloud Client.
My approach is non-intrusive, meaning you don’t need to change anything on the vSphere server which requires restarting service and affects all the sessions afterwards. With DoubleCloud Client, any user can individually choose whether to time out or not.
To do that, I added a new menu item, under the File menu, which is checkable. It’s not turned on upon starting up, but you can click on the menu item and have it turned on. After that, your session of vSphere Web Client never expires.
You may be curious how it can do the maggic. The idea is simple. A vSphere server terminates a session because the session has been idle over the maximum time. If a client could fake an interaction with the server before the maximum time arrives, the server is fooled that you are still active and resets the session timer. Because I have all the control of the DoubleCloud Client, I simply added a timer which triggers one interaction with the server before the session timeout comes.
Easier said than done. There are some real tricks on how to renew timer and call methods on GUI components from a different timer thread. Since these are coding level details with C#, I won’t discuss them here unless you are really interested to know more. Just leave a comment if so.
The newer version of DoubleCloud Client is uploaded to the original article so you can download it there. Again, no liability or whatsoever there for anyone’s use.