One of the things I love about Twitter is being able to just happen upon a conversation that gives you some knowledge you can tuck away for when you need it. Once example was a conversation started by Jason Boche, Jason had run into an issue where he needed to edit the settings of a Virtual Machine (VM) but was unable to. Apparently the older C# vSphere client is unable to edit the virtual machine configuration for the new vSphere 5.5 version 10 hardware, you can only do this via the web client (later confirmed that this was “by design” by Duncan Epping in the same Twitter thread). VMware, for the last year or so, has been moving towards making the web client the standard and have further pushed this with vSphere 5.5. One problem arises in this scenario though, you still need the C# client to get your environment up and running, at least if you are building from scratch (I need VMs for AD, vCenter, SSO, and the web client etc…), or how about a scenario where vCenter or the the web client is unavailable – what then?
All of a VM’s settings are stored with a file with an extension of .VMX. While I don’t typically suggest editing this file manually, it appears (at least with 5.5 in beta) that this will be a skill VMware admins should hone, or at least bookmark a few handy blog sites for reference. I’ll assume for purposes of this post that you are using the C# client because the web client is unavailable (otherwise just edit with the web client). There are other advanced troubleshooting reasons where you may need to edit a .VMX file manually but it was this particular Twitter conversation that got me thinking it would be handy to document.
- Start the vSphere (C#) client and power off the VM if it is not already powered off. Also remove the VM from inventory by right clicking and select remove from inventory.
- Navigate to Datastores and Datastore Clusters. If the VM is stored on local storage, you could also browse the datastore from the Hosts and Clusters >> ServerName >> Configuration >> Storage view
- Right click the datastore where the VM is stored and select Browse Datastore. Find the folder of your virtual machine.
- Highlight the .vmx file and click the download button. Make a copy so you can revert easily if need be.
- Open the .vmx file in your favorite text editor.
- Upload the new file and re-add the VM to inventory.
What you will need to change within the file will depend on your specific scenario for why you are editing it in the first place. Maybe you need to change the name of the network the VM is connecting to, in this scenario look for something similar to:
ethernet0.networkName = "VM Network"
And edit that for your environment. VMware, as you might come to expect, has a few good KB articles on editing a .vmx files for different use cases:
I am hoping that the ability to edit a VM with hardware version 10 is just a beta oversight or bug, but if it does prove to be true edit a .vmx file will become part of all our lives very soon. I have trouble envisioning a scenario where VMware will bundle the web client into ESXi, but maybe they will release a stand alone appliance where the web client, like the C# client can connect directly to an ESXi hosts? Lets hope!