Home > Powershell, VMware, Windows > vSphere Client on Windows 7

vSphere Client on Windows 7

September 4th, 2009 Leave a comment Go to comments

Update 2010-03-03: Keep in mind that this was fixed in vSphere 4 Update 1. Although if you can’t move to Update 1 for some reason, this will still work.

Update 2009-09-08: I just updated the script because I received a report from wohali (Joan) over at VMware communities that they had a problem when the vSphere client was installed on a different drive and I have now fixed that problem.  I also added in support for making the host update utility work as well.  Lastly, I added a few output messages so you can see what’s going on and know what is getting done.

The past few months I have been enjoying Windows 7 quite a bit (both the RC and now the RTM), but at the office we use VMware for many of our clients and the vSphere Client unfortunately has an issue with Windows 7 due to an incompatibility with a .Net 2.0 library dll that comes installed on Windows 7.  When you install the vSphere client, you will be able to get through the install without an issue usually (If you have J# already installed you may encounter issues installing the vSphere client), but once you try to connect to your vSphere server you get an error stating “Error parsing <server> clients.xml file  Login will continue contact your system administrator” followed immediately by another error “The type initializer for “VirtualInfrastrcture.Utils.HttpWebRequestProxy” threw an exception” which then brings you back to the login screen and you are unable to connect in.

There’s big thread over at VMware Communities that discusses this problem and ways to fix it.  Unfortunately, it’s a manual process and deploying this out to all of our Windows 7 employee workstations is a bit of a hassle, so I have created a Powershell script that will do the necessary work for you, and create a shortcut on your desktop as well.

By default, powershell security options may prevent you from executing the script, so you may have to change a setting temporarily to get it to work.  If you type “Get-ExecutionPolicy” from a powershell window you will most likely see “Restricted” but there are a few others as well which will all prevent you from executing the script.  You can read more about this over at dotnetvj.com where he goes into a little more detail about these execution policies and what they mean.  All you need to do though is type “Set-ExecutionPolicy Unrestricted”  Just remember that you should probably set the execution policy back to its previous value after you run the script for security purposes.  Lastly, you will also need to run powershell as an administrator if you have UAC turned on because this script has to add files to the installation folder of your vSphere client.

Launch Powershell as Administrator

Launch Powershell as Administrator

Once you have powershell running as an administrator and change the execution policy, it is a simple process to run this script, simply CD to the folder that you have extracted the script, and run it by typing “.Windows7vSphere.ps1” and it will do the work of copying over the System.dll and creating the necessary files to launch vSphere client in development mode so it can use the System.dll.

Execute Windows7vSphere.ps1

Change execution policy and execute Windows7vSphere.ps1

You should now have an icon on your desktop called “VMware vSphere Client (Windows 7)” which you then simply run as administrator to launch the vSphere client.  The reason you have to launch it as administrator is because it creates an environment variable that lets the vSphere client know that you are giving it a different System.dll to work with.  This is something also discussed in detail in the thread over at VMware Communities.

For anyone interested in powershell, this script also shows a few cool things such as reading from the registry, writing to an xml document, as well as creating a windows shortcut using pretty simple commands.

Hopefully this will help a few people streamline the process of getting the vSphere client installed on your Windows 7 machines.  If you notice any problems with the script, feel free to comment and let me know and I’ll try to fix it as soon as possible.

Download the script and the dll needed here: Download Windows7vSphere.zipDownload Windows7vSphere.zip

Categories: Powershell, VMware, Windows Tags: , ,
Share/Save
  1. low351
    September 11th, 2009 at 14:41 | #1

    Extremely helpful, thank you for taking the time to share this.

  2. dlorenso
    November 7th, 2009 at 14:37 | #2

    Thank you for this post. It was a real lifesaver. After upgrading to Windows 7, I almost was locked out of my colo because of the vSphere Client incompatibility problem. With this update you provided, I was back up and running in less than 5 minutes. Awesome work! VMWare community should thank you!

  3. ahmedlibrian
    June 28th, 2010 at 04:39 | #3

    Hi,

    I have tried it on my windows server 2008 Standard (x64) but it won’t work. Still the same error. Need more help why it won’t work.

  4. June 29th, 2010 at 14:33 | #4

    You no longer need my patch to make this work. You should update your vSphere/vCenter installation to the latest version and grab the refreshed installer and you should be fine in Windows 7/2008 R2

  1. November 2nd, 2009 at 07:00 | #1
  2. November 6th, 2009 at 08:07 | #2
  3. March 3rd, 2010 at 20:35 | #3
You must be logged in to post a comment.