I ve developed a .net application to access the vsphere server and perform tasks on it.
In my application im opening the console of a virtual machine in a browser by generating an url for the vm, as it is mentioned in http://www.virtuallyghetto.com/2011/10/how-to-generate-vm-remote-console-url.html.
But the console is opening only when the web client is already logged in in another tab in the browser, else "null" is displayed in the webpage.
so i need to keep the web client logged in in the browser always or i should open the client and login through the c# code.
Pls suggest some way to resolve this.
thanks
You can extend the timeout for your webclient by setting it to 0. so it will not never let you logout. below is the procedure.
Hi,
Configure the vSphere Web Client Timeout Value
By default, vSphere Web Client sessions terminate after 120 minutes of idle time, requiring the user to log in again to resume using the client. You can change the timeout value by editing the webclient.properties file.
Operating System | File path |
Windows 2003 | %ALLUSERSPROFILE%Application Data\VMware\vSphere Web Client |
Windows 2008 | %ALLUSERSPROFILE%\VMware\vSphere Web Client |
vCenter Server Appliance | /var/lib/vmware/vsphere-client |
2. Edit the file to include the line session.timeout = value where value is the timeout value in minutes.
NOTE: To set the client to never time out, specify a negative or 0 value for the timeout.
For example, to set the timeout value to 60 minutes, include the line session.timeout = 60.
3. Restart the vSphere Web Client service.
Thanks for the reply. I'm just accessing the vsphere server through a web link.
I dont understd how installation path comes here ? pls clear me if im missing something.
Thanks.
Hi,
Its not a installation... You just need to locate the web client file and edit with the settings and save it to get the requirement as per your wish.
Dont you have access on the vcenter or the location where is the webclient exe has been installed? as its a component of vcenter installation. and you need to modify the same location via login in to the vcenter or vcsa .
I dont find any webclient.properties file in my local machine. Well, everything is hosted in our server. So i guess the file should be available in my server and unfortunately i dont ve access to the file.
I just have a login id to make use of the resources available in the vsphere server.
Is it possible to set the timeout value only for my login id ?
Thanks.
Afaik, there is not any way apart from that which can preserve your session for long time.
But you can achieve it in a tricky way. As browser get logged out if no activity is there, you can set autorefresh of your browser so your session will not be logged out. This is an workaround for your issue.
(Note: you can google the multiple way to set auto refresh interval for your browser.