VMware Cloud Community
littleantz77
Contributor
Contributor

How to edit .vmx

Hi,

I did try searching about this topic and most of the answer does not applies to me or I am missing something.

http://communities.vmware.com/thread/107485

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1714

http://communities.vmware.com/message/2001553

are the topics about editing vmx and I can't see how they edit their vmx

I am using vSphere client on Vsphere ESXi

I am not familiar with commands in ssh so I decided to download the .vmx file and reupload it.

The problem is that everytime I edit the .vmx file, when I upload it, it is not recognized as .vmx file anymore. I cannot add it back to inventory.

I am using Notepad++ to edit the file.

Is there spedial editor for this file?

I also saw in some topics that it should be editable from right click > edit but I do not have Edit contect menu when I right click the file.

I attached my right click context menu.

Thanks

Reply
0 Kudos
19 Replies
vmroyale
Immortal
Immortal

Hello.

What are you trying to edit exactly in the .VMX? You can right-click on the powered-off virtual machine in the Hosts and Clusters view and access the "Edit Settings" options there to access the virtual machine properties editor. Use the Options tab and the General field and then click the Configuration Parameters button. Many of the .VMX settings are accessible here for editing.

Good Luck!

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
Reply
0 Kudos
a_p_
Leadership
Leadership

I agree with vmroyale  on how this should be done. So this is just to explain why the uploaded .vmx file shows up as "file".

ESXi is very picky about the correct file format. For the .vmx file it uses "0A" (LF) instead of "0D 0A" (CR/LF) for line breaks. I assume your editor just uses the wrong format and you may need to either configure it differently or use another editor.

André

Reply
0 Kudos
littleantz77
Contributor
Contributor

Thanks for your reply.

I am trying to add audio capability on my VM

I am adding the strings according to this article

http://virtualization.blognotions.com/2011/07/27/virtual-hd-audio-hardware-in-vsphere-5/

I am adding this at the end of the .vmx file

sound.present = “true”
sound.allowGuestConnectionControl = “false”
sound.virtualDev = “hdaudio”
sound.fileName = “-1"
sound.autodetect = “true”
sound.pciSlotNumber = “34"

Do you have official process of how to do this?

Why is audio not part of the VMs?

Here is my related topic why I need to do this.

http://communities.vmware.com/message/2014603#2014603

Thanks

Reply
0 Kudos
aravinds3107
Virtuoso
Virtuoso

Assuming you are running vSphere 5.0 with VM hardware version 7 or 8 to enable Audio feautre on the VM

1) Shutdown the VM

2) Right Click on VM and Select Remove from Inventory

3) SSH to the ESXi host using Putty

4) Change your working directory to VM folder

cd /vmfs/volumes/datastorename/vmfolder

5) VI vmname.vmx

6) Press i (for insert option)

7) Add the lines which you need

😎 Press Escape to Exit and ZZ to write the change

9) Connect using vSphere Client and browe the VM folder in datastore

10) Add VM back to inventory and Power ON

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful |Blog: http://aravindsivaraman.com/ | Twitter : ss_aravind
Reply
0 Kudos
littleantz77
Contributor
Contributor

I get this error on step 5

/vmfs/volumes/4f71e6aa-10110a36-c2c2-001b21afa74e/TEST1 # VI TEST1.vmx
-sh: VI: not found

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal

here's what we've found to be an effective way of editing the vmx file.  Using WinSCP, connect into the host in question, then browse to the VM's directory. Double clicking on the vmx file will open a text editor.  From there make your edits and save the file.  It will be saved in the proper format and youe vmx file will then be edited.

my .02 worth.....

Reply
0 Kudos
littleantz77
Contributor
Contributor

Troy Clavell wrote:

here's what we've found to be an effective way of editing the vmx file.  Using WinSCP, connect into the host in question, then browse to the VM's directory. Double clicking on the vmx file will open a text editor.  From there make your edits and save the file.  It will be saved in the proper format and youe vmx file will then be edited.

