What I really like about the vCenter C# Client was that you could stay logged indefinitely. Maybe not the best thing from a security stand point but it was damn convenient. The vSphere Web Client on the other hand has always had an idle timeout value. From a home lab point of view it’s really frustrating constantly being logged out.
The default idle timeout in the vCenter Server Appliance 6 (VCSA) is 120 minutes. I know of no way to modify this via the Web Client itself but it is modifiable via the Shell. The timeout value is contain in the webclient.properties file. The location of this file has changed from previous versions of the VCSA. Prior to version 6 it was found in /var/lib/vmware/vsphere-client/. In version 6 it’s found in /etc/vmware/vsphere-client/.
At the Command prompt of the VCSA type the following to enable Shell access.
Shell is disabled.
Command> shell.set --enabled true
Now at the Shell type the following below and locate session.timeout.
You should find something similar to session.timeout = 120 as this is the default value.
Make a backup copy of webclient.properties.
cp /etc/vmware/vsphere-client/webclient.properties /etc/vmware/vsphere-client/webclient.properties.bak
If you’re comfortable using an editor like VI go ahead and use that to increase or decrease the value in minutes. The timeout value, though, can quickly and easily be modified using the sed command.
The sed command below locates the specific string session.timeout = 120 and replaces it with session.timeout = 1440, which is 24 hours. Change 1440 to however many idle minutes you want. If sed doesn’t find the specific string, don’t worry, it won’t modify anything. To set the client to never idle timeout set the value to 0.
sed -i “s/session.timeout = 120/session.timeout = 1440/g” /etc/vmware/vsphere-client/webclient.properties
Run the cat command again and check that the session.timeout value has changed.
If the session.timeout value has been modified correctly we now have to stop and restart the vsphere-client service by running the following commands below. I covered stopping and starting services on a VCSA in a previous post.
service-control --stop vsphere-client
service-control --start vsphere-client
Wait a few minutes for the service to start up fully and open a new browser windows to the vSphere Web Client. It should now be running with a new idle timeout.
As a general disclaimer you should only be going into the Shell on the VCSA if you are comfortable with what you are doing. Of course make a backup of any files you are modifying and, of course, to play it safe take a snapshot of the VCSA VM.