Knowledge Base
The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides

|
Tips for editing a .vmx file (1714)
Details
Solution
Working with the .vmx file
Some workaround procedures include steps that require you to edit .vmx files.
Note these important characteristics of the .vmx file:
- The .vmx file is typically located in the directory where you created the virtual machine.
-
- In Windows XP / Server 2003, the default location for the file is
C:\Documents and Settings\<your_user_name>My Documents\Virtual Machines\<virtual_machine_name>.vmx.
- In Windows Vista / Windows 7 / Windows Server 2008, the default location for the file is
C:\Users\<your_user_name>\My Documents\Virtual Machines\<virtual_machine_name>.vmx.
- In Linux, vmware-cmd -l lists the full path to all registered .vmx files.
- In Windows XP / Server 2003, the default location for the file is
- The virtual machine actively writes to its .vmx file. Never edit this file while its virtual machine is running.
- Changes to the file are usually version specific. If you upgrade, the workaround you implemented may no longer work.
Before you edit the .vmx file:
- Always power off the virtual machine.
- Make sure you are logged on as a user with the correct permission level to edit the file.
- Make a backup copy of the .vmx file. If your edits break the virtual machine, you can roll back to the original version of the file.
Note: VMware also recommends making a backup copy of the edited file. If future administrative changes to the virtual machine overwrite your edited version, you can cut and paste the specific section you want from the backup copy into the current file. Do not replace an entire .vmx file with an older backup.
ESX/ESXi with vCenter Server
Any manual additions to the .vmx file from ESX/ESXi are overwritten by the entries stored in the vCenter Server database.
If you need to edit a virtual machine's .vmx file, first remove it from vCenter Server's inventory (right-click it and choose Remove from Inventory). After you edit it, register the virtual machine again from the ESX command line.
If you need to edit a virtual machine's .vmx file, first remove it from vCenter Server's inventory (right-click it and choose Remove from Inventory). After you edit it, register the virtual machine again from the ESX command line.
- For ESX 3.x, the command is:
vmware-cmd -s register /vmfs/volumes/datastore/virtual machine directory/virtual machine name.vmx
Where datastore is the datastore name, virtual machine directory is the directory containing the virtual machine files, and virtual machine name is the name of the virtual machine files.
For example:
vmware-cmd -s register /vmfs/volumes/Storage1/vm1/vm1.vmx
Output return code =1 signals success.
-
For ESXi 3.5, ESX/ESXi 4.x, and ESXi 5.0, the command is:
#vim-cmd solo/registervm /vmfs/vol/datastore/dir/vm.vmx
For example:
#vim-cmd solo/registervm /vmfs/volumes/Storage1/vm1/vm1.vmx
Keywords
Request a Product Feature
To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.
Actions
KB:
- Updated:
- Categories:
- Languages:
- Product Family:
- Product(s):
- Product Version(s):