my .02 worth.....

it becomes non vmx file again after editing using winSCP Smiley Sad

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal

please attach .vmx file in question... We can edit it for you, if you'd like.

Reply
0 Kudos
a_p_
Leadership
Leadership

Did you see my previous post about the line breaks?

-sh: VI: not found

Linux/Unix commands are case sensitive. Use vi insted of VI.

André

Reply
0 Kudos
peetz
Leadership
Leadership

So, why don't you just add these parameters through the vSphere client GUI -> VM Properties -> Options -> General -> Configuration Parameters ?

hdaudio.vmx.jpg

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
Reply
0 Kudos
littleantz77
Contributor
Contributor

Troy Clavell wrote:

please attach .vmx file in question... We can edit it for you, if you'd like.

Here is my vmx file. Thanks a lot.

Note: this is already not recognized as vm after I made my edits. I hope it can be repaired.

Thanks

Reply
0 Kudos
littleantz77
Contributor
Contributor

Andreas Peetz wrote:

So, why don't you just add these parameters through the vSphere client GUI -> VM Properties -> Options -> General -> Configuration Parameters ?

19326_19326.jpghdaudio.vmx.jpg

I can't get to that gui because first step is to remove the VM from inventory.

That gui can be access by right click on VM. Unless there is other way to access that gui, I will be glad to use it.

Thanks

Reply
0 Kudos
a_p_
Leadership
Leadership

With all the typos fixed, this may work Smiley Wink You shouldn't try to copy&paste from a web site.

sound.present = "“TRE" --> = "TRUE"
sound.allowGuestConnectionControl = "“FALS" -> = "FALSE"
sound.virtualDev = "“hdaudi"” -> = "hdaudio"
sound.fileName = "“-" -> = "-1"
sound.autodetect = "“TRE" -> = "TRUE"
sound.pciSlotNumber =ZZ “34" -> = "34"

André

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal

also, just in case.  The new .vmx is attached

Reply
0 Kudos
littleantz77
Contributor
Contributor

It's actually not a typo.. when I save it it becomes like that but I am sure I typed it correctly.. some quotes also are being replaced by question marks in other versions.

I did it many times and also copying and pasting from notepad to comand window but when I save it and reload the file all is garbled.

Did you attach something? I did not see any attachment.

Thanks

Reply
0 Kudos
littleantz77
Contributor
Contributor

The file is not valid vmx. Add to Inventory button is not enabled when I right click after I upload your file.

Smiley Sad

Reply
0 Kudos
peetz
Leadership
Leadership

You don't need to remove the VM from the inventory if you add the parameters through the GUI.

If you use the GUI the ESX host will reload the vmx-file without the need to remove and re-add it from inventory.

So, you just need to power it off, add the parameters, then power it on again.

- Andreas

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
littleantz77
Contributor
Contributor

I did the gui approach but the audio still wasn't there in windows when I power on the VM. And when I view the .vmx again, the settings I made wasn't there again. Is there some sort of special way to save it? I only click OK button. Is that supposed to be saved by pressing OK button?

is there any other way adding Audio device on VM?

If I did not find a way, perhaps vmware is not for me.

seems like vmware is great but I need audio badly on the VMs.

Thanks

Reply
0 Kudos
littleantz77
Contributor
Contributor

You don't need to remove the VM from the inventory if you add the parameters through the GUI.

If you use the GUI the ESX host will reload the vmx-file without the need to remove and re-add it from inventory.

So, you just need to power it off, add the parameters, then power it on again.

- Andreas

The parameter changes I made is not saved.

I tried it a couple of times. Just adding one line. Then click OK, and OK again.

Then re open configuration parameters. My changes is not there.

Looks like it is not saving.

How to save the changes from GUI?

I haven't registered/activated my vSphere. it is newly installed. Do I need to register to save parameters?

Thanks

Reply
0 Kudos